| 1 |
if (!instance_exists(obj_heart_battle_fighting_parent)) |
| 2 |
{ |
| 3 |
instance_destroy(); |
| 4 |
exit; |
| 5 |
} |
| 6 |
if (attack_direction == -1) |
| 7 |
{ |
| 8 |
run_sprite = 2256; |
| 9 |
jump_sprite = 2259; |
| 10 |
if (no_loop_sprite_assign == false) |
| 11 |
{ |
| 12 |
sprite_index = run_sprite; |
| 13 |
image_speed = image_speed_default; |
| 14 |
image_index = 0; |
| 15 |
no_loop_sprite_assign = true; |
| 16 |
} |
| 17 |
} |
| 18 |
if (state == "run") |
| 19 |
{ |
| 20 |
y = draw_position_y; |
| 21 |
event_user(0); |
| 22 |
} |
| 23 |
else if (state == "jump") |
| 24 |
{ |
| 25 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 26 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
| 27 |
time_elapsed += time_increase; |
| 28 |
if (time_elapsed >= time_max) |
| 29 |
{ |
| 30 |
time_elapsed = 0; |
| 31 |
sprite_index = run_sprite; |
| 32 |
image_speed = image_speed_default; |
| 33 |
image_index = 0; |
| 34 |
state = "run"; |
| 35 |
} |
| 36 |
y = draw_position_y + animation_disjoint_y; |
| 37 |
} |
| 38 |
x += (move_speed * attack_direction); |
| 39 |
if ((attack_direction == 1 && bbox_left > obj_dialogue_box_battle_transformation_any.bbox_right) || (attack_direction == -1 && bbox_right < obj_dialogue_box_battle_transformation_any.bbox_left)) |
| 40 |
{ |
| 41 |
instance_destroy(); |
| 42 |
exit; |
| 43 |
} |