Platformer-style jump?
by Ricardo Reyna · in Torque Game Engine · 03/15/2008 (12:59 pm) · 0 replies
Is it possible to make it so that the player stops accelerating when the jump-button (spacebar or whatever) is released? I've been trying for hours to figure out how to get this to work, mainly looking in player.cc, updateMove(...). I've tried adding an if-else to check whether or not the player has initiated a jump and released the jump-button, and if so to start falling back down, but it didn't work. I might not be implementing it correctly, I tried to do it by setting mFalling to true. I can see in the console that it does set mFalling to true, but nevertheless the player continues the jump like normal.
I'm not sure exactly how the jumping works, or if it is somehow calling another function even after I've set mFalling to true... Any advice would be greatly appreciated!
I'm not sure exactly how the jumping works, or if it is somehow calling another function even after I've set mFalling to true... Any advice would be greatly appreciated!