Loading...
131
10 months ago

Game Maker Studio: Platformer tutorial!


Here's the code!

Create event:

/// Create event

// Main

hsp = 0 // Horisontal speed

vsp = 0 // Vertical speed

// Physics

grav = 0.3 // Gravity

move_sp = 5 // Move speed

jump_f = 10 // Jump force

Step event:

/// Step event

// Keys imput

right_k = keyboard_check(ord("D")) // Right key imput

left_k = keyboard_check(ord("A")) // Left key imput

jump_k = keyboard_check_pressed(vk_space) // Jump key imput

// Physic and else

move = right_k - left_k // Move imput

hsp = move * move_sp // Walk physic imput

vsp += grav // Gravity physic imput

// Jump logic

if (place_meeting(x,y+1,obj_solid)) and (jump_k) // If player pressed the jump button on the ground

{

vsp -= jump_f // Jump system logic

}

// Collisions

// Horisontal collision

if (place_meeting(x+hsp,y,obj_solid)) // Collision with ground

{

while (!place_meeting(x+sign(hsp),y,obj_solid)) // If there wasn't any collison

{

x += sign(hsp) // Player can move

}

hsp = 0 // Player can't move

}

// Vertical collision

if (place_meeting(x,y+vsp,obj_solid)) // Collision with ground

{

while (!place_meeting(x,y+sign(vsp),obj_solid)) // If there wasn't any collison

{

y += sign(vsp) // Player can move

}

vsp = 0 // Player can't move

}

// X and Y imput

x += hsp

y += vsp



4 comments

Loading...

Next up

Ну, как-то так.

Devlog №3

My Little Test Game OST - Carnival Of Dead Spirits.

My Little Test Game OST - Dense Forest

#music

Akatori is an epic metroidvania where you wield your staff to fight, jump, and explore diverse realms across different eras.

It's also one of the games that's part of Steam Next Fest!

Play the Steam Next Fest demo now: https://bit.ly/Akatori

Okay, so, today under gj post i got a replay by user @Nicpitah_Studios

As they said, they're (probably group of people, i dunno) indie mobipe developer, and shower one of their games.

I tried it, and this is tuff.

Go follow them. And play their game.

Happy Devruary! Devruary Day 28 celebrates @Decrypt ! He's the game dev behind Fractal! We also have a question for the devs of Game Jolt: What game dev skill are you trying to level up next?

Creating level :3

Мда Санёк, ты, конечно, натворил шумихи.

Take a trip to Nostalgia Land in @JacksonG13 's Sky World 64, a cozy sandbox game that harkens back to the 64-bit era.

This survival experience takes heavy inspiration from Minecraft’s Skyblock!

Play the Steam Next Fest demo now: https://bit.ly/SkyWorld64

И так продолжаем.