1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-10-04 00:10:39 +00:00

Added Nightmare difficulty (stub)

This commit is contained in:
EliteMasterEric 2023-05-22 20:55:53 -04:00
parent 09654170ed
commit 482de2a122
5 changed files with 69 additions and 17 deletions

View file

@ -11,7 +11,7 @@
"name": "flixel", "name": "flixel",
"type": "git", "type": "git",
"dir": null, "dir": null,
"ref": "d6100cc8", "ref": "3de38a0",
"url": "https://github.com/EliteMasterEric/flixel" "url": "https://github.com/EliteMasterEric/flixel"
}, },
{ {
@ -118,4 +118,4 @@
"version": "0.2.2" "version": "0.2.2"
} }
] ]
} }

View file

@ -78,6 +78,7 @@ class InitState extends FlxTransitionableState
} }
}); });
#if FLX_DEBUG
FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFF2222CC), function() { FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFF2222CC), function() {
FlxG.game.debugger.vcr.onStep(); FlxG.game.debugger.vcr.onStep();
@ -90,6 +91,7 @@ class InitState extends FlxTransitionableState
FlxG.sound.music.pause(); FlxG.sound.music.pause();
FlxG.sound.music.time += FlxG.elapsed * 1000; FlxG.sound.music.time += FlxG.elapsed * 1000;
}); });
#end
FlxG.sound.muteKeys = [ZERO]; FlxG.sound.muteKeys = [ZERO];
FlxG.game.focusLostFramerate = 60; FlxG.game.focusLostFramerate = 60;

View file

@ -31,7 +31,7 @@ class LatencyState extends MusicBeatSubstate
var offsetsPerBeat:Array<Int> = []; var offsetsPerBeat:Array<Int> = [];
var swagSong:HomemadeMusic; var swagSong:HomemadeMusic;
#if debug #if FLX_DEBUG
var funnyStatsGraph:CoolStatsGraph; var funnyStatsGraph:CoolStatsGraph;
var realStats:CoolStatsGraph; var realStats:CoolStatsGraph;
#end #end
@ -44,7 +44,7 @@ class LatencyState extends MusicBeatSubstate
FlxG.sound.music = swagSong; FlxG.sound.music = swagSong;
FlxG.sound.music.play(); FlxG.sound.music.play();
#if debug #if FLX_DEBUG
funnyStatsGraph = new CoolStatsGraph(0, Std.int(FlxG.height / 2), FlxG.width, Std.int(FlxG.height / 2), FlxColor.PINK, "time"); funnyStatsGraph = new CoolStatsGraph(0, Std.int(FlxG.height / 2), FlxG.width, Std.int(FlxG.height / 2), FlxColor.PINK, "time");
FlxG.addChildBelowMouse(funnyStatsGraph); FlxG.addChildBelowMouse(funnyStatsGraph);
@ -52,8 +52,7 @@ class LatencyState extends MusicBeatSubstate
FlxG.addChildBelowMouse(realStats); FlxG.addChildBelowMouse(realStats);
#end #end
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, key -> FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, key -> {
{
trace(key.charCode); trace(key.charCode);
if (key.charCode == 120) generateBeatStuff(); if (key.charCode == 120) generateBeatStuff();
@ -154,8 +153,7 @@ class LatencyState extends MusicBeatSubstate
override function beatHit():Bool override function beatHit():Bool
{ {
if (curBeat % 8 == 0) blocks.forEach(blok -> if (curBeat % 8 == 0) blocks.forEach(blok -> {
{
blok.alpha = 0; blok.alpha = 0;
}); });
@ -172,7 +170,7 @@ class LatencyState extends MusicBeatSubstate
trace(FlxG.sound.music._channel.position); trace(FlxG.sound.music._channel.position);
*/ */
#if debug #if FLX_DEBUG
funnyStatsGraph.update(FlxG.sound.music.time % 500); funnyStatsGraph.update(FlxG.sound.music.time % 500);
realStats.update(swagSong.getTimeWithDiff() % 500); realStats.update(swagSong.getTimeWithDiff() % 500);
#end #end
@ -248,8 +246,7 @@ class LatencyState extends MusicBeatSubstate
FlxG.resetState(); FlxG.resetState();
}*/ }*/
noteGrp.forEach(function(daNote:Note) noteGrp.forEach(function(daNote:Note) {
{
daNote.y = (strumLine.y - ((Conductor.songPosition - Conductor.audioOffset) - daNote.data.strumTime) * 0.45); daNote.y = (strumLine.y - ((Conductor.songPosition - Conductor.audioOffset) - daNote.data.strumTime) * 0.45);
daNote.x = strumLine.x + 30; daNote.x = strumLine.x + 30;

View file

@ -116,9 +116,12 @@ class Level implements IRegistryEntry<LevelData>
var firstSongId:String = songList[0]; var firstSongId:String = songList[0];
var firstSong:Song = funkin.play.song.SongData.SongDataParser.fetchSong(firstSongId); var firstSong:Song = funkin.play.song.SongData.SongDataParser.fetchSong(firstSongId);
for (difficulty in firstSong.listDifficulties()) if (firstSong != null)
{ {
difficulties.push(difficulty); for (difficulty in firstSong.listDifficulties())
{
difficulties.push(difficulty);
}
} }
// Filter to only include difficulties that are present in all songs // Filter to only include difficulties that are present in all songs
@ -138,6 +141,8 @@ class Level implements IRegistryEntry<LevelData>
} }
} }
if (difficulties.length == 0) difficulties = ['normal'];
return difficulties; return difficulties;
} }

View file

@ -1,5 +1,6 @@
package funkin.ui.story; package funkin.ui.story;
import openfl.utils.Assets;
import flixel.addons.transition.FlxTransitionableState; import flixel.addons.transition.FlxTransitionableState;
import flixel.FlxSprite; import flixel.FlxSprite;
import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxGroup.FlxTypedGroup;
@ -202,14 +203,29 @@ class StoryMenuState extends MusicBeatState
if (difficultySprite == null) if (difficultySprite == null)
{ {
difficultySprite = new FlxSprite(leftDifficultyArrow.x + leftDifficultyArrow.width + 10, leftDifficultyArrow.y); difficultySprite = new FlxSprite(leftDifficultyArrow.x + leftDifficultyArrow.width + 10, leftDifficultyArrow.y);
difficultySprite.loadGraphic(Paths.image('storymenu/difficulties/${currentDifficultyId}'));
if (Assets.exists(Paths.file('images/storymenu/difficulties/${currentDifficultyId}.xml')))
{
difficultySprite.frames = Paths.getSparrowAtlas('storymenu/difficulties/${currentDifficultyId}');
difficultySprite.animation.addByPrefix('idle', 'idle0', 24, true);
difficultySprite.animation.play('idle');
}
else
{
difficultySprite.loadGraphic(Paths.image('storymenu/difficulties/${currentDifficultyId}'));
}
difficultySprites.set(currentDifficultyId, difficultySprite); difficultySprites.set(currentDifficultyId, difficultySprite);
difficultySprite.x += (difficultySprites.get('normal').width - difficultySprite.width) / 2; difficultySprite.x += (difficultySprites.get('normal').width - difficultySprite.width) / 2;
} }
difficultySprite.alpha = 0; difficultySprite.alpha = 0;
difficultySprite.y = leftDifficultyArrow.y - 15; difficultySprite.y = leftDifficultyArrow.y - 15;
FlxTween.tween(difficultySprite, {y: leftDifficultyArrow.y + 15, alpha: 1}, 0.07); var targetY:Float = leftDifficultyArrow.y + 10;
targetY -= (difficultySprite.height - difficultySprites.get('normal').height) / 2;
FlxTween.tween(difficultySprite, {y: targetY, alpha: 1}, 0.07);
add(difficultySprite); add(difficultySprite);
} }
@ -218,7 +234,7 @@ class StoryMenuState extends MusicBeatState
levelTitles.clear(); levelTitles.clear();
var levelIds:Array<String> = displayingModdedLevels ? LevelRegistry.instance.listModdedLevelIds() : LevelRegistry.instance.listBaseGameLevelIds(); var levelIds:Array<String> = displayingModdedLevels ? LevelRegistry.instance.listModdedLevelIds() : LevelRegistry.instance.listBaseGameLevelIds();
if (levelIds.length == 0) levelIds = ['tutorial']; if (levelIds.length == 0) levelIds = ['tutorial']; // Make sure there's at least one level to display.
for (levelIndex in 0...levelIds.length) for (levelIndex in 0...levelIds.length)
{ {
@ -267,11 +283,13 @@ class StoryMenuState extends MusicBeatState
if (controls.UI_UP_P) if (controls.UI_UP_P)
{ {
changeLevel(-1); changeLevel(-1);
changeDifficulty(0);
} }
if (controls.UI_DOWN_P) if (controls.UI_DOWN_P)
{ {
changeLevel(1); changeLevel(1);
changeDifficulty(0);
} }
if (controls.UI_RIGHT) if (controls.UI_RIGHT)
@ -385,9 +403,39 @@ class StoryMenuState extends MusicBeatState
if (currentIndex < 0) currentIndex = difficultyList.length - 1; if (currentIndex < 0) currentIndex = difficultyList.length - 1;
if (currentIndex >= difficultyList.length) currentIndex = 0; if (currentIndex >= difficultyList.length) currentIndex = 0;
var hasChanged:Bool = currentDifficultyId != difficultyList[currentIndex];
currentDifficultyId = difficultyList[currentIndex]; currentDifficultyId = difficultyList[currentIndex];
buildDifficultySprite(); if (difficultyList.length <= 1)
{
leftDifficultyArrow.visible = false;
rightDifficultyArrow.visible = false;
}
else
{
leftDifficultyArrow.visible = true;
rightDifficultyArrow.visible = true;
}
if (hasChanged)
{
buildDifficultySprite();
funnyMusicThing();
}
}
final FADE_OUT_TIME:Float = 1.5;
function funnyMusicThing():Void
{
if (currentDifficultyId == "nightmare")
{
FlxG.sound.music.fadeOut(FADE_OUT_TIME, 0.0);
}
else
{
FlxG.sound.music.fadeOut(FADE_OUT_TIME, 1.0);
}
} }
override function dispatchEvent(event:ScriptEvent):Void override function dispatchEvent(event:ScriptEvent):Void