1 |
switch scene |
2 |
{ |
3 |
case 0: |
4 |
if (scr_interactscr_interactfunction scr_interact() //gml_Script_scr_interact
{
if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_scr_normal_state)
{
var pl_dir = obj_pl.direction
var pl_x = 0
var pl_y = 0
var check_distance_x = 0
var check_distance_y = 0
switch pl_dir
{
case 0:
pl_x = obj_pl.bbox_right
pl_y = obj_pl.bbox_top + 1
check_distance_x = 20
break
case 180:
pl_x = obj_pl.bbox_left
pl_y = obj_pl.bbox_top + 1
check_distance_x = -20
break
case 90:
pl_x = obj_pl.x
pl_y = obj_pl.bbox_top
check_distance_y = -20
break
case 270:
pl_x = obj_pl.x
pl_y = obj_pl.bbox_bottom
check_distance_y = 20
break
}
if collision_line_first(pl_x, pl_y, (pl_x + check_distance_x), (pl_y + check_distance_y), id, false, false)
return true;
}
} () && keyboard_multicheck_pressed(0)) |
5 |
{ |
6 |
scene = 1 |
7 |
scr_cutscene_startscr_cutscene_startfunction scr_cutscene_start() //gml_Script_scr_cutscene_start
{
global.cutscene = true
obj_pl.state = gml_Script_scr_frozen_state
obj_pl.image_index = 0
obj_pl.image_speed = 0
} () |
8 |
} |
9 |
break |
10 |
case 1: |
11 |
scr_textscr_textfunction scr_text() //gml_Script_scr_text
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue)
} () |
12 |
with (msg) |
13 |
{ |
14 |
message[0] = "* (A couch not unfit for a# thrift store.)" |
15 |
message[1] = "* (These cramped living# conditions are bringing back# unpleasant memories.)" |
16 |
message[2] = "* (Hop on?)" |
17 |
ch_msg = 2 |
18 |
ch[1] = "Yes" |
19 |
ch[2] = "No" |
20 |
if (outcome == 1) |
21 |
other.scene = 2 |
22 |
else if (outcome == 2) |
23 |
{ |
24 |
instance_destroy() |
25 |
other.scene = 0 |
26 |
scr_cutscene_end() |
27 |
} |
28 |
} |
29 |
break |
30 |
case 2: |
31 |
instance_create(obj_pl.x, obj_pl.y, obj_player_npc) |
32 |
cutscene_advance() |
33 |
break |
34 |
case 3: |
35 |
if (obj_player_npc.ystart < y) |
36 |
cutscene_npc_walk(1168, 200, obj_player_npc.ystart, 3, "y", "up", "nothing", 250, 150) |
37 |
else |
38 |
cutscene_npc_walk(1168, 250, 150, 3, "y", "up") |
39 |
break |
40 |
case 4: |
41 |
cutscene_wait(0.5) |
42 |
break |
43 |
case 5: |
44 |
tile_layer_hide(-240) |
45 |
scr_path_jumpscr_path_jumpfunction scr_path_jump(argument0, argument1, argument2, argument3) //gml_Script_scr_path_jump
{
with (argument0)
{
jump_path = path_add()
path_add_point(jump_path, argument0.x, argument0.y, 100)
path_add_point(jump_path, (argument1 + (sign(argument0.x - argument1)) * (min(abs(argument0.x - argument1), 15))), (argument2 - argument3), 75)
path_add_point(jump_path, argument1, argument2, 100)
path_set_kind(jump_path, 1)
path_set_closed(jump_path, false)
path_start(jump_path, 4, path_action_stop, false)
audio_play_sound(snd_playerjump, 1, 0)
}
} (obj_player_npc, 250, 135, 5) |
46 |
audio_play_sound(snd_playerjump, 1, 0) |
47 |
cutscene_advance() |
48 |
break |
49 |
case 6: |
50 |
with (obj_player_npc) |
51 |
{ |
52 |
if scr_path_jump_end() |
53 |
{ |
54 |
action_sprite = true |
55 |
sprite_index = right_sprite_idle |
56 |
image_angle += 90 |
57 |
other.scene++ |
58 |
} |
59 |
} |
60 |
if (!alarm[0]) |
61 |
alarm[0] = 75alarm[0]with (obj_player_npc)
{
sprite_index = spr_pl_lying
image_angle = 0
}
alarm[1] = 1 |
62 |
break |
63 |
case 7: |
64 |
if (global.down_keyp || global.up_keyp || global.left_keyp || global.right_keyp || keyboard_multicheck_pressed(0) || keyboard_multicheck_pressed(1) || keyboard_multicheck_pressed(2)) |
65 |
{ |
66 |
alarm[0] = -1alarm[0]with (obj_player_npc)
{
sprite_index = spr_pl_lying
image_angle = 0
}
alarm[1] = 1 |
67 |
alarm[1] = -1alarm[1]instance_create((obj_player_npc.x - 3), (obj_player_npc.y - 15), obj_npc_sleepo_z)
alarm[0] = 50 |
68 |
cutscene_advance() |
69 |
} |
70 |
break |
71 |
case 8: |
72 |
with (obj_player_npc) |
73 |
{ |
74 |
sprite_index = down_sprite |
75 |
image_index = 1 |
76 |
image_speed = 0 |
77 |
image_angle = 0 |
78 |
} |
79 |
scr_path_jumpscr_path_jumpfunction scr_path_jump(argument0, argument1, argument2, argument3) //gml_Script_scr_path_jump
{
with (argument0)
{
jump_path = path_add()
path_add_point(jump_path, argument0.x, argument0.y, 100)
path_add_point(jump_path, (argument1 + (sign(argument0.x - argument1)) * (min(abs(argument0.x - argument1), 15))), (argument2 - argument3), 75)
path_add_point(jump_path, argument1, argument2, 100)
path_set_kind(jump_path, 1)
path_set_closed(jump_path, false)
path_start(jump_path, 4, path_action_stop, false)
audio_play_sound(snd_playerjump, 1, 0)
}
} (obj_player_npc, 250, 150, 4) |
80 |
audio_play_sound(snd_playerjump, 1, 0) |
81 |
cutscene_advance() |
82 |
break |
83 |
case 9: |
84 |
with (obj_player_npc) |
85 |
{ |
86 |
if scr_path_jump_end() |
87 |
{ |
88 |
instance_destroy() |
89 |
other.scene = 0 |
90 |
scr_cutscene_end() |
91 |
} |
92 |
} |
93 |
tile_layer_show(-240) |
94 |
break |
95 |
} |