1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-27 07:27:12 +00:00

fixed camera shit

This commit is contained in:
Cameron Taylor 2020-10-18 00:27:39 -07:00
parent 0542088c6e
commit 51b39de6d9
3 changed files with 12 additions and 5 deletions

View file

@ -43,7 +43,7 @@ class ChartingState extends MusicBeatState
var bpmTxt:FlxText; var bpmTxt:FlxText;
var strumLine:FlxSprite; var strumLine:FlxSprite;
var curSong:String = 'Tutorial'; var curSong:String = 'Dadbattle';
var amountSteps:Int = 0; var amountSteps:Int = 0;
var bullshitUI:FlxGroup; var bullshitUI:FlxGroup;

View file

@ -9,6 +9,7 @@ class Dad extends Character
super(x, y); super(x, y);
var dadTex = FlxAtlasFrames.fromSparrow(AssetPaths.DADDY_DEAREST__png, AssetPaths.DADDY_DEAREST__xml); var dadTex = FlxAtlasFrames.fromSparrow(AssetPaths.DADDY_DEAREST__png, AssetPaths.DADDY_DEAREST__xml);
frames = dadTex; frames = dadTex;
antialiasing = true;
animation.addByPrefix('idle', 'Dad idle dance', 24); animation.addByPrefix('idle', 'Dad idle dance', 24);
animation.addByPrefix('singUP', 'Dad Sing Note UP', 24); animation.addByPrefix('singUP', 'Dad Sing Note UP', 24);
animation.addByPrefix('singRIGHT', 'Dad Sing Note RIGHT', 24); animation.addByPrefix('singRIGHT', 'Dad Sing Note RIGHT', 24);

View file

@ -227,7 +227,6 @@ class PlayState extends MusicBeatState
private function generateSong(dataPath:String):Void private function generateSong(dataPath:String):Void
{ {
// FlxG.log.add(ChartParser.parse()); // FlxG.log.add(ChartParser.parse());
generatedMusic = true;
generateStaticArrows(0); generateStaticArrows(0);
generateStaticArrows(1); generateStaticArrows(1);
@ -326,6 +325,8 @@ class PlayState extends MusicBeatState
// playerCounter += 1; // playerCounter += 1;
unspawnNotes.sort(sortByShit); unspawnNotes.sort(sortByShit);
generatedMusic = true;
} }
function sortByShit(Obj1:Note, Obj2:Note):Int function sortByShit(Obj1:Note, Obj2:Note):Int
@ -480,15 +481,20 @@ class PlayState extends MusicBeatState
sectionScored = true; 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); camFollow.setPosition(dad.getGraphicMidpoint().x + 150, dad.getGraphicMidpoint().y - 100);
vocals.volume = 1; 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); camFollow.setPosition(boyfriend.getGraphicMidpoint().x - 100, boyfriend.getGraphicMidpoint().y - 100);
} }