|
1
|
if (init == false)
|
|
2
|
{
|
|
3
|
if (!i_ex(obj_sprhighlight))
|
|
4
|
instance_create(x, y, obj_sprhighlight);
|
|
5
|
create_highlight(obj_mainchara);
|
|
6
|
create_highlight(obj_caterpillarchara);
|
|
7
|
create_highlight(obj_actor);
|
|
8
|
lerper = glow;
|
|
9
|
if (fadeparallax)
|
|
10
|
{
|
|
11
|
if (layer_exists("PARALLAX_1"))
|
|
12
|
{
|
|
13
|
var targdepth = layer_get_depth("PARALLAX_1") - 1;
|
|
14
|
var bgmark = scr_marker_extscr_marker_ext
function scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{
var thismarker = instance_create(arg0, arg1, obj_marker);
with (thismarker)
{
depth = arg8;
sprite_index = arg2;
image_speed = arg5;
image_xscale = arg3;
image_yscale = arg4;
image_index = arg6;
image_blend = arg7;
image_alpha = arg11;
if (arg9)
scr_depth_alt();
}
if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker;
}
function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false)
{
if (is_undefined(arg0))
{
debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist");
return -4;
}
var sprite = layer_sprite_get_sprite(arg0);
var index = layer_sprite_get_index(arg0);
var imagespeed = layer_sprite_get_speed(arg0);
var xscale = layer_sprite_get_xscale(arg0);
var yscale = layer_sprite_get_yscale(arg0);
var angle = layer_sprite_get_angle(arg0);
var blend = layer_sprite_get_blend(arg0);
var alpha = layer_sprite_get_alpha(arg0);
var xloc = layer_sprite_get_x(arg0);
var yloc = layer_sprite_get_y(arg0);
var thismarker = instance_create_depth(xloc, yloc, arg1, obj_marker);
with (thismarker)
{
sprite_index = sprite;
image_index = index;
image_speed = imagespeed;
image_xscale = xscale;
image_yscale = yscale;
image_angle = angle;
image_blend = blend;
image_alpha = alpha;
if (arg2)
scr_depth_alt(id, arg2);
}
return thismarker;
}
function scr_assetgetinfo(arg0)
{
var sprite = layer_sprite_get_sprite(arg0);
var index = layer_sprite_get_index(arg0);
var xloc = layer_sprite_get_x(arg0);
var yloc = layer_sprite_get_y(arg0);
var xscale = layer_sprite_get_xscale(arg0);
var yscale = layer_sprite_get_yscale(arg0);
var angle = layer_sprite_get_angle(arg0);
var blend = layer_sprite_get_blend(arg0);
var alpha = layer_sprite_get_alpha(arg0);
var imagespeed = layer_sprite_get_speed(arg0);
return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed];
} (0, 0, spr_pxwhite, room_width, room_height, undefined, undefined, c_black, targdepth);
|
|
15
|
array_push(legendmarker, bgmark);
|
|
16
|
}
|
|
17
|
}
|
|
18
|
}
|
|
19
|
if (scr_debugscr_debug
function scr_debug()
{
if (global.debug == 1)
return 1;
} () && keyboard_check_pressed(vk_add))
|
|
20
|
{
|
|
21
|
falling = true;
|
|
22
|
fall_timer = 0;
|
|
23
|
}
|
|
24
|
if (falling == true)
|
|
25
|
{
|
|
26
|
if (fall_timer == 0)
|
|
27
|
{
|
|
28
|
shadows = false;
|
|
29
|
active = true;
|
|
30
|
glow = 1;
|
|
31
|
with (obj_sprhighlight)
|
|
32
|
yoffset = -2;
|
|
33
|
transition_length = 30;
|
|
34
|
}
|
|
35
|
if (fall_timer == 30)
|
|
36
|
{
|
|
37
|
snd_play(snd_glassbreak, 1, 0.5);
|
|
38
|
snd_play_delay(snd_glassbreak, 4, 0.5, 0.5);
|
|
39
|
}
|
|
40
|
if (fall_timer >= 30 && fall_timer <= 33)
|
|
41
|
{
|
|
42
|
with (obj_sprhighlight)
|
|
43
|
yoffset = remap(30, 33, -2, 2, other.fall_timer);
|
|
44
|
}
|
|
45
|
if (fall_timer >= 40)
|
|
46
|
{
|
|
47
|
active = false;
|
|
48
|
fall_timer = 0;
|
|
49
|
falling = false;
|
|
50
|
}
|
|
51
|
else
|
|
52
|
{
|
|
53
|
fall_timer++;
|
|
54
|
}
|
|
55
|
}
|
|
56
|
var _debug_toggle = scr_debugscr_debug
function scr_debug()
{
if (global.debug == 1)
return 1;
} () && keyboard_check_pressed(ord("V"));
|
|
57
|
if (_debug_toggle)
|
|
58
|
{
|
|
59
|
shadows = true;
|
|
60
|
active = !active;
|
|
61
|
debug_print("roomglow toggled");
|
|
62
|
glow = round(clamp01(1 - glow));
|
|
63
|
if (keyboard_check(vk_lshift))
|
|
64
|
lerper = glow;
|
|
65
|
}
|
|
66
|
if (lerper != glow || !init || _debug_toggle)
|
|
67
|
{
|
|
68
|
lerper = scr_movetowardsscr_movetowards
function scr_movetowards(arg0, arg1, arg2)
{
if (arg0 == arg1)
return arg0;
else if (arg0 > arg1)
return max(arg0 - arg2, arg1);
else
return min(arg0 + arg2, arg1);
}
function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0)
{
scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1);
}
function scr_obj_movetowards_point(arg0, arg1, arg2)
{
var _distance = point_distance(x, y, arg0, arg1);
if (arg2 >= _distance)
{
x = arg0;
y = arg1;
}
else
{
var _direction = point_direction(x, y, arg0, arg1);
x += lengthdir_x(arg2, _direction);
y += lengthdir_y(arg2, _direction);
}
} (lerper, glow, 1 / transition_length);
|
|
69
|
strength = scr_ease_outscr_ease_out
function scr_ease_out(arg0, arg1)
{
if (arg1 < -3 || arg1 > 7)
return arg0;
switch (arg1)
{
case -3:
return ease_out_bounce(arg0, 0, 1, 1);
case -2:
return ease_out_elastic(arg0, 0, 1, 1);
case -1:
return ease_out_back(arg0, 0, 1, 1);
case 0:
return arg0;
case 1:
return sin(arg0 * 1.5707963267948966);
case 2:
return -arg0 * (arg0 - 2);
case 6:
return -power(2, -10 * arg0) + 1;
case 7:
arg0--;
return sqrt(1 - (arg0 * arg0));
default:
arg0--;
if (arg1 == 4)
{
return -1 * (power(arg0, arg1) - 1);
break;
}
return power(arg0, arg1) + 1;
}
} (lerper, 2);
|
|
70
|
with (obj_sprhighlight)
|
|
71
|
image_alpha = other.strength;
|
|
72
|
if (shadows)
|
|
73
|
{
|
|
74
|
with (obj_floorshadow)
|
|
75
|
{
|
|
76
|
stretch = lerp(other.min_stretch, other.stretch, other.strength);
|
|
77
|
image_alpha = other.strength;
|
|
78
|
}
|
|
79
|
}
|
|
80
|
}
|
|
81
|
init = true;
|
|
82
|
if (init)
|
|
83
|
{
|
|
84
|
if (active)
|
|
85
|
actind = lerp(actind, 1.05, lerpstrength);
|
|
86
|
else
|
|
87
|
actind = lerp(actind, -0.05, lerpstrength);
|
|
88
|
if (stayactive != -1)
|
|
89
|
actind = stayactive;
|
|
90
|
actind = clamp(actind, 0, 1);
|
|
91
|
with (obj_sprhighlight)
|
|
92
|
{
|
|
93
|
if (!i_ex(target))
|
|
94
|
continue;
|
|
95
|
image_alpha = other.actind;
|
|
96
|
target.image_angle = 0;
|
|
97
|
}
|
|
98
|
if (shadows)
|
|
99
|
{
|
|
100
|
with (obj_floorshadow)
|
|
101
|
{
|
|
102
|
stretch = other.actind * 2;
|
|
103
|
if (scr_debugscr_debug
function scr_debug()
{
if (global.debug == 1)
return 1;
} ())
|
|
104
|
{
|
|
105
|
}
|
|
106
|
image_alpha = other.actind;
|
|
107
|
}
|
|
108
|
}
|
|
109
|
for (var i = 0; i < array_length(legendmarker); i++)
|
|
110
|
{
|
|
111
|
with (legendmarker[i])
|
|
112
|
image_alpha = other.actind;
|
|
113
|
}
|
|
114
|
strength = actind;
|
|
115
|
}
|
|
116
|
if (shadow_kill)
|
|
117
|
{
|
|
118
|
with (obj_floorshadow)
|
|
119
|
instance_destroy();
|
|
120
|
}
|