Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dunes_boulders_Step_0

(view raw script w/o annotations or w/e)
1
if (shadow_id == noone)
2
    shadow_id = instance_create(x, (y_target + sprite_height / 2), obj_dunes_boulders_shadow)
3
var shadow_index = 1 - (y - y_target) / (y_target - 300 - y_target)
4
shadow_id.image_xscale = shadow_index
5
shadow_id.image_yscale = shadow_index
6
y += fall_speed
7
fall_speed += 0.2
8
fall_speed = clamp(fall_speed, 0, 12)
9
if (y > y_target)
10
{
11
    if point_in_rectangle(x, y, __view_get((0 << 0), 0), __view_get((1 << 0), 0), ((__view_get((0 << 0), 0)) + (__view_get((2 << 0), 0))), ((__view_get((1 << 0), 0)) + (__view_get((3 << 0), 0))))
12
    {
13
        var break_sound = audio_play_sound(snd_rock_break, 1, 0)
14
        audio_sound_gain(break_sound, 0.7, 0)
15
        if (!instance_exists(obj_screenshake_player))
16
        {
17
            var screenshake = instance_create(obj_pl.x, obj_pl.y, obj_screenshake_player)
18
            with (screenshake)
19
            {
20
                alarm[0] = 10
alarm[0]

audio_stop_sound(rumble_sound)
21
                intensity = 1
22
            }
23
        }
24
        else
25
            obj_screenshake_player.alarm[0] = 10
26
        for (var i = 4; i >= 0; i--)
27
            instance_create(x, y, obj_dunes_small_boulders)
28
    }
29
    if place_meeting(x, y, obj_pl)
30
    {
31
        global.battle_enemy_name = "boulders minifight"
32
        global.battling_enemy = true
33
        global.battling_boss = false
34
        global.sound_carry_overworld = true
35
        if (room != rm_death_screen)
36
            global.current_room_overworld = room_get_name(room)
37
        global.battle_start = true
38
        if (!instance_exists(obj_heart_initiate_battle_quick))
39
            instance_create(x, y, obj_heart_initiate_battle_quick)
40
    }
41
    instance_destroy()
42
    instance_destroy(shadow_id)
43
}