From 51b39de6d99a6fd06265b076608bbf693951d42b Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sun, 18 Oct 2020 00:27:39 -0700 Subject: [PATCH] fixed camera shit --- source/ChartingState.hx | 2 +- source/Dad.hx | 1 + source/PlayState.hx | 14 ++++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index d408fcbbc..409d494c0 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -43,7 +43,7 @@ class ChartingState extends MusicBeatState var bpmTxt:FlxText; var strumLine:FlxSprite; - var curSong:String = 'Tutorial'; + var curSong:String = 'Dadbattle'; var amountSteps:Int = 0; var bullshitUI:FlxGroup; diff --git a/source/Dad.hx b/source/Dad.hx index d6351d995..b0228c487 100644 --- a/source/Dad.hx +++ b/source/Dad.hx @@ -9,6 +9,7 @@ class Dad extends Character super(x, y); var dadTex = FlxAtlasFrames.fromSparrow(AssetPaths.DADDY_DEAREST__png, AssetPaths.DADDY_DEAREST__xml); frames = dadTex; + antialiasing = true; animation.addByPrefix('idle', 'Dad idle dance', 24); animation.addByPrefix('singUP', 'Dad Sing Note UP', 24); animation.addByPrefix('singRIGHT', 'Dad Sing Note RIGHT', 24); diff --git a/source/PlayState.hx b/source/PlayState.hx index 4dc908f8a..9c64a635e 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -227,7 +227,6 @@ class PlayState extends MusicBeatState private function generateSong(dataPath:String):Void { // FlxG.log.add(ChartParser.parse()); - generatedMusic = true; generateStaticArrows(0); generateStaticArrows(1); @@ -326,6 +325,8 @@ class PlayState extends MusicBeatState // playerCounter += 1; unspawnNotes.sort(sortByShit); + + generatedMusic = true; } function sortByShit(Obj1:Note, Obj2:Note):Int @@ -480,15 +481,20 @@ class PlayState extends MusicBeatState sectionScored = true; } - if (generatedMusic && PlayState.SONG.notes[curBeat % 4] != null) + if (generatedMusic && PlayState.SONG.notes[Std.int(curStep / 16)] != null) { - if (camFollow.x != dad.getGraphicMidpoint().x + 150 && PlayState.SONG.notes[curBeat % 4].mustHitSection) + if (curBeat % 4 == 0) + { + trace(PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection); + } + + if (camFollow.x != dad.getGraphicMidpoint().x + 150 && !PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection) { camFollow.setPosition(dad.getGraphicMidpoint().x + 150, dad.getGraphicMidpoint().y - 100); vocals.volume = 1; } - if (PlayState.SONG.notes[curBeat % 4].mustHitSection && camFollow.x != boyfriend.getGraphicMidpoint().x - 100) + if (PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection && camFollow.x != boyfriend.getGraphicMidpoint().x - 100) { camFollow.setPosition(boyfriend.getGraphicMidpoint().x - 100, boyfriend.getGraphicMidpoint().y - 100); }