1 |
if (slow) |
2 |
{ |
3 |
if (sprite_index == spr_poppup_ad_poppup) |
4 |
sprite_index = spr_poppup_ad_poppup_shriveled; |
5 |
slow = false; |
6 |
} |
7 |
if (blockstate == 1) |
8 |
{ |
9 |
timer++; |
10 |
if (timer < 3) |
11 |
gpu_set_fog(1, c_white, 0, 0); |
12 |
draw_self(); |
13 |
if (timer < 3) |
14 |
gpu_set_fog(0, c_white, 0, 0); |
15 |
if (timer == 1) |
16 |
snd_play(snd_heavyswing); |
17 |
if (timer < 9) |
18 |
{ |
19 |
x = (xstart - (8 - timer)) + random((8 - timer) * 2); |
20 |
y = (ystart - (8 - timer)) + random((8 - timer) * 2); |
21 |
} |
22 |
if (timer == 2 || timer == 3 || timer == 6 || timer == 8 || timer == 10 || timer == 11) |
23 |
draw_sprite_ext(spr_poppup_block, 0, x, y, 1, 1, 0, c_white, image_alpha); |
24 |
if (timer > 6) |
25 |
image_alpha -= 0.4; |
26 |
if (image_alpha <= 0) |
27 |
instance_destroy(); |
28 |
exit; |
29 |
} |
30 |
if (state == 1) |
31 |
{ |
32 |
draw_set_alpha(0.5); |
33 |
draw_set_color(c_black); |
34 |
draw_rectangle((x - (sprite_width / 2)) + 2, (y - (sprite_height / 2)) + 2, x + (sprite_width / 2) + 2, y + (sprite_height / 2) + 2, false); |
35 |
draw_set_alpha(1); |
36 |
draw_set_color(c_white); |
37 |
draw_self(); |
38 |
} |
39 |
else if (state < 3) |
40 |
{ |
41 |
if (state == -1) |
42 |
{ |
43 |
scale += (0.25 * scalespeed); |
44 |
if (scale > 1) |
45 |
{ |
46 |
scale = 1.2; |
47 |
state = 0; |
48 |
} |
49 |
} |
50 |
else if (state == 0) |
51 |
{ |
52 |
scale = 1; |
53 |
state = 1; |
54 |
} |
55 |
else if (state == 2) |
56 |
{ |
57 |
scale -= (0.25 * scalespeed); |
58 |
if (scale <= 0) |
59 |
instance_destroy(); |
60 |
} |
61 |
draw_set_alpha(0.5); |
62 |
draw_set_color(c_black); |
63 |
draw_rectangle((x - ((sprite_width * scale) / 2)) + 2, (y - ((sprite_height * scale) / 2)) + 2, x + ((sprite_width * scale) / 2) + 2, y + ((sprite_height * scale) / 2) + 2, false); |
64 |
draw_set_alpha(1); |
65 |
draw_set_color(c_white); |
66 |
draw_sprite_ext(sprite_index, image_index, x, y, scale, scale, 0, c_white, 1); |
67 |
} |
68 |
if (mock == 1) |
69 |
{ |
70 |
mocktimer += 0.25; |
71 |
draw_sprite_ext(spr_poppup_smiley, mocktimer, x - 5, y + 5, 3, 3, 0, c_white, image_alpha); |
72 |
} |