1 |
if (card_active == true) |
2 |
{ |
3 |
x = lerp(x, card_target_x, 0.3) |
4 |
y = lerp(y, card_target_y, 0.3) |
5 |
if (abs(x - card_target_x) <= 0.01 && abs(y - card_target_y) <= 0.01) |
6 |
{ |
7 |
x = card_target_x |
8 |
y = card_target_y |
9 |
card_active = false |
10 |
attack_stage = 1 |
11 |
} |
12 |
} |
13 |
switch attack_stage |
14 |
{ |
15 |
case 1: |
16 |
if (image_speed == 0) |
17 |
{ |
18 |
audio_play_sound(snd_card_game_deal, 1, 0) |
19 |
image_speed = (1/3) |
20 |
} |
21 |
if (image_index >= (image_number - 1)) |
22 |
{ |
23 |
image_speed = 0 |
24 |
image_index = image_number - 1 |
25 |
attack_stage += 1 |
26 |
} |
27 |
break |
28 |
case 2: |
29 |
if (!alarm[0]) |
30 |
alarm[0] = 15gml_Object_obj_attack_ace_cards_Alarm_0.gmlattack_stage++
with (instance_create_depth((x + 6), (y + 7), -999999, obj_attack_ace_cards_shape))
sprite_index = other.shape_sprite
with (instance_create_depth((x + 34), (y + 54), -999999, obj_attack_ace_cards_shape))
sprite_index = other.shape_sprite |
31 |
break |
32 |
case 3: |
33 |
image_alpha -= 0.05 |
34 |
if (image_alpha <= 0.1) |
35 |
instance_destroy() |
36 |
break |
37 |
} |