1 |
if (obj_insomnitot_body_b.animating == true) |
2 |
{ |
3 |
x = obj_insomnitot_body_b.x + x_offset |
4 |
y = obj_insomnitot_body_b.face_displacement_y |
5 |
} |
6 |
else |
7 |
{ |
8 |
x = starting_point_x |
9 |
y = starting_point_y |
10 |
} |
11 |
if (obj_insomnitot_body_b.state != "awake" || sleep == false) |
12 |
{ |
13 |
blink_state = "nothing" |
14 |
if (sprite_index == spr_insomnitot_face_blinking) |
15 |
{ |
16 |
sprite_index = spr_insomnitot_face |
17 |
image_index = 0 |
18 |
} |
19 |
else if (sprite_index == spr_insomnitot_face_critical_blinking) |
20 |
{ |
21 |
sprite_index = spr_insomnitot_face_critical |
22 |
image_index = 0 |
23 |
} |
24 |
} |
25 |
if (sleep == false) |
26 |
{ |
27 |
image_speed = 0 |
28 |
image_index = 0 |
29 |
} |
30 |
else if (obj_insomnitot_body_b.state == "asleep") |
31 |
{ |
32 |
image_speed = 0 |
33 |
image_index = 4 |
34 |
} |
35 |
else if (obj_insomnitot_body_b.state == "waking") |
36 |
{ |
37 |
image_speed = 0 |
38 |
image_index = 4 - (ceil(obj_insomnitot_body_b.time_elapsed / (obj_insomnitot_body_b.time_max / 2) * 4)) |
39 |
} |
40 |
else if (obj_insomnitot_body_b.state == "awake") |
41 |
{ |
42 |
if (blink_state == "nothing") |
43 |
{ |
44 |
image_speed = 0.5 |
45 |
blink_state = "blinking" |
46 |
if (sprite_index == spr_insomnitot_face) |
47 |
{ |
48 |
sprite_index = spr_insomnitot_face_blinking |
49 |
image_index = 0 |
50 |
} |
51 |
else if (sprite_index == spr_insomnitot_face_critical) |
52 |
{ |
53 |
sprite_index = spr_insomnitot_face_critical_blinking |
54 |
image_index = 0 |
55 |
} |
56 |
} |
57 |
} |
58 |
else if (obj_insomnitot_body_b.state == "sleep") |
59 |
{ |
60 |
image_speed = 0 |
61 |
image_index = ceil((obj_insomnitot_body_b.time_elapsed - obj_insomnitot_body_b.time_max / 2) / (obj_insomnitot_body_b.time_max / 2) * 4) |
62 |
} |