Commit efb197c
committed
Fix #3569: Fix Tux not turning around in 1-block gaps
When Tux is in a 1-block gap, his horizontal velocity becomes zero.
If the fancy idle timer was active, the draw() function would wait
for the timer to finish before updating the sprite's direction,
ignoring user input. This patch adds a check during the idle wait
state to force an action update if the direction changes,
resetting the idle stage to zero.
A unit test (PlayerAnimationTest) was also added to verify the
state machine logic for the idle animation turnaround
Closes #35691 parent d479f68 commit efb197c
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2238 | 2238 | | |
2239 | 2239 | | |
2240 | 2240 | | |
| 2241 | + | |
| 2242 | + | |
2241 | 2243 | | |
2242 | 2244 | | |
2243 | 2245 | | |
| |||
2270 | 2272 | | |
2271 | 2273 | | |
2272 | 2274 | | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
2273 | 2281 | | |
2274 | 2282 | | |
2275 | 2283 | | |
2276 | | - | |
| 2284 | + | |
2277 | 2285 | | |
2278 | 2286 | | |
2279 | | - | |
| 2287 | + | |
2280 | 2288 | | |
2281 | 2289 | | |
2282 | 2290 | | |
| |||
0 commit comments