mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 08:07:54 -05:00
the friday night funkin creepypasta
This commit is contained in:
parent
bab7c0130d
commit
6c47686ee8
2 changed files with 54 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue