diff --git a/art/build-Itch-WINDOWS.bat b/art/build-Itch-WINDOWS.bat index e09c4aa45..f5dd696d6 100644 --- a/art/build-Itch-WINDOWS.bat +++ b/art/build-Itch-WINDOWS.bat @@ -3,13 +3,13 @@ color 0a cd .. @echo on echo BUILDING GAME -lime build windows -debug +lime build hl -debug echo UPLOADING 64 BIT VERSION TO ITCH -butler push ./export/debug/windows/bin ninja-muffin24/funkin:windows-64bit -lime build windows -debug -32 +butler push ./export/debug/hl/bin ninja-muffin24/funkin:windows-64bit +lime build hl -debug -32 echo UPLOADING 32 BIT VERSION TO ITCH -butler push ./export/debug/windows/bin ninja-muffin24/funkin:windows-32bit -butler status ninja-muffin24/friday-night-funkin:windows-32bit -butler status ninja-muffin24/friday-night-funkin:windows-64bit +butler push ./export/debug/hl/bin ninja-muffin24/funkin:windows-32bit +butler status ninja-muffin24/funkin:windows-32bit +butler status ninja-muffin24/funkin:windows-64bit echo ITCH SHIT UPDATED LMAOOOOO pause \ No newline at end of file diff --git a/assets/data/specialThanks.txt b/assets/data/specialThanks.txt index a8397c8c4..ebe2a612b 100644 --- a/assets/data/specialThanks.txt +++ b/assets/data/specialThanks.txt @@ -8,4 +8,5 @@ StuffedWombat mmatt_ugh Squidly Luis -GeoKureli \ No newline at end of file +GeoKureli +Will Blanton \ No newline at end of file diff --git a/assets/music/Dadbattle.ogg b/assets/music/Dadbattle.ogg new file mode 100644 index 000000000..3a1ddcf18 Binary files /dev/null and b/assets/music/Dadbattle.ogg differ diff --git a/assets/music/Dadbattle_Inst.ogg b/assets/music/Dadbattle_Inst.ogg new file mode 100644 index 000000000..344ae41eb Binary files /dev/null and b/assets/music/Dadbattle_Inst.ogg differ diff --git a/assets/music/Dadbattle_Voices.ogg b/assets/music/Dadbattle_Voices.ogg new file mode 100644 index 000000000..5e9288ae3 Binary files /dev/null and b/assets/music/Dadbattle_Voices.ogg differ diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 7f079f70b..09fd9f684 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1,5 +1,6 @@ package; +import Song.SwagSong; import flixel.FlxG; import flixel.FlxSprite; import flixel.addons.display.FlxGridOverlay; @@ -59,7 +60,7 @@ class ChartingState extends MusicBeatState var gridBG:FlxSprite; - var _song:Song; + var _song:SwagSong; var typingShit:FlxInputText; /* @@ -79,7 +80,7 @@ class ChartingState extends MusicBeatState _song = PlayState.SONG; else { - _song = new Song(curSong, [], Conductor.bpm, 0); + _song = Song.loadFromJson('tutorial'); } addSection(); diff --git a/source/Conductor.hx b/source/Conductor.hx index b63d53654..710b13584 100644 --- a/source/Conductor.hx +++ b/source/Conductor.hx @@ -10,6 +10,7 @@ class Conductor public static var crochet:Float = ((60 / bpm) * 1000); // beats in milliseconds public static var stepCrochet:Float = crochet / 4; // steps in milliseconds public static var songPosition:Float; + public static var lastSongPos:Float; public static var offset:Float = 0; public static var safeFrames:Int = 10; diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index 6b36864de..321dc29c7 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -3,6 +3,7 @@ package; import flixel.FlxG; import flixel.addons.transition.FlxTransitionableState; import flixel.addons.ui.FlxUIState; +import flixel.util.FlxTimer; class MusicBeatState extends FlxUIState { @@ -17,6 +18,10 @@ class MusicBeatState extends FlxUIState override function create() { + #if (!web) + TitleState.soundExt = '.ogg'; + #end + super.create(); } diff --git a/source/PlayState.hx b/source/PlayState.hx index 9980fb60b..ad051b6f3 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1,6 +1,9 @@ package; +import Section.SwagSection; +import Song.SwagSong; import flixel.FlxG; +import flixel.FlxGame; import flixel.FlxObject; import flixel.FlxSprite; import flixel.FlxState; @@ -29,7 +32,7 @@ using StringTools; class PlayState extends MusicBeatState { public static var curLevel:String = 'Bopeebo'; - public static var SONG:Song; + public static var SONG:SwagSong; private var vocals:FlxSound; @@ -239,8 +242,15 @@ class PlayState extends MusicBeatState }, 5); } + var previousFrameTime:Int = 0; + var lastReportedPlayheadPosition:Int = 0; + var songTime:Float = 0; + function startSong():Void { + previousFrameTime = FlxG.game.ticks; + lastReportedPlayheadPosition = 0; + startingSong = false; FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt); vocals.play(); @@ -270,7 +280,7 @@ class PlayState extends MusicBeatState notes = new FlxTypedGroup(); add(notes); - var noteData:Array
= []; + var noteData:Array; // NEW SHIT noteData = songData.notes; @@ -378,8 +388,6 @@ class PlayState extends MusicBeatState return FlxSort.byValues(FlxSort.ASCENDING, Obj1.strumTime, Obj2.strumTime); } - var sortedNotes:Bool = false; - private function generateStaticArrows(player:Int):Void { for (i in 0...4) @@ -475,6 +483,9 @@ class PlayState extends MusicBeatState { super.update(elapsed); + // trace("SONG POS: " + Conductor.songPosition); + // FlxG.sound.music.pitch = 2; + if (FlxG.keys.justPressed.ENTER) { persistentUpdate = false; @@ -495,7 +506,7 @@ class PlayState extends MusicBeatState 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 (healthBar.percent < 10) + if (healthBar.percent < 20) healthHeads.animation.play('unhealthy'); else healthHeads.animation.play('healthy'); @@ -515,8 +526,24 @@ class PlayState extends MusicBeatState } } else + { Conductor.songPosition = FlxG.sound.music.time; + songTime += FlxG.game.ticks - previousFrameTime; + previousFrameTime = FlxG.game.ticks; + + // Interpolation type beat + if (Conductor.lastSongPos != Conductor.songPosition) + { + songTime = (songTime + Conductor.songPosition) / 2; + Conductor.lastSongPos = Conductor.songPosition; + // Conductor.songPosition += FlxG.elapsed * 1000; + // trace('MISSED FRAME'); + } + + // Conductor.lastSongPos = FlxG.sound.music.time; + } + var playerTurn:Int = 0; if (sectionLengths.length > curSection) playerTurn = totalBeats % (sectionLengths[curSection] * 8); @@ -531,7 +558,7 @@ class PlayState extends MusicBeatState { if (curBeat % 4 == 0) { - trace(PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection); + // trace(PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection); } if (camFollow.x != dad.getMidpoint().x + 150 && !PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection) @@ -598,9 +625,6 @@ class PlayState extends MusicBeatState if (unspawnNotes[0] != null) { - FlxG.watch.addQuick('spsa', unspawnNotes[0].strumTime); - FlxG.watch.addQuick('weed', Conductor.songPosition); - if (unspawnNotes[0].strumTime - Conductor.songPosition < 1500) { var dunceNote:Note = unspawnNotes[0]; @@ -645,7 +669,7 @@ class PlayState extends MusicBeatState daNote.destroy(); } - daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * PlayState.SONG.speed)); + daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * PlayState.SONG.speed)); if (daNote.y < -daNote.height) { @@ -662,10 +686,6 @@ class PlayState extends MusicBeatState notes.remove(daNote, true); daNote.destroy(); } - - // one time sort - if (!sortedNotes) - notes.sort(FlxSort.byY, FlxSort.DESCENDING); }); } @@ -676,8 +696,6 @@ class PlayState extends MusicBeatState { var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); - trace(noteDiff); - // boyfriend.playAnim('hey'); // vocals.volume = 1; @@ -767,9 +785,10 @@ class PlayState extends MusicBeatState daLoop++; } - - trace(combo); - trace(seperatedScore); + /* + trace(combo); + trace(seperatedScore); + */ coolText.text = Std.string(seperatedScore); // add(coolText); @@ -876,7 +895,7 @@ class PlayState extends MusicBeatState } */ - FlxG.watch.addQuick('asdfa', upP); + // FlxG.watch.addQuick('asdfa', upP); if ((upP || rightP || downP || leftP) && !boyfriend.stunned && generatedMusic) { var possibleNotes:Array = []; @@ -894,11 +913,6 @@ class PlayState extends MusicBeatState { for (daNote in possibleNotes) { - var purp:Int = Note.PURP_NOTE; - var green:Int = Note.GREEN_NOTE; - var red:Int = Note.RED_NOTE; - var blue:Int = Note.BLUE_NOTE; - switch (daNote.noteData) { case 2: // NOTES YOU JUST PRESSED @@ -931,7 +945,7 @@ class PlayState extends MusicBeatState if ((up || right || down || left) && !boyfriend.stunned && generatedMusic) { - notes.forEach(function(daNote:Note) + notes.forEachAlive(function(daNote:Note) { if (daNote.canBeHit && daNote.mustPress && daNote.isSustainNote) { @@ -1144,6 +1158,14 @@ class PlayState extends MusicBeatState { super.beatHit(); + if (generatedMusic) + { + notes.forEachAlive(function(daNote:Note) + { + notes.sort(FlxSort.byY, FlxSort.DESCENDING); + }); + } + if (camZooming && FlxG.camera.zoom < 1.35 && totalBeats % 4 == 0) FlxG.camera.zoom += 0.025; diff --git a/source/Section.hx b/source/Section.hx index 3e0d9cd52..c811e306d 100644 --- a/source/Section.hx +++ b/source/Section.hx @@ -1,5 +1,13 @@ package; +typedef SwagSection = +{ + var sectionNotes:Array; + var lengthInSteps:Int; + var typeOfSection:Int; + var mustHitSection:Bool; +} + class Section { public var sectionNotes:Array = []; diff --git a/source/Song.hx b/source/Song.hx index 6134c1092..3c2ac41be 100644 --- a/source/Song.hx +++ b/source/Song.hx @@ -1,14 +1,30 @@ package; +import Section.SwagSection; import haxe.Json; +import haxe.format.JsonParser; import lime.utils.Assets; using StringTools; +typedef SwagSong = +{ + var song:String; + var notes:Array; + var bpm:Int; + var sections:Int; + var sectionLengths:Array; + var needsVoices:Bool; + var speed:Float; + + var player1:String; + var player2:String; +} + class Song { public var song:String; - public var notes:Array
; + public var notes:Array; public var bpm:Int; public var sections:Int; public var sectionLengths:Array = []; @@ -31,14 +47,8 @@ class Song } } - public static function loadFromJson(jsonInput:String):Song + public static function loadFromJson(jsonInput:String):SwagSong { - var daNotes:Array
= []; - var daBpm:Int = 0; - var daSections:Int = 0; - var daSong:String = ''; - var daSectionLengths:Array = []; - var rawJson = Assets.getText('assets/data/' + jsonInput.toLowerCase() + '/' + jsonInput.toLowerCase() + '.json').trim(); while (!rawJson.endsWith("}")) @@ -47,9 +57,12 @@ class Song // LOL GOING THROUGH THE BULLSHIT TO CLEAN IDK WHATS STRANGE } + var swagShit:SwagSong = cast Json.parse(rawJson).song; + trace(swagShit.notes[0]); + // FIX THE CASTING ON WINDOWS/NATIVE - var songData:Song = Json.parse(rawJson).song; // Windows??? - trace(songData); + // Windows??? + // trace(songData); // trace('LOADED FROM JSON: ' + songData.notes); /* @@ -65,6 +78,6 @@ class Song daBpm = songData.bpm; daSectionLengths = songData.sectionLengths; */ - return songData; + return swagShit; } }