Tuesday, June 13, 2017

Gamemaker Day 57

Today I learned how to create an animation for the player, what i did : first I create a sprite for my running animation, I loaded 4 different image that make the player looks like running. then on the player object step event : I put "if(move !=0) image_xscale = move;" meaning if the player isn't facing the right side, it will reverse the image when the player move to the left side. and then I use "if(place_meeting(x,y+1),obj_wall)" check if the player is touching the ground. then I put "If(move! = 0) sprite_index = spr_player_run. when the player is moving , it will change the index of the sprite to the running image of the player. last i put "else sprite_index = spr_player;" if the player isn't moving , then it will change back to the normal sprite.




the next day I'm going to watch the tutorial "collision mask" , so the player will collide with the wall perfectly.

No comments:

Post a Comment