mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-01 01:36:47 +00:00
title tweaks:
fix crash when spamming enter, force logo bump, compensate for missed beats with intro text (ex. when window being dragged)
This commit is contained in:
parent
87ec716ade
commit
6e23041d8c
|
@ -9,9 +9,6 @@ import flixel.util.FlxTimer;
|
|||
|
||||
class MusicBeatState extends FlxUIState
|
||||
{
|
||||
private var lastBeat:Float = 0;
|
||||
private var lastStep:Float = 0;
|
||||
|
||||
private var curStep:Int = 0;
|
||||
private var curBeat:Int = 0;
|
||||
private var controls(get, never):Controls;
|
||||
|
|
|
@ -11,9 +11,6 @@ class MusicBeatSubstate extends FlxSubState
|
|||
super();
|
||||
}
|
||||
|
||||
private var lastBeat:Float = 0;
|
||||
private var lastStep:Float = 0;
|
||||
|
||||
private var curStep:Int = 0;
|
||||
private var curBeat:Int = 0;
|
||||
private var controls(get, never):Controls;
|
||||
|
|
|
@ -34,6 +34,8 @@ class TitleState extends MusicBeatState
|
|||
|
||||
var wackyImage:FlxSprite;
|
||||
|
||||
var lastBeat:Int = 0;
|
||||
|
||||
override public function create():Void
|
||||
{
|
||||
#if polymod
|
||||
|
@ -304,7 +306,7 @@ class TitleState extends MusicBeatState
|
|||
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
||||
}
|
||||
|
||||
if (pressedEnter && !skippedIntro)
|
||||
if (pressedEnter && !skippedIntro && initialized)
|
||||
{
|
||||
skipIntro();
|
||||
}
|
||||
|
@ -346,7 +348,7 @@ class TitleState extends MusicBeatState
|
|||
{
|
||||
super.beatHit();
|
||||
|
||||
logoBl.animation.play('bump');
|
||||
logoBl.animation.play('bump', true);
|
||||
danceLeft = !danceLeft;
|
||||
|
||||
if (danceLeft)
|
||||
|
@ -355,8 +357,13 @@ class TitleState extends MusicBeatState
|
|||
gfDance.animation.play('danceLeft');
|
||||
|
||||
FlxG.log.add(curBeat);
|
||||
|
||||
switch (curBeat)
|
||||
// if the user is draggin the window some beats will
|
||||
// be missed so this is just to compensate
|
||||
if (curBeat > lastBeat)
|
||||
{
|
||||
for (i in lastBeat...curBeat)
|
||||
{
|
||||
switch (i + 1)
|
||||
{
|
||||
case 1:
|
||||
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
|
||||
|
@ -407,6 +414,9 @@ class TitleState extends MusicBeatState
|
|||
skipIntro();
|
||||
}
|
||||
}
|
||||
}
|
||||
lastBeat = curBeat;
|
||||
}
|
||||
|
||||
var skippedIntro:Bool = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue