| 1 |
if (can_move == true) |
| 2 |
{ |
| 3 |
speed = max_speed; |
| 4 |
switch (1) |
| 5 |
{ |
| 6 |
case global.left_keyp: |
| 7 |
direction = 180; |
| 8 |
break; |
| 9 |
case global.up_keyp: |
| 10 |
direction = 90; |
| 11 |
break; |
| 12 |
case global.right_keyp: |
| 13 |
direction = 0; |
| 14 |
break; |
| 15 |
case global.down_keyp: |
| 16 |
direction = 270; |
| 17 |
break; |
| 18 |
} |
| 19 |
} |
| 20 |
if (place_meeting(x, y, obj_chem_05_maze_wall)) |
| 21 |
{ |
| 22 |
audio_play_sound(snd_chem_crash, 1, 0); |
| 23 |
obj_chem_05_maze_puzzle.puzzle_game_over = true; |
| 24 |
} |
| 25 |
var victory = obj_chem_05_maze_puzzle.puzzle_game_victory; |
| 26 |
if (place_meeting(x, y, obj_chem_05_maze_puzzle_goal) && !victory) |
| 27 |
{ |
| 28 |
audio_play_sound(snd_chem_win, 1, 0); |
| 29 |
with (obj_chem_05_maze_puzzle) |
| 30 |
{ |
| 31 |
draw_puzzle_layer = false; |
| 32 |
if (puzzle_level_current < 2) |
| 33 |
{ |
| 34 |
countdown_current = 4; |
| 35 |
alarm[0] |
| 36 |
puzzle_level_current += 1; |
| 37 |
} |
| 38 |
else |
| 39 |
{ |
| 40 |
other.can_move = false; |
| 41 |
puzzle_game_victory = true; |
| 42 |
} |
| 43 |
event_user(0); |
| 44 |
alarm[1] |
| 45 |
} |
| 46 |
} |