1 | last_move_x = move_x |
2 | if (move_x == 0) |
3 | { |
4 | move_x_count = 0 |
5 | if (idle_x_count < max_move_counter) |
6 | idle_x_count += 1 |
7 | } |
8 | else |
9 | { |
10 | idle_x_count = 0 |
11 | if (move_x < 0) |
12 | { |
13 | if (move_x_count > 0) |
14 | move_x_count = 0 |
15 | if (move_x_count > (-max_move_counter)) |
16 | move_x_count -= 1 |
17 | } |
18 | else if (move_x > 0) |
19 | { |
20 | if (move_x_count < 0) |
21 | move_x_count = 0 |
22 | if (move_x_count < max_move_counter) |
23 | move_x_count += 1 |
24 | } |
25 | } |