Hello dear Game Maker pros,
I bought Game Maker 8 recently and now I'm figuring out how to create Jump n Run game elements. With big help by Alex May, I could set gravity and the controls for a simple square in a small room. I use it like my test room before making a real stage.
Now I have some trouble to shoot for the wall objects, which consist of a simple vertical sprite.
1. When I'm jumping on a free wall element, like you see it in the picture, the square gets stuck. - I guess this has something to do with the gravity but I'm not sure.
2. When I jump next to a wall and holding the arrow key for walking towards it, the square can do kind of a double jump which is not to be intended.
3. The square always stops like 1 or 2 pixels away from the wall and does not touch it directly.
If it helps, here is the STEP events code:
// Gravity
// check if in air, step event
if(place_free(x,y+1))
{
gravity = 0.3; // turn on the gravity
}
if (vspeed >= 12)
{
vspeed = 12;
}
// Controls
if (keyboard_check(vk_left))
{
x -= 5;
}
else if (keyboard_check(vk_right))
{
x += 5;
}
if (keyboard_check_pressed(vk_space) and !place_free(x,y+1))
{
vspeed = -8;
}
and the code when colliding with the wall object:
I hope you pros can help me a bit. I'd appreciate that.
Cheers,
Aries