From 6c47686ee8a2d6beec5ef8ff36ece1c74605ef33 Mon Sep 17 00:00:00 2001
From: Cameron Taylor <cameron.taylor.ninja@gmail.com>
Date: Thu, 27 May 2021 22:45:23 -0400
Subject: [PATCH] the friday night funkin creepypasta

---
 source/ui/stageBuildShit/SprStage.hx          |  7 ++-
 source/ui/stageBuildShit/StageBuilderState.hx | 49 +++++++++++++++++++
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/source/ui/stageBuildShit/SprStage.hx b/source/ui/stageBuildShit/SprStage.hx
index 5f08fa432..d9339c5ff 100644
--- a/source/ui/stageBuildShit/SprStage.hx
+++ b/source/ui/stageBuildShit/SprStage.hx
@@ -15,7 +15,8 @@ class SprStage extends FlxSprite
 
 		FlxMouseEventManager.add(this, dragShit, null, function(spr:SprStage)
 		{
-			alpha = 0.5;
+			if (FlxG.keys.pressed.CONTROL)
+				alpha = 0.5;
 		}, function(spr:SprStage)
 		{
 			alpha = 1;
@@ -44,7 +45,9 @@ class SprStage extends FlxSprite
 
 	function dragShit(spr:SprStage)
 	{
-		StageBuilderState.curSelectedSpr = this;
+		if (FlxG.keys.pressed.CONTROL)
+			StageBuilderState.curSelectedSpr = this;
+
 		mousePressing = true;
 
 		mouseOffset.set(FlxG.mouse.x - this.x, FlxG.mouse.y - this.y);
diff --git a/source/ui/stageBuildShit/StageBuilderState.hx b/source/ui/stageBuildShit/StageBuilderState.hx
index 99913ce3d..573b6e98c 100644
--- a/source/ui/stageBuildShit/StageBuilderState.hx
+++ b/source/ui/stageBuildShit/StageBuilderState.hx
@@ -147,6 +147,18 @@ class StageBuilderState extends MusicBeatState
 		// trace(sndChannel.position);
 		// trace(snd
 
+		if (FlxG.keys.justPressed.R)
+		{
+			shakingScreen();
+
+			FlxG.stage.window.title = "YOU WILL DIE";
+
+			// FlxG.stage.window.x -= Std.int(10);
+			// FlxG.stage.window.y -= Std.int(10);
+			// FlxG.stage.window.width += Std.int(40);
+			// FlxG.stage.window.height += Std.int(20);
+		}
+
 		if (FlxG.keys.justPressed.UP)
 		{
 			if (curSelectedSpr != null)
@@ -162,14 +174,51 @@ class StageBuilderState extends MusicBeatState
 			}
 		}
 
+		if (FlxG.keys.justPressed.DELETE)
+		{
+			if (curSelectedSpr != null)
+			{
+				sprGrp.remove(curSelectedSpr, true);
+			}
+		}
+
 		CoolUtil.mouseCamDrag();
 
 		if (FlxG.keys.pressed.CONTROL)
 			CoolUtil.mouseWheelZoom();
 
+		if (isShaking)
+		{
+			FlxG.stage.window.x = Std.int(shakePos.x + (FlxG.random.float(-1, 1) * shakeIntensity));
+			FlxG.stage.window.y = Std.int(shakePos.y + (FlxG.random.float(-1, 1) * shakeIntensity));
+
+			shakeIntensity -= 30 * elapsed;
+
+			if (shakeIntensity <= 0)
+			{
+				isShaking = false;
+				shakeIntensity = 60;
+				FlxG.stage.window.x = Std.int(shakePos.x);
+				FlxG.stage.window.y = Std.int(shakePos.y);
+			}
+		}
+
 		super.update(elapsed);
 	}
 
+	var isShaking:Bool = false;
+	var shakeIntensity:Float = 60;
+	var shakePos:FlxPoint = new FlxPoint();
+
+	function shakingScreen()
+	{
+		if (!isShaking)
+		{
+			isShaking = true;
+			shakePos.set(FlxG.stage.window.x, FlxG.stage.window.y);
+		}
+	}
+
 	function sortSprGrp()
 	{
 		sprGrp.sort(daLayerSorting, FlxSort.ASCENDING);