Timeline for Why does my character move up forever when he jumps with this code?
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 25, 2014 at 7:15 | comment | added | user3478282 |
I switched velY=0.2f; to velY+=0.001f; and it works how I wanted it to :) 0.1f or even 0.01f is extremely fast for some reason :/ but whatever, Thanks a bunch for the help :)
|
|
Apr 25, 2014 at 7:13 | comment | added | user1430 | You can also search this site for "2D jumping" and similar to find other questions discussing how to implement a good jump. You may find them better suited than your current approach. | |
Apr 25, 2014 at 7:10 | comment | added | user1430 | Use your debugger to examine the state of the data every frame (or print it to a log file). That should help you diagnose what other areas of the code are problematic. | |
Apr 25, 2014 at 7:09 | comment | added | user1430 | Do you ever set the velocity elsewhere? If you don't reduce it to zero over time, of course he will still go up since you imparted a constant velocity. | |
Apr 25, 2014 at 7:05 | comment | added | user3478282 | Seems like the same thing is happening :/ As I hold down up, my "character" continues to go up. | |
Apr 25, 2014 at 6:59 | history | answered | user1430 | CC BY-SA 3.0 |