From 07acc538889e43cfb6cf9c4cbe7e191f4351d6a2 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 2 Nov 2020 01:46:37 -0500 Subject: [PATCH] ng release --- README.md | 1 + source/Boyfriend.hx | 3 +++ source/Character.hx | 7 +++++- source/FreeplayState.hx | 8 ++++++- source/PlayState.hx | 47 +++++++++++++++++++++++++++++++++++------ 5 files changed, 58 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 37cae901f..84ae25647 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,4 @@ This is the repository for Friday Night Funkin, a game originally made for Ludum Dare 47 "Stuck In a Loop". Play the Ludum Dare prototype here: https://ninja-muffin24.itch.io/friday-night-funkin +Play the Newgrounds one here: https://www.newgrounds.com/portal/view/770371 diff --git a/source/Boyfriend.hx b/source/Boyfriend.hx index 483f4d0e6..1a8c6cf07 100644 --- a/source/Boyfriend.hx +++ b/source/Boyfriend.hx @@ -30,6 +30,8 @@ class Boyfriend extends Character animation.addByPrefix('firstDeath', "BF dies", 24, false); animation.addByPrefix('deathLoop', "BF Dead Loop", 24, true); animation.addByPrefix('deathConfirm', "BF Dead confirm", 24, false); + + animation.addByPrefix('scared', 'BF idle shaking', 24); playAnim('idle'); antialiasing = true; @@ -47,6 +49,7 @@ class Boyfriend extends Character addOffset('firstDeath', 37, 11); addOffset('deathLoop', 37, 5); addOffset('deathConfirm', 37, 69); + addOffset('scared', -4); } override function update(elapsed:Float) diff --git a/source/Character.hx b/source/Character.hx index af441f023..937fd310c 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -24,7 +24,6 @@ class Character extends FlxSprite switch (curCharacter) { - case 'bf': case 'gf': // GIRLFRIEND CODE tex = FlxAtlasFrames.fromSparrow(AssetPaths.GF_assets__png, AssetPaths.GF_assets__xml); @@ -38,6 +37,8 @@ class Character extends FlxSprite animation.addByIndices('danceLeft', 'GF Dancing Beat', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false); animation.addByIndices('danceRight', 'GF Dancing Beat', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false); + animation.addByPrefix('scared', 'GF FEAR', 24); + addOffset('cheer'); addOffset('sad', -2, -2); addOffset('danceLeft', 0, -9); @@ -48,6 +49,8 @@ class Character extends FlxSprite addOffset("singLEFT", 0, -19); addOffset("singDOWN", 0, -20); + addOffset('scared'); + playAnim('danceRight'); case 'dad': @@ -112,6 +115,8 @@ class Character extends FlxSprite { switch (curCharacter) { + case 'bf': + case 'gf': danced = !danced; diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index ecdf81edf..193744704 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -20,7 +20,13 @@ class FreeplayState extends MusicBeatState if (!FlxG.sound.music.playing) FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt); - if (StoryMenuState.weekUnlocked[1]) + var isDebug:Bool = false; + + #if debug + isDebug = true; + #end + + if (StoryMenuState.weekUnlocked[1] || isDebug) { songs.push('Spookeez'); songs.push('South'); diff --git a/source/PlayState.hx b/source/PlayState.hx index 2130a37bf..9bc96a88d 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -78,6 +78,7 @@ class PlayState extends MusicBeatState var dialogue:Array = ['blah blah blah', 'coolswag']; var halloweenBG:FlxSprite; + var isHalloween:Bool = false; var talking:Bool = true; var songScore:Int = 0; @@ -136,6 +137,8 @@ class PlayState extends MusicBeatState halloweenBG.animation.play('idle'); halloweenBG.antialiasing = true; add(halloweenBG); + + isHalloween = true; } else { @@ -600,7 +603,8 @@ class PlayState extends MusicBeatState // FlxG.watch.addQuick('VOL', vocals.amplitudeLeft); // FlxG.watch.addQuick('VOLRight', vocals.amplitudeRight); - healthHeads.setGraphicSize(Std.int(FlxMath.lerp(100, healthHeads.width, 0.98))); + healthHeads.setGraphicSize(Std.int(FlxMath.lerp(150, healthHeads.width, 0.50))); + healthHeads.updateHitbox(); healthHeads.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) - (healthHeads.width / 2); if (health > 2) @@ -613,8 +617,11 @@ class PlayState extends MusicBeatState /* if (FlxG.keys.justPressed.NINE) FlxG.switchState(new Charting()); */ - // if (FlxG.keys.justPressed.EIGHT) - // FlxG.switchState(new AnimationDebug(SONG.player2)); + + #if debug + if (FlxG.keys.justPressed.EIGHT) + FlxG.switchState(new AnimationDebug(SONG.player1)); + #end if (startingSong) { @@ -678,7 +685,8 @@ class PlayState extends MusicBeatState if (camZooming) { - FlxG.camera.zoom = FlxMath.lerp(1.05, FlxG.camera.zoom, 0.96); + FlxG.camera.zoom = FlxMath.lerp(1.05, FlxG.camera.zoom, 0.95); + camHUD.zoom = FlxMath.lerp(1, camHUD.zoom, 0.95); } FlxG.watch.addQuick("beatShit", totalBeats); @@ -760,6 +768,9 @@ class PlayState extends MusicBeatState if (!daNote.mustPress && daNote.wasGoodHit) { + if (SONG.song != 'Tutorial') + camZooming = true; + switch (Math.abs(daNote.noteData)) { case 2: @@ -1247,6 +1258,18 @@ class PlayState extends MusicBeatState } } + function lightningStrikeShit():Void + { + FlxG.sound.play('assets/sounds/thunder_' + FlxG.random.int(1, 2) + TitleState.soundExt); + halloweenBG.animation.play('lightning'); + + lightningStrikeBeat = curBeat; + lightningOffset = FlxG.random.int(8, 24); + + boyfriend.playAnim('scared', true); + gf.playAnim('scared', true); + } + override function stepHit() { if (SONG.needsVoices) @@ -1268,6 +1291,9 @@ class PlayState extends MusicBeatState super.stepHit(); } + var lightningStrikeBeat:Int = 0; + var lightningOffset:Int = 8; + override function beatHit() { super.beatHit(); @@ -1294,9 +1320,13 @@ class PlayState extends MusicBeatState // FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM); if (camZooming && FlxG.camera.zoom < 1.35 && totalBeats % 4 == 0) - FlxG.camera.zoom += 0.025; + { + FlxG.camera.zoom += 0.015; + camHUD.zoom += 0.03; + } - healthHeads.setGraphicSize(Std.int(healthHeads.width + 20)); + healthHeads.setGraphicSize(Std.int(healthHeads.width + 30)); + healthHeads.updateHitbox(); if (totalBeats % gfSpeed == 0) { @@ -1315,5 +1345,10 @@ class PlayState extends MusicBeatState dad.playAnim('cheer', true); } } + + if (isHalloween && FlxG.random.bool(10) && curBeat > lightningStrikeBeat + lightningOffset) + { + lightningStrikeShit(); + } } }