| 1 | if (move_right == true) |
| 2 | { |
| 3 | switch (x) |
| 4 | { |
| 5 | case 130: |
| 6 | destination = 160; |
| 7 | move_right = false; |
| 8 | break; |
| 9 | case 160: |
| 10 | destination = 190; |
| 11 | move_right = false; |
| 12 | break; |
| 13 | } |
| 14 | active = true; |
| 15 | } |
| 16 | if (move_left == true) |
| 17 | { |
| 18 | switch (x) |
| 19 | { |
| 20 | case 160: |
| 21 | destination = 130; |
| 22 | move_left = false; |
| 23 | break; |
| 24 | case 190: |
| 25 | destination = 160; |
| 26 | move_left = false; |
| 27 | break; |
| 28 | } |
| 29 | active = true; |
| 30 | } |
| 31 | if (active == true) |
| 32 | { |
| 33 | if (x < destination) |
| 34 | x += shuffle_speed; |
| 35 | else if (x > destination) |
| 36 | x -= shuffle_speed; |
| 37 | else |
| 38 | active = false; |
| 39 | } |