Jumping help!!
crazymooseapps
Member, PRO Posts: 30
Ok i have on screen controls and I have a button for jumping, my problem is unless that button is held in the jump and animation is cut way short!! I want to work when pressed not held down! Help please?!
Comments
If [button is pressed]
Timer after 0 seconds [with Run to Completion CHECKED]
Animate
To explain, Run to Completion forces behaviors (in this case, Animate) to complete regardless of the status of the rule condition.
Another way to do this:
If [button is pressed]
Change attribute game.animate to true
If attribute game.animate is true
Animate
If self.Image = [last frame of animation]
Change attribute game.animate to false
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
So would this code go under the button or under the player animation? Im assuming player animation?
But also it appears the height of the jump is tied to length of time button is held in, how to correct that?
If your button actor and player actor are separate, then make a game attribute of type boolean called game.animate and try this:
button actor
If [button is pressed]
Change attribute game.animate to true
player actor
If attribute game.animate is true
Animate
If self.Image = [last frame of animation]
Change attribute game.animate to false
I'm not sure about the jump height. It depends how you have your rules set up.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I appreciate the help! Worked like a charm! I will fogure out the height by messing around lol