mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-25 16:24:40 +00:00
Added Nightmare difficulty (stub)
This commit is contained in:
parent
09654170ed
commit
482de2a122
4
hmm.json
4
hmm.json
|
@ -11,7 +11,7 @@
|
|||
"name": "flixel",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"ref": "d6100cc8",
|
||||
"ref": "3de38a0",
|
||||
"url": "https://github.com/EliteMasterEric/flixel"
|
||||
},
|
||||
{
|
||||
|
@ -118,4 +118,4 @@
|
|||
"version": "0.2.2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ class InitState extends FlxTransitionableState
|
|||
}
|
||||
});
|
||||
|
||||
#if FLX_DEBUG
|
||||
FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFF2222CC), function() {
|
||||
FlxG.game.debugger.vcr.onStep();
|
||||
|
||||
|
@ -90,6 +91,7 @@ class InitState extends FlxTransitionableState
|
|||
FlxG.sound.music.pause();
|
||||
FlxG.sound.music.time += FlxG.elapsed * 1000;
|
||||
});
|
||||
#end
|
||||
|
||||
FlxG.sound.muteKeys = [ZERO];
|
||||
FlxG.game.focusLostFramerate = 60;
|
||||
|
|
|
@ -31,7 +31,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
var offsetsPerBeat:Array<Int> = [];
|
||||
var swagSong:HomemadeMusic;
|
||||
|
||||
#if debug
|
||||
#if FLX_DEBUG
|
||||
var funnyStatsGraph:CoolStatsGraph;
|
||||
var realStats:CoolStatsGraph;
|
||||
#end
|
||||
|
@ -44,7 +44,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
FlxG.sound.music = swagSong;
|
||||
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");
|
||||
FlxG.addChildBelowMouse(funnyStatsGraph);
|
||||
|
||||
|
@ -52,8 +52,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
FlxG.addChildBelowMouse(realStats);
|
||||
#end
|
||||
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, key ->
|
||||
{
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, key -> {
|
||||
trace(key.charCode);
|
||||
|
||||
if (key.charCode == 120) generateBeatStuff();
|
||||
|
@ -154,8 +153,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
|
||||
override function beatHit():Bool
|
||||
{
|
||||
if (curBeat % 8 == 0) blocks.forEach(blok ->
|
||||
{
|
||||
if (curBeat % 8 == 0) blocks.forEach(blok -> {
|
||||
blok.alpha = 0;
|
||||
});
|
||||
|
||||
|
@ -172,7 +170,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
trace(FlxG.sound.music._channel.position);
|
||||
*/
|
||||
|
||||
#if debug
|
||||
#if FLX_DEBUG
|
||||
funnyStatsGraph.update(FlxG.sound.music.time % 500);
|
||||
realStats.update(swagSong.getTimeWithDiff() % 500);
|
||||
#end
|
||||
|
@ -248,8 +246,7 @@ class LatencyState extends MusicBeatSubstate
|
|||
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.x = strumLine.x + 30;
|
||||
|
||||
|
|
|
@ -116,9 +116,12 @@ class Level implements IRegistryEntry<LevelData>
|
|||
var firstSongId:String = songList[0];
|
||||
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
|
||||
|
@ -138,6 +141,8 @@ class Level implements IRegistryEntry<LevelData>
|
|||
}
|
||||
}
|
||||
|
||||
if (difficulties.length == 0) difficulties = ['normal'];
|
||||
|
||||
return difficulties;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package funkin.ui.story;
|
||||
|
||||
import openfl.utils.Assets;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
|
@ -202,14 +203,29 @@ class StoryMenuState extends MusicBeatState
|
|||
if (difficultySprite == null)
|
||||
{
|
||||
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);
|
||||
|
||||
difficultySprite.x += (difficultySprites.get('normal').width - difficultySprite.width) / 2;
|
||||
}
|
||||
difficultySprite.alpha = 0;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -218,7 +234,7 @@ class StoryMenuState extends MusicBeatState
|
|||
levelTitles.clear();
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -267,11 +283,13 @@ class StoryMenuState extends MusicBeatState
|
|||
if (controls.UI_UP_P)
|
||||
{
|
||||
changeLevel(-1);
|
||||
changeDifficulty(0);
|
||||
}
|
||||
|
||||
if (controls.UI_DOWN_P)
|
||||
{
|
||||
changeLevel(1);
|
||||
changeDifficulty(0);
|
||||
}
|
||||
|
||||
if (controls.UI_RIGHT)
|
||||
|
@ -385,9 +403,39 @@ class StoryMenuState extends MusicBeatState
|
|||
if (currentIndex < 0) currentIndex = difficultyList.length - 1;
|
||||
if (currentIndex >= difficultyList.length) currentIndex = 0;
|
||||
|
||||
var hasChanged:Bool = 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
|
||||
|
|
Loading…
Reference in a new issue