1 |
ctimer++; |
2 |
if (vertState == 0) |
3 |
{ |
4 |
if (pauseInit == 1) |
5 |
{ |
6 |
vspeed = memvspeed; |
7 |
hsp = memhsp; |
8 |
hspeed = memhspeed; |
9 |
pauseInit = 0; |
10 |
} |
11 |
if (abs(vspeed) < maxvspeed) |
12 |
vspeed += (1 * sign(vspeed)); |
13 |
if (abs(vspeed) > maxvspeed) |
14 |
vspeed *= 0.9; |
15 |
if (place_meeting(x, y + vspeed, obj_solidblock) && room != room_dw_mansion_dininghall) |
16 |
vspeed *= -1; |
17 |
if (left_h()) |
18 |
{ |
19 |
if (hsp >= 0) |
20 |
hsp = -1; |
21 |
hsp *= 1.2; |
22 |
if (room != room_dw_mansion_dininghall) |
23 |
maxvspeed = halfmaxvspeed; |
24 |
if ((ctimer % 4) == 0) |
25 |
{ |
26 |
dust = instance_create(x - 34, y, obj_slidedust); |
27 |
dust.depth = depth + 100; |
28 |
} |
29 |
} |
30 |
else if (right_h()) |
31 |
{ |
32 |
if (hsp <= 0) |
33 |
hsp = 1; |
34 |
hsp *= 1.2; |
35 |
if (room != room_dw_mansion_dininghall) |
36 |
maxvspeed = halfmaxvspeed; |
37 |
if ((ctimer % 4) == 0) |
38 |
{ |
39 |
dust = instance_create(x + 34, y, obj_slidedust); |
40 |
dust.depth = depth + 100; |
41 |
} |
42 |
} |
43 |
else |
44 |
{ |
45 |
image_angle = 0; |
46 |
if (hsp > 0.1) |
47 |
hsp *= 0.9; |
48 |
else if (hsp < -0.1) |
49 |
hsp *= 0.9; |
50 |
else |
51 |
hsp = 0; |
52 |
maxvspeed = realmaxvspeed; |
53 |
if ((ctimer % 4) == 0) |
54 |
{ |
55 |
dust1 = instance_create(x - 34, y, obj_slidedust); |
56 |
dust1.depth = depth + 100; |
57 |
dust2 = instance_create(x + 34, y, obj_slidedust); |
58 |
dust2.depth = depth + 100; |
59 |
} |
60 |
} |
61 |
if (left_h() && right_h()) |
62 |
{ |
63 |
image_angle = 0; |
64 |
hsp = 0; |
65 |
if (room != room_dw_mansion_dininghall) |
66 |
maxvspeed = halfmaxvspeed; |
67 |
} |
68 |
hsp = clamp(hsp, -16, 16); |
69 |
hspeed = hsp; |
70 |
if (place_meeting(x + hspeed, y, obj_solidblock)) |
71 |
{ |
72 |
hsp = -(hsp / 2); |
73 |
hspeed = hsp; |
74 |
} |
75 |
} |
76 |
if (vertState == 1) |
77 |
{ |
78 |
if (pauseInit == 0) |
79 |
{ |
80 |
memvspeed = vspeed; |
81 |
memhsp = hsp; |
82 |
memhspeed = hspeed; |
83 |
pauseInit = 1; |
84 |
} |
85 |
vspeed = 0; |
86 |
hsp = 0; |
87 |
hspeed = 0; |
88 |
} |
89 |
if (drawtype == 0) |
90 |
scr_depth_alt(); |
91 |
if (active == 1 && drawtype == 0) |
92 |
{ |
93 |
obj_mainchara.x = x - 24; |
94 |
obj_mainchara.y = y - 60; |
95 |
} |
96 |
if (global.interact != 0) |
97 |
vertState = 1; |
98 |
if (global.interact == 0) |
99 |
vertState = 0; |