Merge branch 'master' of https://github.com/KadeDev/Kade-Engine
This commit is contained in:
commit
b85ebd596c
@ -407,7 +407,7 @@ class Character extends FlxSprite
|
|||||||
|
|
||||||
public function loadOffsetFile(character:String)
|
public function loadOffsetFile(character:String)
|
||||||
{
|
{
|
||||||
var offset:Array<String> = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets"));
|
var offset:Array<String> = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets", 'shared'));
|
||||||
|
|
||||||
for (i in 0...offset.length)
|
for (i in 0...offset.length)
|
||||||
{
|
{
|
||||||
@ -452,13 +452,13 @@ class Character extends FlxSprite
|
|||||||
/**
|
/**
|
||||||
* FOR GF DANCING SHIT
|
* FOR GF DANCING SHIT
|
||||||
*/
|
*/
|
||||||
public function dance()
|
public function dance(forced:Bool = false)
|
||||||
{
|
{
|
||||||
if (!debugMode)
|
if (!debugMode)
|
||||||
{
|
{
|
||||||
switch (curCharacter)
|
switch (curCharacter)
|
||||||
{
|
{
|
||||||
case 'gf':
|
case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel':
|
||||||
if (!animation.curAnim.name.startsWith('hair'))
|
if (!animation.curAnim.name.startsWith('hair'))
|
||||||
{
|
{
|
||||||
danced = !danced;
|
danced = !danced;
|
||||||
@ -468,39 +468,6 @@ class Character extends FlxSprite
|
|||||||
else
|
else
|
||||||
playAnim('danceLeft');
|
playAnim('danceLeft');
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'gf-christmas':
|
|
||||||
if (!animation.curAnim.name.startsWith('hair'))
|
|
||||||
{
|
|
||||||
danced = !danced;
|
|
||||||
|
|
||||||
if (danced)
|
|
||||||
playAnim('danceRight');
|
|
||||||
else
|
|
||||||
playAnim('danceLeft');
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'gf-car':
|
|
||||||
if (!animation.curAnim.name.startsWith('hair'))
|
|
||||||
{
|
|
||||||
danced = !danced;
|
|
||||||
|
|
||||||
if (danced)
|
|
||||||
playAnim('danceRight');
|
|
||||||
else
|
|
||||||
playAnim('danceLeft');
|
|
||||||
}
|
|
||||||
case 'gf-pixel':
|
|
||||||
if (!animation.curAnim.name.startsWith('hair'))
|
|
||||||
{
|
|
||||||
danced = !danced;
|
|
||||||
|
|
||||||
if (danced)
|
|
||||||
playAnim('danceRight');
|
|
||||||
else
|
|
||||||
playAnim('danceLeft');
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'spooky':
|
case 'spooky':
|
||||||
danced = !danced;
|
danced = !danced;
|
||||||
|
|
||||||
@ -509,7 +476,7 @@ class Character extends FlxSprite
|
|||||||
else
|
else
|
||||||
playAnim('danceLeft');
|
playAnim('danceLeft');
|
||||||
default:
|
default:
|
||||||
playAnim('idle');
|
playAnim('idle', forced);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class GameplayCustomizeState extends MusicBeatState
|
|||||||
curt = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains','shared'));
|
curt = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains','shared'));
|
||||||
front = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront','shared'));
|
front = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront','shared'));
|
||||||
|
|
||||||
Conductor.changeBPM(102);
|
//Conductor.changeBPM(102);
|
||||||
persistentUpdate = true;
|
persistentUpdate = true;
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
@ -193,8 +193,9 @@ class GameplayCustomizeState extends MusicBeatState
|
|||||||
{
|
{
|
||||||
super.beatHit();
|
super.beatHit();
|
||||||
|
|
||||||
bf.playAnim('idle');
|
bf.playAnim('idle', true);
|
||||||
dad.dance();
|
dad.dance(true);
|
||||||
|
gf.dance();
|
||||||
|
|
||||||
FlxG.camera.zoom += 0.015;
|
FlxG.camera.zoom += 0.015;
|
||||||
camHUD.zoom += 0.010;
|
camHUD.zoom += 0.010;
|
||||||
|
@ -53,7 +53,7 @@ class Paths
|
|||||||
return 'assets/$file';
|
return 'assets/$file';
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static public function file(file:String, type:AssetType = TEXT, ?library:String)
|
inline static public function file(file:String, ?library:String, type:AssetType = TEXT)
|
||||||
{
|
{
|
||||||
return getPath(file, type, library);
|
return getPath(file, type, library);
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ class Paths
|
|||||||
return null;
|
return null;
|
||||||
#end
|
#end
|
||||||
else
|
else
|
||||||
return FlxAtlasFrames.fromSparrow(image('characters/$key'), file('images/characters/$key.xml'));
|
return FlxAtlasFrames.fromSparrow(image('characters/$key', library), file('images/characters/$key.xml', library));
|
||||||
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
|
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ class Paths
|
|||||||
return null;
|
return null;
|
||||||
#end
|
#end
|
||||||
else
|
else
|
||||||
return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt'));
|
return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt', library));
|
||||||
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
|
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,6 +270,8 @@ class PauseSubState extends MusicBeatSubstate
|
|||||||
{
|
{
|
||||||
curSelected += change;
|
curSelected += change;
|
||||||
|
|
||||||
|
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||||
|
|
||||||
if (curSelected < 0)
|
if (curSelected < 0)
|
||||||
curSelected = menuItems.length - 1;
|
curSelected = menuItems.length - 1;
|
||||||
if (curSelected >= menuItems.length)
|
if (curSelected >= menuItems.length)
|
||||||
|
@ -100,6 +100,7 @@ class PlayState extends MusicBeatState
|
|||||||
|
|
||||||
public static var rep:Replay;
|
public static var rep:Replay;
|
||||||
public static var loadRep:Bool = false;
|
public static var loadRep:Bool = false;
|
||||||
|
public static var inResults:Bool = false;
|
||||||
|
|
||||||
public static var noteBools:Array<Bool> = [false, false, false, false];
|
public static var noteBools:Array<Bool> = [false, false, false, false];
|
||||||
|
|
||||||
@ -185,6 +186,8 @@ class PlayState extends MusicBeatState
|
|||||||
|
|
||||||
var notesHitArray:Array<Date> = [];
|
var notesHitArray:Array<Date> = [];
|
||||||
var currentFrames:Int = 0;
|
var currentFrames:Int = 0;
|
||||||
|
var idleToBeat:Bool = true; // change if bf and dad would idle to the beat of the song
|
||||||
|
var idleBeat:Int = 1; // how frequently bf and dad would play their idle animation(1 - every beat, 2 - every 2 beats and so on)
|
||||||
|
|
||||||
public var dialogue:Array<String> = ['dad:blah blah blah', 'bf:coolswag'];
|
public var dialogue:Array<String> = ['dad:blah blah blah', 'bf:coolswag'];
|
||||||
|
|
||||||
@ -226,6 +229,7 @@ class PlayState extends MusicBeatState
|
|||||||
|
|
||||||
var funneEffect:FlxSprite;
|
var funneEffect:FlxSprite;
|
||||||
var inCutscene:Bool = false;
|
var inCutscene:Bool = false;
|
||||||
|
var usedTimeTravel:Bool = false;
|
||||||
|
|
||||||
public static var repPresses:Int = 0;
|
public static var repPresses:Int = 0;
|
||||||
public static var repReleases:Int = 0;
|
public static var repReleases:Int = 0;
|
||||||
@ -293,6 +297,7 @@ class PlayState extends MusicBeatState
|
|||||||
highestCombo = 0;
|
highestCombo = 0;
|
||||||
repPresses = 0;
|
repPresses = 0;
|
||||||
repReleases = 0;
|
repReleases = 0;
|
||||||
|
inResults = false;
|
||||||
|
|
||||||
PlayStateChangeables.useDownscroll = FlxG.save.data.downscroll;
|
PlayStateChangeables.useDownscroll = FlxG.save.data.downscroll;
|
||||||
PlayStateChangeables.safeFrames = FlxG.save.data.frames;
|
PlayStateChangeables.safeFrames = FlxG.save.data.frames;
|
||||||
@ -2453,6 +2458,45 @@ class PlayState extends MusicBeatState
|
|||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(FlxG.keys.justPressed.TWO) { //Go 10 seconds into the future, credit: Shadow Mario#9396
|
||||||
|
if (!usedTimeTravel && Conductor.songPosition + 10000 < FlxG.sound.music.length)
|
||||||
|
{
|
||||||
|
usedTimeTravel = true;
|
||||||
|
FlxG.sound.music.pause();
|
||||||
|
vocals.pause();
|
||||||
|
Conductor.songPosition += 10000;
|
||||||
|
notes.forEachAlive(function(daNote:Note)
|
||||||
|
{
|
||||||
|
if(daNote.strumTime - 500 < Conductor.songPosition) {
|
||||||
|
daNote.active = false;
|
||||||
|
daNote.visible = false;
|
||||||
|
|
||||||
|
|
||||||
|
daNote.kill();
|
||||||
|
notes.remove(daNote, true);
|
||||||
|
daNote.destroy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
for (i in 0...unspawnNotes.length) {
|
||||||
|
var daNote:Note = unspawnNotes[0];
|
||||||
|
if(daNote.strumTime - 500 >= Conductor.songPosition) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
unspawnNotes.splice(unspawnNotes.indexOf(daNote), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
FlxG.sound.music.time = Conductor.songPosition;
|
||||||
|
FlxG.sound.music.play();
|
||||||
|
|
||||||
|
vocals.time = Conductor.songPosition;
|
||||||
|
vocals.play();
|
||||||
|
new FlxTimer().start(0.5, function(tmr:FlxTimer)
|
||||||
|
{
|
||||||
|
usedTimeTravel = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
if (startingSong)
|
if (startingSong)
|
||||||
@ -2713,34 +2757,39 @@ class PlayState extends MusicBeatState
|
|||||||
|
|
||||||
if (health <= 0)
|
if (health <= 0)
|
||||||
{
|
{
|
||||||
boyfriend.stunned = true;
|
if (!usedTimeTravel)
|
||||||
|
{
|
||||||
|
boyfriend.stunned = true;
|
||||||
|
|
||||||
persistentUpdate = false;
|
persistentUpdate = false;
|
||||||
persistentDraw = false;
|
persistentDraw = false;
|
||||||
paused = true;
|
paused = true;
|
||||||
|
|
||||||
vocals.stop();
|
vocals.stop();
|
||||||
FlxG.sound.music.stop();
|
FlxG.sound.music.stop();
|
||||||
|
|
||||||
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||||
|
|
||||||
#if windows
|
#if windows
|
||||||
// Game Over doesn't get his own variable because it's only used here
|
// Game Over doesn't get his own variable because it's only used here
|
||||||
DiscordClient.changePresence("GAME OVER -- "
|
DiscordClient.changePresence("GAME OVER -- "
|
||||||
+ SONG.song
|
+ SONG.song
|
||||||
+ " ("
|
+ " ("
|
||||||
+ storyDifficultyText
|
+ storyDifficultyText
|
||||||
+ ") "
|
+ ") "
|
||||||
+ Ratings.GenerateLetterRank(accuracy),
|
+ Ratings.GenerateLetterRank(accuracy),
|
||||||
"\nAcc: "
|
"\nAcc: "
|
||||||
+ HelperFunctions.truncateFloat(accuracy, 2)
|
+ HelperFunctions.truncateFloat(accuracy, 2)
|
||||||
+ "% | Score: "
|
+ "% | Score: "
|
||||||
+ songScore
|
+ songScore
|
||||||
+ " | Misses: "
|
+ " | Misses: "
|
||||||
+ misses, iconRPC);
|
+ misses, iconRPC);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
health = 1;
|
||||||
}
|
}
|
||||||
if (FlxG.save.data.resetButton)
|
if (FlxG.save.data.resetButton)
|
||||||
{
|
{
|
||||||
@ -3192,10 +3241,17 @@ class PlayState extends MusicBeatState
|
|||||||
FlxG.sound.music.stop();
|
FlxG.sound.music.stop();
|
||||||
vocals.stop();
|
vocals.stop();
|
||||||
if (FlxG.save.data.scoreScreen)
|
if (FlxG.save.data.scoreScreen)
|
||||||
|
{
|
||||||
openSubState(new ResultsScreen());
|
openSubState(new ResultsScreen());
|
||||||
|
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||||
|
{
|
||||||
|
inResults = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||||
|
Conductor.changeBPM(102);
|
||||||
FlxG.switchState(new StoryMenuState());
|
FlxG.switchState(new StoryMenuState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3263,7 +3319,13 @@ class PlayState extends MusicBeatState
|
|||||||
vocals.stop();
|
vocals.stop();
|
||||||
|
|
||||||
if (FlxG.save.data.scoreScreen)
|
if (FlxG.save.data.scoreScreen)
|
||||||
|
{
|
||||||
openSubState(new ResultsScreen());
|
openSubState(new ResultsScreen());
|
||||||
|
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||||
|
{
|
||||||
|
inResults = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
else
|
else
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
}
|
}
|
||||||
@ -4318,8 +4380,9 @@ class PlayState extends MusicBeatState
|
|||||||
// Conductor.changeBPM(SONG.bpm);
|
// Conductor.changeBPM(SONG.bpm);
|
||||||
|
|
||||||
// Dad doesnt interupt his own notes
|
// Dad doesnt interupt his own notes
|
||||||
if (SONG.notes[Math.floor(curStep / 16)].mustHitSection && dad.curCharacter != 'gf')
|
if ((SONG.notes[Math.floor(curStep / 16)].mustHitSection || !dad.animation.curAnim.name.startsWith("sing")) && dad.curCharacter != 'gf')
|
||||||
dad.dance();
|
if (curBeat % idleBeat == 0)
|
||||||
|
dad.dance(idleToBeat);
|
||||||
}
|
}
|
||||||
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
|
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
|
||||||
wiggleShit.update(Conductor.crochet);
|
wiggleShit.update(Conductor.crochet);
|
||||||
@ -4351,9 +4414,9 @@ class PlayState extends MusicBeatState
|
|||||||
gf.dance();
|
gf.dance();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
|
if (!boyfriend.animation.curAnim.name.startsWith("sing") && curBeat % idleBeat == 0)
|
||||||
{
|
{
|
||||||
boyfriend.playAnim('idle');
|
boyfriend.playAnim('idle', idleToBeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (!dad.animation.curAnim.name.startsWith("sing"))
|
/*if (!dad.animation.curAnim.name.startsWith("sing"))
|
||||||
|
@ -54,10 +54,13 @@ class ResultsScreen extends FlxSubState
|
|||||||
background.scrollFactor.set();
|
background.scrollFactor.set();
|
||||||
add(background);
|
add(background);
|
||||||
|
|
||||||
music = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
|
if (!PlayState.inResults)
|
||||||
music.volume = 0;
|
{
|
||||||
music.play(false, FlxG.random.int(0, Std.int(music.length / 2)));
|
music = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
|
||||||
FlxG.sound.list.add(music);
|
music.volume = 0;
|
||||||
|
music.play(false, FlxG.random.int(0, Std.int(music.length / 2)));
|
||||||
|
FlxG.sound.list.add(music);
|
||||||
|
}
|
||||||
|
|
||||||
background.alpha = 0;
|
background.alpha = 0;
|
||||||
|
|
||||||
@ -168,8 +171,8 @@ class ResultsScreen extends FlxSubState
|
|||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
if (music.volume < 0.5)
|
if (music != null && music.volume < 0.5)
|
||||||
music.volume += 0.01 * elapsed;
|
music.volume += 0.01 * elapsed;
|
||||||
|
|
||||||
// keybinds
|
// keybinds
|
||||||
|
|
||||||
@ -194,6 +197,7 @@ class ResultsScreen extends FlxSubState
|
|||||||
if (PlayState.isStoryMode)
|
if (PlayState.isStoryMode)
|
||||||
{
|
{
|
||||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||||
|
Conductor.changeBPM(102);
|
||||||
FlxG.switchState(new MainMenuState());
|
FlxG.switchState(new MainMenuState());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -234,7 +238,6 @@ class ResultsScreen extends FlxSubState
|
|||||||
PlayState.SONG = Song.loadFromJson(poop, PlayState.rep.replay.songName);
|
PlayState.SONG = Song.loadFromJson(poop, PlayState.rep.replay.songName);
|
||||||
PlayState.isStoryMode = false;
|
PlayState.isStoryMode = false;
|
||||||
PlayState.storyDifficulty = PlayState.rep.replay.songDiff;
|
PlayState.storyDifficulty = PlayState.rep.replay.songDiff;
|
||||||
PlayState.storyWeek = 0;
|
|
||||||
LoadingState.loadAndSwitchState(new PlayState());
|
LoadingState.loadAndSwitchState(new PlayState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,12 +268,12 @@ class ResultsScreen extends FlxSubState
|
|||||||
|
|
||||||
var poop:String = Highscore.formatSong(songFormat, PlayState.storyDifficulty);
|
var poop:String = Highscore.formatSong(songFormat, PlayState.storyDifficulty);
|
||||||
|
|
||||||
music.fadeOut(0.3);
|
if (music != null)
|
||||||
|
music.fadeOut(0.3);
|
||||||
|
|
||||||
PlayState.SONG = Song.loadFromJson(poop, PlayState.SONG.song);
|
PlayState.SONG = Song.loadFromJson(poop, PlayState.SONG.song);
|
||||||
PlayState.isStoryMode = false;
|
PlayState.isStoryMode = false;
|
||||||
PlayState.storyDifficulty = PlayState.storyDifficulty;
|
PlayState.storyDifficulty = PlayState.storyDifficulty;
|
||||||
PlayState.storyWeek = 0;
|
|
||||||
LoadingState.loadAndSwitchState(new PlayState());
|
LoadingState.loadAndSwitchState(new PlayState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,6 +272,7 @@ class TitleState extends MusicBeatState
|
|||||||
// FlxG.sound.music.stop();
|
// FlxG.sound.music.stop();
|
||||||
|
|
||||||
MainMenuState.firstStart = true;
|
MainMenuState.firstStart = true;
|
||||||
|
MainMenuState.finishedFunnyMove = false;
|
||||||
|
|
||||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user