the next day I'm going watch the tutorial "moving platform", to make a moving platform in my game
Tuesday, May 30, 2017
Gamemaker Day 51
Today I learned how to make my player can jump through the walls, what i did : first I load a sprite for the platform wall, and set y to 0 , so that the player would land on top of the sprite , and not in the middle of it. then I use "parent" to make the platform wall has the same effect as the normal wall.then I create variable that make the wall has no sprite on the create event, then I make a draw event to draw the sprite out but it has no function on the sprite , it was only the sprite on the game. on the step event, I use " if (instance_exists(obj_player))" meaning if the player exists then run the code down below, this make sure of the player is in the game in order to active the code. then if the player exists, then i use "(if(round(obj_player.sprite_height/2)) > y)" which to check if my player is below the platform wall, if it is then "mask_index = spr_platform" to make the platform wall sprite to no sprite , expect the y-int.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment