From c1151d91025765be016f9b2ba0b4b993fadca490 Mon Sep 17 00:00:00 2001 From: AlexKhayrullin Date: Wed, 16 Feb 2022 01:03:29 +0200 Subject: [PATCH] Added wind animation to RRZ Past An attempt to implement #27 --- .../SonicTimeTwisted.project.gmx | 2 + .../objects/objRRLeaf.object.gmx | 98 ++++++++++++++ .../objects/objRRWind.object.gmx | 127 ++++++++++++++++++ .../player_reaction_floating_right.gml | 3 + .../scripts/player_reaction_floating_stop.gml | 3 + 5 files changed, 233 insertions(+) create mode 100644 SonicTimeTwisted.gmx/objects/objRRLeaf.object.gmx create mode 100644 SonicTimeTwisted.gmx/objects/objRRWind.object.gmx diff --git a/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx b/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx index 1fd734f69..024b86bf1 100644 --- a/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx +++ b/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx @@ -5212,6 +5212,8 @@ objects\objRRBreakableColumn objects\objRRWallRun objects\objSwing + objects\objRRWind + objects\objRRLeaf diff --git a/SonicTimeTwisted.gmx/objects/objRRLeaf.object.gmx b/SonicTimeTwisted.gmx/objects/objRRLeaf.object.gmx new file mode 100644 index 000000000..ff69268bf --- /dev/null +++ b/SonicTimeTwisted.gmx/objects/objRRLeaf.object.gmx @@ -0,0 +1,98 @@ + + + sprVVLeaf + 0 + -1 + 0 + 0 + objSceneObject + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + event_inherited(); +image_angle = random(360); +gravity = 0; +alarm[0] = 40; +is_wind = true; + + + + + + + + 1 + 203 + 0 + 0 + 0 + -1 + 1 + action_kill_object + + self + 0 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + visible = !visible; +if (is_wind) { + hspeed = 16; +} else { + if (hspeed > 0) { + hspeed -= 0.25; + } + vspeed += 0.25; +} + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/SonicTimeTwisted.gmx/objects/objRRWind.object.gmx b/SonicTimeTwisted.gmx/objects/objRRWind.object.gmx new file mode 100644 index 000000000..83b386f78 --- /dev/null +++ b/SonicTimeTwisted.gmx/objects/objRRWind.object.gmx @@ -0,0 +1,127 @@ + + + <undefined> + 0 + -1 + 0 + 0 + objSceneObject + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + event_inherited(); +ticks = 0; +interval = 25; +alarm[0] = 20; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + with(objRRLeaf) { + is_wind = false; +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance_create(view_xview[0]-24, view_yview[0] - 24 + round(random(view_hview[0] + 48)), objRRLeaf); +alarm[0] = 20; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ticks = (ticks + 1) mod interval; +if (ticks > 0) exit; +if not audio_is_playing(sndFireBlow) +{ + play_sfx(sndFireBlow, 4); +} + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/SonicTimeTwisted.gmx/scripts/player_reaction_floating_right.gml b/SonicTimeTwisted.gmx/scripts/player_reaction_floating_right.gml index 3db6ee68e..2bd69453c 100644 --- a/SonicTimeTwisted.gmx/scripts/player_reaction_floating_right.gml +++ b/SonicTimeTwisted.gmx/scripts/player_reaction_floating_right.gml @@ -27,4 +27,7 @@ jump_action = false; rolling_jump = true; landed = false; terrain_id = noone; +if (!instance_exists(objRRWind)) { + instance_create(0, 0, objRRWind); +} return true; diff --git a/SonicTimeTwisted.gmx/scripts/player_reaction_floating_stop.gml b/SonicTimeTwisted.gmx/scripts/player_reaction_floating_stop.gml index f1d4723b7..1669ad09f 100644 --- a/SonicTimeTwisted.gmx/scripts/player_reaction_floating_stop.gml +++ b/SonicTimeTwisted.gmx/scripts/player_reaction_floating_stop.gml @@ -5,4 +5,7 @@ if state == player_state_floating || state == player_state_glide || state == pla camera.top=0; camera.bottom=room_height; xspeed=max(abs(xspeed),4); +with (objRRWind) { + instance_destroy(); +} return false;