diff --git a/art/build-Itch-HTML.bat b/art/build-Itch-HTML.bat index 0bf9d4e7e..725ee7e39 100644 --- a/art/build-Itch-HTML.bat +++ b/art/build-Itch-HTML.bat @@ -3,7 +3,7 @@ color 0a cd .. @echo on echo BUILDING GAME -lime build html5 -debug +lime build html5 -final -clean echo UPLOADING TO ITCH butler push ./export/debug/html5/bin ninja-muffin24/ld47:html5 butler status ninja-muffin24/ld47:html5 diff --git a/assets/data/fresh/fresh.json b/assets/data/fresh/fresh.json index 166b94d52..6720ca15f 100644 --- a/assets/data/fresh/fresh.json +++ b/assets/data/fresh/fresh.json @@ -1,5 +1,5 @@ { "song": "Fresh", "bpm": 120, - "sections": 14 + "sections": 16 } \ No newline at end of file diff --git a/assets/data/fresh/fresh_section15.png b/assets/data/fresh/fresh_section15.png new file mode 100644 index 000000000..aa2f82b6f Binary files /dev/null and b/assets/data/fresh/fresh_section15.png differ diff --git a/assets/data/fresh/fresh_section16.png b/assets/data/fresh/fresh_section16.png new file mode 100644 index 000000000..1e9c2051b Binary files /dev/null and b/assets/data/fresh/fresh_section16.png differ diff --git a/assets/images/.num0.png-autosave.kra b/assets/images/.num0.png-autosave.kra deleted file mode 100644 index 604d0ad82..000000000 Binary files a/assets/images/.num0.png-autosave.kra and /dev/null differ diff --git a/assets/images/lose.png b/assets/images/lose.png new file mode 100644 index 000000000..0585af5cd Binary files /dev/null and b/assets/images/lose.png differ diff --git a/assets/images/lose.xml b/assets/images/lose.xml new file mode 100644 index 000000000..328becc4f --- /dev/null +++ b/assets/images/lose.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/restart.png b/assets/images/restart.png new file mode 100644 index 000000000..778d8eece Binary files /dev/null and b/assets/images/restart.png differ diff --git a/source/GameOverState.hx b/source/GameOverState.hx new file mode 100644 index 000000000..a7acade61 --- /dev/null +++ b/source/GameOverState.hx @@ -0,0 +1,51 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.addons.transition.FlxTransitionableState; +import flixel.graphics.frames.FlxAtlasFrames; +import flixel.tweens.FlxEase; +import flixel.tweens.FlxTween; + +class GameOverState extends FlxTransitionableState +{ + override function create() + { + var loser:FlxSprite = new FlxSprite(100, 100); + var loseTex = FlxAtlasFrames.fromSparrow(AssetPaths.lose__png, AssetPaths.lose__xml); + loser.frames = loseTex; + loser.animation.addByPrefix('lose', 'lose', 24, false); + loser.animation.play('lose'); + add(loser); + + var restart:FlxSprite = new FlxSprite(500, 50).loadGraphic(AssetPaths.restart__png); + restart.setGraphicSize(Std.int(restart.width * 0.6)); + restart.updateHitbox(); + restart.alpha = 0; + restart.antialiasing = true; + add(restart); + + FlxG.sound.music.fadeOut(2, FlxG.sound.music.volume * 0.6); + + FlxTween.tween(restart, {alpha: 1}, 1, {ease: FlxEase.quartInOut}); + FlxTween.tween(restart, {y: restart.y + 40}, 7, {ease: FlxEase.quartInOut, type: PINGPONG}); + + super.create(); + } + + private var fading:Bool = false; + + override function update(elapsed:Float) + { + if (FlxG.keys.justPressed.ANY && !fading) + { + fading = true; + FlxG.sound.music.fadeOut(0.5, 0, function(twn:FlxTween) + { + FlxG.sound.music.stop(); + FlxG.switchState(new PlayState()); + }); + } + super.update(elapsed); + } +} diff --git a/source/Main.hx b/source/Main.hx index a4040a187..13376db44 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -9,7 +9,7 @@ class Main extends Sprite public function new() { super(); - addChild(new FlxGame(0, 0, PlayState)); + addChild(new FlxGame(0, 0, TitleState)); #if !mobile addChild(new FPS(10, 3, 0xFFFFFF)); diff --git a/source/PlayState.hx b/source/PlayState.hx index 78509978b..b464fd423 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -27,6 +27,8 @@ using StringTools; class PlayState extends FlxTransitionableState { + public static var curLevel:String = 'Bopeebo'; + private var lastBeat:Float = 0; private var lastStep:Float = 0; private var vocals:FlxSound; @@ -117,8 +119,9 @@ class PlayState extends FlxTransitionableState var swagCounter:Int = 0; - generateSong('fresh'); + generateSong(curLevel.toLowerCase()); countingDown = true; + Conductor.songPosition = 0; Conductor.songPosition -= Conductor.crochet * 5; new FlxTimer().start(Conductor.crochet / 1000, function(tmr:FlxTimer) @@ -214,7 +217,7 @@ class PlayState extends FlxTransitionableState function startSong():Void { countingDown = false; - FlxG.sound.playMusic("assets/music/" + "Fresh" + "_Inst.mp3"); + FlxG.sound.playMusic("assets/music/" + curLevel + "_Inst.mp3"); vocals.play(); } @@ -392,10 +395,16 @@ class PlayState extends FlxTransitionableState healthHeads.setGraphicSize(Std.int(FlxMath.lerp(100, healthHeads.width, 0.98))); healthHeads.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) - (healthHeads.width / 2); - if (FlxG.keys.justPressed.NINE) - FlxG.switchState(new Charting()); - if (FlxG.keys.justPressed.EIGHT) - FlxG.switchState(new Charting(true)); + if (healthBar.percent < 10) + healthHeads.animation.play('unhealthy'); + else + healthHeads.animation.play('healthy'); + /* + if (FlxG.keys.justPressed.NINE) + FlxG.switchState(new Charting()); + if (FlxG.keys.justPressed.EIGHT) + FlxG.switchState(new Charting(true)); + */ if (countingDown) { @@ -451,12 +460,33 @@ class PlayState extends FlxTransitionableState gfSpeed = 2; case 112: gfSpeed = 1; + case 163: + FlxG.sound.music.stop(); + curLevel = 'Bopeebo'; + FlxG.switchState(new TitleState()); + } + } + + if (curSong == 'Bopeebo') + { + switch (totalBeats) + { + case 127: + FlxG.sound.music.stop(); + curLevel = 'Fresh'; + FlxG.switchState(new PlayState()); } } everyBeat(); everyStep(); // better streaming of shit + if (health <= 0) + { + boyfriend.stunned = true; + FlxG.switchState(new GameOverState()); + } + if (unspawnNotes[0] != null) { FlxG.watch.addQuick('spsa', unspawnNotes[0].strumTime); @@ -511,7 +541,10 @@ class PlayState extends FlxTransitionableState if (daNote.y < -daNote.height) { if (daNote.tooLate) + { + health -= 0.05; vocals.volume = 0; + } daNote.active = false; daNote.visible = false; @@ -687,6 +720,8 @@ class PlayState extends FlxTransitionableState if (daNote.wasGoodHit) { daNote.kill(); + notes.remove(daNote, true); + daNote.destroy(); } } } @@ -763,7 +798,7 @@ class PlayState extends FlxTransitionableState { if (!boyfriend.stunned) { - health -= 0.075; + health -= 0.08; if (combo > 5) { gf.playAnim('sad'); @@ -827,6 +862,11 @@ class PlayState extends FlxTransitionableState { combo += 1; + if (note.noteData > 0) + health += 0.03; + else + health += 0.007; + switch (Math.abs(note.noteData)) { case 1: @@ -850,6 +890,10 @@ class PlayState extends FlxTransitionableState sectionScores[1][curSection] += note.noteScore; note.wasGoodHit = true; vocals.volume = 1; + + note.kill(); + notes.remove(note, true); + note.destroy(); } } diff --git a/source/TitleState.hx b/source/TitleState.hx index 4b9eab068..4e8cac6ff 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -45,7 +45,10 @@ class TitleState extends FlxTransitionableState persistentUpdate = true; - var bg:FlxSprite = FlxGridOverlay.create(20, 20); + var bg:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.stageback__png); + bg.antialiasing = true; + bg.setGraphicSize(Std.int(bg.width * 0.6)); + bg.updateHitbox(); add(bg); var logoBl:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.logo__png); @@ -55,6 +58,7 @@ class TitleState extends FlxTransitionableState var logo:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.logo__png); logo.screenCenter(); + logo.antialiasing = true; add(logo); FlxTween.tween(logoBl, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG});