mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-27 07:27:12 +00:00
lil bullshit in progress hehe
This commit is contained in:
parent
842cb3dbe6
commit
a51bb7179a
|
@ -92,5 +92,5 @@
|
|||
|
||||
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
|
||||
<icon path="art/icon.png"/>
|
||||
<haxedef name="SKIP_TO_PLAYSTATE" if="debug" />
|
||||
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
|
||||
</project>
|
||||
|
|
BIN
assets/music/Spookeez.ogg
Normal file
BIN
assets/music/Spookeez.ogg
Normal file
Binary file not shown.
BIN
assets/music/Spookeez_Inst.ogg
Normal file
BIN
assets/music/Spookeez_Inst.ogg
Normal file
Binary file not shown.
BIN
assets/music/Spookeez_Voices.ogg
Normal file
BIN
assets/music/Spookeez_Voices.ogg
Normal file
Binary file not shown.
|
@ -23,12 +23,17 @@ class FreeplayState extends MusicBeatState
|
|||
|
||||
for (i in 0...songs.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(40, (70 * i) + 30, songs[i], true, false);
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i], true, false);
|
||||
add(songText);
|
||||
songText.x += 40;
|
||||
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
|
||||
// songText.screenCenter(X);
|
||||
}
|
||||
|
||||
FlxG.sound.playMusic('assets/music/title' + TitleState.soundExt, 0);
|
||||
FlxG.sound.music.fadeIn(2, 0, 0.8);
|
||||
selector = new FlxText();
|
||||
|
||||
selector.size = 40;
|
||||
selector.text = ">";
|
||||
add(selector);
|
||||
|
|
|
@ -7,7 +7,7 @@ import flixel.math.FlxPoint;
|
|||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxTimer;
|
||||
|
||||
class GameOverSubstate extends FlxSubState
|
||||
class GameOverSubstate extends MusicBeatSubstate
|
||||
{
|
||||
var bf:Boyfriend;
|
||||
var camFollow:FlxObject;
|
||||
|
@ -16,6 +16,8 @@ class GameOverSubstate extends FlxSubState
|
|||
{
|
||||
super();
|
||||
|
||||
Conductor.songPosition = 0;
|
||||
|
||||
bf = new Boyfriend(x, y);
|
||||
add(bf);
|
||||
|
||||
|
@ -23,6 +25,7 @@ class GameOverSubstate extends FlxSubState
|
|||
add(camFollow);
|
||||
|
||||
FlxG.sound.play('assets/sounds/fnf_loss_sfx' + TitleState.soundExt);
|
||||
Conductor.changeBPM(100);
|
||||
|
||||
// FlxG.camera.followLerp = 1;
|
||||
// FlxG.camera.focusOn(FlxPoint.get(FlxG.width / 2, FlxG.height / 2));
|
||||
|
@ -50,6 +53,18 @@ class GameOverSubstate extends FlxSubState
|
|||
{
|
||||
FlxG.sound.playMusic('assets/music/gameOver' + TitleState.soundExt);
|
||||
}
|
||||
|
||||
if (FlxG.sound.music.playing)
|
||||
{
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
}
|
||||
}
|
||||
|
||||
override function beatHit()
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
FlxG.log.add('beat');
|
||||
}
|
||||
|
||||
var isEnding:Bool = false;
|
||||
|
|
78
source/MusicBeatSubstate.hx
Normal file
78
source/MusicBeatSubstate.hx
Normal file
|
@ -0,0 +1,78 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxSubState;
|
||||
|
||||
class MusicBeatSubstate extends FlxSubState
|
||||
{
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
private var lastBeat:Float = 0;
|
||||
private var lastStep:Float = 0;
|
||||
|
||||
private var totalBeats:Int = 0;
|
||||
private var totalSteps:Int = 0;
|
||||
|
||||
private var curStep:Int = 0;
|
||||
private var curBeat:Int = 0;
|
||||
private var controls(get, never):Controls;
|
||||
|
||||
inline function get_controls():Controls
|
||||
return PlayerSettings.player1.controls;
|
||||
|
||||
override function create()
|
||||
{
|
||||
#if (!web)
|
||||
TitleState.soundExt = '.ogg';
|
||||
#end
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
everyStep();
|
||||
|
||||
updateCurStep();
|
||||
curBeat = Math.round(curStep / 4);
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS EVERY FRAME
|
||||
*/
|
||||
private function everyStep():Void
|
||||
{
|
||||
if (Conductor.songPosition > lastStep + Conductor.stepCrochet - Conductor.safeZoneOffset
|
||||
|| Conductor.songPosition < lastStep + Conductor.safeZoneOffset)
|
||||
{
|
||||
if (Conductor.songPosition > lastStep + Conductor.stepCrochet)
|
||||
{
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function updateCurStep():Void
|
||||
{
|
||||
curStep = Math.floor(Conductor.songPosition / Conductor.stepCrochet);
|
||||
}
|
||||
|
||||
public function stepHit():Void
|
||||
{
|
||||
totalSteps += 1;
|
||||
lastStep += Conductor.stepCrochet;
|
||||
|
||||
if (totalSteps % 4 == 0)
|
||||
beatHit();
|
||||
}
|
||||
|
||||
public function beatHit():Void
|
||||
{
|
||||
lastBeat += Conductor.crochet;
|
||||
totalBeats += 1;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue