Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_chem_05_maze_puzzle_player_Step_0

related scripts: Create_0Draw_0Step_0 Step_2

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