Jumping mechanics - need help!
thornster19
Member Posts: 9
Hi all,
I have been trying to think of how to get a good jump going. I like the jump I have made so far but there is one problem. When I press right or left as I jump, the character glides for a while before he touches the ground. Is there any way to make it so that doesn't happen? I assume it's because right and left are programmed to move the character and the controls are interfering somewhat.
Cheers,
Thornster19
I have been trying to think of how to get a good jump going. I like the jump I have made so far but there is one problem. When I press right or left as I jump, the character glides for a while before he touches the ground. Is there any way to make it so that doesn't happen? I assume it's because right and left are programmed to move the character and the controls are interfering somewhat.
Cheers,
Thornster19
Comments
http://forums.gamesalad.com/discussion/38132/gs-tool-box-a-free-mega-template-ready-now/p2
I contributed a jump and double jump section with notes to a tool box of other useful bits ... its free so download it and see if any of it helps
Thanks for the help. I have only just seen this message because I didn't get a notification from Gmail. I stumbled across this answer whilst searching the forums and it has solved my problem.
http://forums.gamesalad.com/discussion/41645
The reason why I had the glide was as I suspected.
The problem was, I was using move instead of changing the velocity x and y. Once you change these, the problem of gliding goes away. When you create your movements i.e left, right and jump (in this case) under the do section you just add a change attribute and in the change attribute, you add the line set: self.motion.linearVelocity.x to 100 (or a higher value if you want to go faster) for right, -100 for left (again, higher if you want to go faster) and you would change it in the Y to a positive number to get a jump going on. Hope this helps anyone who comes across this problem.
Thornster