diff --git a/assets/data/scripts/week7-balledLines.hx b/assets/data/scripts/week7-balledLines.hx new file mode 100644 index 00000000..677d3791 --- /dev/null +++ b/assets/data/scripts/week7-balledLines.hx @@ -0,0 +1,15 @@ +var sound:Sound; + +function create() + sound = Paths.sound('jeffGameover/jeffGameover-' + FlxG.random.int(1, 25, !Options.naughtyness ? [1, 3, 8, 13, 17, 21] : null)); + +function beatHit(cur:Int) { + if(cur != 0) return; + + FlxG.sound.music.volume = 0.2; + FlxG.sound.play(sound, 1, false, null, true, function() + { + if (!isEnding) + FlxG.sound.music.fadeIn(4, 0.2, 1); + }); +} \ No newline at end of file diff --git a/assets/data/stages/tank.hx b/assets/data/stages/tank.hx index 2bc5966e..03e213c6 100644 --- a/assets/data/stages/tank.hx +++ b/assets/data/stages/tank.hx @@ -1,6 +1,9 @@ var tankAngle:Float = FlxG.random.int(-90, 45); var tankSpeed:Float = FlxG.random.float(5, 7); +function postCreate() if(PlayState.isStoryMode) + GameOverSubstate.script = 'data/scripts/week7-balledLines'; + function update(elapsed:Float) { tankAngle += elapsed * tankSpeed; tankRolling.angle = tankAngle - 90 + 15;