From c90ff391f69293f5d107fcba8556b821b7b14abc Mon Sep 17 00:00:00 2001 From: Lojemiru <33508026+Lojemiru@users.noreply.github.com> Date: Sun, 1 Aug 2021 18:44:26 -0500 Subject: [PATCH] Fixes #99 --- objects/oA6Dust.object.gmx | 14 ++++++++------ objects/oA6DustSpawner.object.gmx | 16 +++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/objects/oA6Dust.object.gmx b/objects/oA6Dust.object.gmx index 69f496e..01e496a 100644 --- a/objects/oA6Dust.object.gmx +++ b/objects/oA6Dust.object.gmx @@ -81,13 +81,15 @@ speed = random(0.5); 1 if (!fadeout) { if (image_alpha < max_alpha) image_alpha += 0.02; -} else if (image_alpha > 0) { - image_alpha -= 0.02; -} -if (image_alpha < 0) { // fix for YYC - instance_destroy(); } - +else { + if (image_alpha > 0) { + image_alpha -= 0.02; + } + else { + instance_destroy(); + } +} diff --git a/objects/oA6DustSpawner.object.gmx b/objects/oA6DustSpawner.object.gmx index 5bdfdaa..3aa3ec9 100644 --- a/objects/oA6DustSpawner.object.gmx +++ b/objects/oA6DustSpawner.object.gmx @@ -49,12 +49,14 @@ alarm[1] = 2; 1 - repeat (15) { + var x1, y1, x2, y2; + +repeat (15) { x1 = max(0, view_xview[0] - 64 - (oControl.widescreen_space/2)); y1 = max(0, view_yview[0] - 64); x2 = min(room_width, view_xview[0] + view_wview[0] + 64 + (oControl.widescreen_space/2)); y2 = min(room_height, view_yview[0] + view_hview[0] + 64); - dust = instance_create(random_range(x1, x2), random_range(y1, y2), oA6Dust); + dust = instance_create(irandom_range(x1, x2), irandom_range(y1, y2), oA6Dust); } @@ -78,11 +80,11 @@ alarm[1] = 2; 1 - x1 = max(0, view_xview[0] - 64 - (oControl.widescreen_space/2)); -y1 = max(0, view_yview[0] - 64); -x2 = min(room_width, view_xview[0] + view_wview[0] + 64 + (oControl.widescreen_space/2)); -y2 = min(room_height, view_yview[0] + view_hview[0] + 64); -instance_create(random_range(x1, x2), random_range(y1, y2), oA6Dust); + var x1 = max(0, view_xview[0] - 64 - (oControl.widescreen_space/2)), + y1 = max(0, view_yview[0] - 64), + x2 = min(room_width, view_xview[0] + view_wview[0] + 64 + (oControl.widescreen_space/2)), + y2 = min(room_height, view_yview[0] + view_hview[0] + 64); +instance_create(irandom_range(x1, x2), irandom_range(y1, y2), oA6Dust); alarm[0] = 15;