Merge pull request #383 from CyndaquilDAC/flashing-lights-toggle

Flashing lights toggle + old code updated with new asset system
This commit is contained in:
Kade M 2021-05-05 15:56:55 -07:00 committed by GitHub
commit b822973b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 63 additions and 30 deletions

View File

@ -23,12 +23,12 @@ class GameOverState extends FlxTransitionableState
override function create()
{
/* var loser:FlxSprite = new FlxSprite(100, 100);
var loseTex = FlxAtlasFrames.fromSparrow(AssetPaths.lose.png, AssetPaths.lose.xml);
var loser:FlxSprite = new FlxSprite(100, 100);
var loseTex = Paths.getSparrowAtlas('lose');
loser.frames = loseTex;
loser.animation.addByPrefix('lose', 'lose', 24, false);
loser.animation.play('lose');
// add(loser); */
add(loser);
var bf:Boyfriend = new Boyfriend(bfX, bfY);
// bf.scrollFactor.set();
@ -36,18 +36,18 @@ class GameOverState extends FlxTransitionableState
bf.playAnim('firstDeath');
FlxG.camera.follow(bf, LOCKON, 0.001);
/*
var restart:FlxSprite = new FlxSprite(500, 50).loadGraphic(AssetPaths.restart.png);
var restart:FlxSprite = new FlxSprite(500, 50).loadGraphic(Paths.image('restart'));
restart.setGraphicSize(Std.int(restart.width * 0.6));
restart.updateHitbox();
restart.alpha = 0;
restart.antialiasing = true;
// add(restart); */
add(restart);
FlxG.sound.music.fadeOut(2, FlxG.sound.music.volume * 0.6);
// FlxTween.tween(restart, {alpha: 1}, 1, {ease: FlxEase.quartInOut});
// FlxTween.tween(restart, {y: restart.y + 40}, 7, {ease: FlxEase.quartInOut, type: PINGPONG});
FlxTween.tween(restart, {alpha: 1}, 1, {ease: FlxEase.quartInOut});
FlxTween.tween(restart, {y: restart.y + 40}, 7, {ease: FlxEase.quartInOut, type: PINGPONG});
super.create();
}

View File

@ -18,12 +18,9 @@ class GameOverSubstate extends MusicBeatSubstate
{
var daStage = PlayState.curStage;
var daBf:String = '';
switch (daStage)
switch (PlayState.SONG.player1)
{
case 'school':
stageSuffix = '-pixel';
daBf = 'bf-pixel-dead';
case 'schoolEvil':
case 'bf-pixel':
stageSuffix = '-pixel';
daBf = 'bf-pixel-dead';
default:

View File

@ -63,6 +63,9 @@ class KadeEngineData
if (FlxG.save.data.distractions == null)
FlxG.save.data.distractions = true;
if (FlxG.save.data.flashing == null)
FlxG.save.data.flashing = true;
Conductor.recalculateTimings();
Main.watermarks = FlxG.save.data.watermark;

View File

@ -163,8 +163,10 @@ class MainMenuState extends MusicBeatState
{
selectedSomethin = true;
FlxG.sound.play(Paths.sound('confirmMenu'));
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
if(FlxG.save.data.flashing){
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
}
menuItems.forEach(function(spr:FlxSprite)
{

View File

@ -37,13 +37,14 @@ class MenuItem extends FlxSpriteGroup
{
super.update(elapsed);
y = FlxMath.lerp(y, (targetY * 120) + 480, 0.17 * (60 / FlxG.save.data.fpsCap));
if (isFlashing)
flashingInt += 1;
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2))
week.color = 0xFF33ffff;
else
week.color = FlxColor.WHITE;
if(FlxG.save.data.flashing){
if (isFlashing)
flashingInt += 1;
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2))
week.color = 0xFF33ffff;
else
week.color = FlxColor.WHITE;
}
}
}

View File

@ -202,6 +202,26 @@ class DistractionsAndEffectsOption extends Option
}
}
class FlashingLightsOption extends Option
{
public function new(desc:String)
{
super();
description = desc;
}
public override function press():Bool
{
FlxG.save.data.flashing = !FlxG.save.data.flashing;
display = updateDisplay();
return true;
}
private override function updateDisplay():String
{
return "Flashing Lights " + (!FlxG.save.data.flashing ? "off" : "on");
}
}
class Judgement extends Option
{

View File

@ -22,26 +22,36 @@ class OptionsMenu extends MusicBeatState
var options:Array<OptionCatagory> = [
new OptionCatagory("Gameplay", [
new DFJKOption(controls),
new DownscrollOption("Change the layout of the strumline."),
new GhostTapOption("Ghost Tapping is when you tap a direction and it doesn't give you a miss."),
new Judgement("Customize your Hit Timings (LEFT or RIGHT)"),
#if desktop
new FPSCapOption("Cap your FPS (Left for -10, Right for +10. SHIFT to go faster)"),
#end
new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If its at 1, it will be chart dependent)"),
new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If it's at 1, it will be chart dependent)"),
new AccuracyDOption("Change how accuracy is calculated. (Accurate = Simple, Complex = Milisecond Based)"),
// new OffsetMenu("Get a note offset based off of your inputs!"),
new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference")
]),
new OptionCatagory("Appearance", [
new SongPositionOption("Show the songs current position (as a bar)"),
new DownscrollOption("Change the layout of the strumline."),
new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay."),
#if desktop
new RainbowFPSOption("Make the FPS Counter Rainbow (Only works with the FPS Counter toggled on)"),
new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay."),
new RainbowFPSOption("Make the FPS Counter Rainbow (Only works with the FPS Counter toggled on and Flashing Lights toggled off)")
#else
new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay.")
#end
new AccuracyOption("Display accuracy information."),
new NPSDisplayOption("Shows your current Notes Per Second.")
]),
new OptionCatagory("Indicators, Notices, and Displays", [
new AccuracyOption("Display accuracy information."),
new NPSDisplayOption("Shows your current Notes Per Second."),
new SongPositionOption("Show the songs current position (as a bar)"),
]),
new OptionCatagory("Health and Safety", [
new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain.")
]),
new OptionCatagory("Misc", [
#if desktop