2d

Problem with Pygame movement acceleration, platformer game [duplicate]

可紊 提交于 2020-11-29 10:22:25
问题 This question already has answers here : Pygame doesn't let me use float for rect.move, but I need it (2 answers) Closed 7 days ago . When i move right using the right key, i accelerate to a max speed. When i release it, i do decelerate to a stop so that is fine. However, when moving left using the left key, and after releasing it, i continue moving at a fixed speed and then come to an abrupt stop after a short while. Any idea what could be wrong with my code? The original code is from http:/

Problem with Pygame movement acceleration, platformer game [duplicate]

我的梦境 提交于 2020-11-29 10:22:22
问题 This question already has answers here : Pygame doesn't let me use float for rect.move, but I need it (2 answers) Closed 7 days ago . When i move right using the right key, i accelerate to a max speed. When i release it, i do decelerate to a stop so that is fine. However, when moving left using the left key, and after releasing it, i continue moving at a fixed speed and then come to an abrupt stop after a short while. Any idea what could be wrong with my code? The original code is from http:/