diff --git a/source/Alphabet.hx b/source/Alphabet.hx index 77ac5dc..6f7e711 100644 --- a/source/Alphabet.hx +++ b/source/Alphabet.hx @@ -224,8 +224,8 @@ class Alphabet extends FlxSpriteGroup { var scaledY = FlxMath.remapToRange(targetY, 0, 1, 0, 1.3); - y = FlxMath.lerp(y, (scaledY * 120) + (FlxG.height * 0.48), 0.16); - x = FlxMath.lerp(x, (targetY * 20) + 90, 0.16); + y = FlxMath.lerp(y, (scaledY * 120) + (FlxG.height * 0.48), 0.30); + x = FlxMath.lerp(x, (targetY * 20) + 90, 0.30); } super.update(elapsed); diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index b01a47a..a5b9d00 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -1,3 +1,4 @@ +import openfl.Lib; import flixel.FlxG; class KadeEngineData @@ -37,5 +38,19 @@ class KadeEngineData FlxG.save.data.changedHitY = -1; FlxG.save.data.changedHit = false; } + + if (FlxG.save.data.fpsRain == null) + FlxG.save.data.fpsRain = false; + + if (FlxG.save.data.fpsCap == null) + FlxG.save.data.fpsCap = 120; + + if (FlxG.save.data.fpsCap > 285 || FlxG.save.data.fpsCap < 60) + FlxG.save.data.fpsCap = 120; // baby proof so you can't hard lock ur copy of kade engine + + if (FlxG.save.data.scrollSpeed == null) + FlxG.save.data.scrollSpeed = 1; + + (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); } } diff --git a/source/Main.hx b/source/Main.hx index 8adf2db..9ad6652 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -1,5 +1,9 @@ package; +import openfl.display.BlendMode; +import openfl.text.TextFormat; +import openfl.display.Application; +import flixel.util.FlxColor; import flixel.FlxG; import flixel.FlxGame; import flixel.FlxState; @@ -68,7 +72,9 @@ class Main extends Sprite initialState = TitleState; #end - addChild(new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen)); + game = new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen); + + addChild(game); #if !mobile fpsCounter = new FPS(10, 3, 0xFFFFFF); @@ -77,9 +83,31 @@ class Main extends Sprite #end } + var game:FlxGame; + var fpsCounter:FPS; public function toggleFPS(fpsEnabled:Bool):Void { fpsCounter.visible = fpsEnabled; } + + public function changeFPSColor(color:FlxColor) + { + fpsCounter.textColor = color; + } + + public function setFPSCap(cap:Float) + { + openfl.Lib.current.stage.frameRate = cap; + } + + public function getFPSCap():Float + { + return openfl.Lib.current.stage.frameRate; + } + + public function getFPS():Float + { + return fpsCounter.currentFPS; + } } diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 488834d..7269107 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -36,7 +36,7 @@ class MainMenuState extends MusicBeatState var newGaming2:FlxText; var newInput:Bool = true; - public static var nightly:String = "-Nightly.1"; + public static var nightly:String = "-Nightly.2"; public static var kadeEngineVer:String = "1.3.1" + nightly; public static var gameVer:String = "0.2.7.1"; @@ -101,7 +101,7 @@ class MainMenuState extends MusicBeatState menuItem.antialiasing = true; } - FlxG.camera.follow(camFollow, null, 0.06); + FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap)); var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + " FNF - " + kadeEngineVer + " Kade Engine", 12); versionShit.scrollFactor.set(); diff --git a/source/MenuItem.hx b/source/MenuItem.hx index f41d893..44353f8 100644 --- a/source/MenuItem.hx +++ b/source/MenuItem.hx @@ -36,7 +36,7 @@ class MenuItem extends FlxSpriteGroup override function update(elapsed:Float) { super.update(elapsed); - y = FlxMath.lerp(y, (targetY * 120) + 480, 0.17); + y = FlxMath.lerp(y, (targetY * 120) + 480, 0.17 * (60 / FlxG.save.data.fpsCap)); if (isFlashing) flashingInt += 1; diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index 88c58a6..77df9aa 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -1,5 +1,8 @@ package; +import flixel.tweens.FlxTween; +import flixel.util.FlxColor; +import openfl.Lib; import Conductor.BPMChangeEvent; import flixel.FlxG; import flixel.addons.transition.FlxTransitionableState; @@ -27,6 +30,18 @@ class MusicBeatState extends FlxUIState super.create(); } + var array:Array = [ + FlxColor.fromRGB(148, 0, 211), + FlxColor.fromRGB(75, 0, 130), + FlxColor.fromRGB(0, 0, 255), + FlxColor.fromRGB(0, 255, 0), + FlxColor.fromRGB(255, 255, 0), + FlxColor.fromRGB(255, 127, 0), + FlxColor.fromRGB(255, 0 , 0) + ]; + + var skippedFrames = 0; + override function update(elapsed:Float) { //everyStep(); @@ -38,6 +53,17 @@ class MusicBeatState extends FlxUIState if (oldStep != curStep && curStep > 0) stepHit(); + if (FlxG.save.data.fpsRain && skippedFrames >= 6) + { + if (currentColor >= array.length) + currentColor = 0; + (cast (Lib.current.getChildAt(0), Main)).changeFPSColor(array[currentColor]); + currentColor++; + skippedFrames = 0; + } + else + skippedFrames++; + super.update(elapsed); } @@ -46,6 +72,8 @@ class MusicBeatState extends FlxUIState curBeat = Math.floor(curStep / 4); } + public static var currentColor = 0; + private function updateCurStep():Void { var lastChange:BPMChangeEvent = { @@ -64,6 +92,7 @@ class MusicBeatState extends FlxUIState public function stepHit():Void { + if (curStep % 4 == 0) beatHit(); } diff --git a/source/Note.hx b/source/Note.hx index 78118a9..83f202d 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -63,20 +63,20 @@ class Note extends FlxSprite animation.add('redScroll', [7]); animation.add('blueScroll', [5]); animation.add('purpleScroll', [4]); - - animation.add('purplehold', [0]); - animation.add('greenhold', [2]); - animation.add('redhold', [3]); - animation.add('bluehold', [1]); - + if (isSustainNote) { loadGraphic(Paths.image('weeb/pixelUI/arrowEnds'), true, 7, 6); - animation.add('purpleholdend', [4]); - animation.add('greenholdend', [6]); - animation.add('redholdend', [7]); - animation.add('blueholdend', [5]); + animation.add('purpleholdend', [4]); + animation.add('greenholdend', [6]); + animation.add('redholdend', [7]); + animation.add('blueholdend', [5]); + + animation.add('purplehold', [0]); + animation.add('greenhold', [2]); + animation.add('redhold', [3]); + animation.add('bluehold', [1]); } setGraphicSize(Std.int(width * PlayState.daPixelZoom)); @@ -89,17 +89,17 @@ class Note extends FlxSprite animation.addByPrefix('redScroll', 'red0'); animation.addByPrefix('blueScroll', 'blue0'); animation.addByPrefix('purpleScroll', 'purple0'); - + + animation.addByPrefix('purpleholdend', 'pruple end hold'); + animation.addByPrefix('greenholdend', 'green hold end'); + animation.addByPrefix('redholdend', 'red hold end'); + animation.addByPrefix('blueholdend', 'blue hold end'); + animation.addByPrefix('purplehold', 'purple hold piece'); animation.addByPrefix('greenhold', 'green hold piece'); animation.addByPrefix('redhold', 'red hold piece'); animation.addByPrefix('bluehold', 'blue hold piece'); - animation.addByPrefix('purpleholdend', 'pruple end hold'); - animation.addByPrefix('greenholdend', 'green hold end'); - animation.addByPrefix('redholdend', 'red hold end'); - animation.addByPrefix('blueholdend', 'blue hold end'); - setGraphicSize(Std.int(width * 0.7)); updateHitbox(); antialiasing = true; @@ -127,51 +127,52 @@ class Note extends FlxSprite if (FlxG.save.data.downscroll && sustainNote) flipY = true; + if (isSustainNote && prevNote != null) - { - noteScore * 0.2; - alpha = 0.6; - - x += width / 2; - - switch (noteData) { - case 2: - animation.play('greenholdend'); - case 3: - animation.play('redholdend'); - case 1: - animation.play('blueholdend'); - case 0: - animation.play('purpleholdend'); - } - - updateHitbox(); - - x -= width / 2; - - if (PlayState.curStage.startsWith('school')) - x += 30; - - if (prevNote.isSustainNote) - { - switch (prevNote.noteData) + noteScore * 0.2; + alpha = 0.6; + + x += width / 2; + + switch (noteData) { - case 0: - prevNote.animation.play('purplehold'); - case 1: - prevNote.animation.play('bluehold'); case 2: - prevNote.animation.play('greenhold'); + animation.play('greenholdend'); case 3: - prevNote.animation.play('redhold'); + animation.play('redholdend'); + case 1: + animation.play('blueholdend'); + case 0: + animation.play('purpleholdend'); + } + + updateHitbox(); + + x -= width / 2; + + if (PlayState.curStage.startsWith('school')) + x += 30; + + if (prevNote.isSustainNote) + { + switch (prevNote.noteData) + { + case 0: + prevNote.animation.play('purplehold'); + case 1: + prevNote.animation.play('bluehold'); + case 2: + prevNote.animation.play('greenhold'); + case 3: + prevNote.animation.play('redhold'); + } + + prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed; + prevNote.updateHitbox(); + // prevNote.setGraphicSize(); } - - prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed; - prevNote.updateHitbox(); - // prevNote.setGraphicSize(); } - } } override function update(elapsed:Float) @@ -190,17 +191,17 @@ class Note extends FlxSprite if (canBeHit) { - if (noteDiff > Conductor.safeZoneOffset * 0.95) + if (noteDiff > Conductor.safeZoneOffset * 0.75) rating = "shit"; - else if (noteDiff < Conductor.safeZoneOffset * -0.95) - rating = "shit"; - else if (noteDiff > Conductor.safeZoneOffset * 0.70) - rating = "bad"; else if (noteDiff < Conductor.safeZoneOffset * -0.75) + rating = "shit"; + else if (noteDiff > Conductor.safeZoneOffset * 0.50) rating = "bad"; - else if (noteDiff > Conductor.safeZoneOffset * 0.45) + else if (noteDiff < Conductor.safeZoneOffset * -0.50) + rating = "bad"; + else if (noteDiff > Conductor.safeZoneOffset * 0.35) rating = "good"; - else if (noteDiff < Conductor.safeZoneOffset * -0.45) + else if (noteDiff < Conductor.safeZoneOffset * -0.35) rating = "good"; else rating = "sick"; diff --git a/source/Options.hx b/source/Options.hx index 864e788..f9f6c42 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -1,23 +1,60 @@ package; +import flixel.util.FlxColor; import Controls.KeyboardScheme; import flixel.FlxG; import openfl.display.FPS; import openfl.Lib; +class OptionCatagory +{ + private var _options:Array