th next day I'm going to watch the tutorial "wall jump", so that the player can jump over walls.
Wednesday, June 7, 2017
Gamemaker Day 55
Today I learned how to make the player has double jump. What i did : first I create the double jump variable "jumps = 0 and jumpsmax = 2" , for the jumpsmax is meaning to how many times can the player jump. and jumps is when the player hits the ground to reset the variable. then I changed something in the player object on step event. I use " if(place_meeting(x,y+1,obj_wall)" the function that i code before , it mean if player is hitting the ground then run " jumps = jumpsmax" , which will the jumps variable to 2. then I use "if (key_jump) && (jumps > 0)" to check if the jump key is being pressed and the jumps variable is above 0 also meaing the player is touching the ground, then it will run "jump -=1 and vsp = -jumpspeed". which it will reduce the jumps variable to -1. it will stop the player from jumping again.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment