Loading...

GameMaker Tut: Player movement

592 views

Loading...

Loading...

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Uploaded on May 1, 2010

You will learn how to create a player that can jump and move. The player
will also be able to change sprites or images as he goes.


Here are all the codes:


if (place_free(x,y+1))
{ gravity = 3; gravity_direction = 270; sprite_index = spr_jump;
}
else
{ gravity = 0;
}


if (keyboard_check(vk_right) && place_free(x+3,y)) { x += 3; image_speed = 0.5; image_xscale = 1; }
if (keyboard_check(vk_left) && place_free(x-3,y)) { x -= 3; image_speed = 0.5; image_xscale = -1; }
if (!place_free(x,y+1) && keyboard_check(vk_right) || keyboard_check(vk_left))
{ sprite_index = spr_run;
}


if (!keyboard_check(vk_right) && !keyboard_check(vk_left) && !place_free(x,y+1)) { sprite_index = spr_stand; }


if (!place_free(x,y+1) && keyboard_check_pressed(vk_up)) { vspeed = -18; sprite_index = spr_jump; }

  • Category

  • License

    • Standard YouTube License

Loading...

When autoplay is enabled, a suggested video will automatically play next.

Up next


to add this to Watch Later

Add to

Loading playlists...