Merge pull request #383 from CyndaquilDAC/flashing-lights-toggle
Flashing lights toggle + old code updated with new asset system
This commit is contained in:
commit
b822973b46
@ -23,12 +23,12 @@ class GameOverState extends FlxTransitionableState
|
|||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
/* var loser:FlxSprite = new FlxSprite(100, 100);
|
var loser:FlxSprite = new FlxSprite(100, 100);
|
||||||
var loseTex = FlxAtlasFrames.fromSparrow(AssetPaths.lose.png, AssetPaths.lose.xml);
|
var loseTex = Paths.getSparrowAtlas('lose');
|
||||||
loser.frames = loseTex;
|
loser.frames = loseTex;
|
||||||
loser.animation.addByPrefix('lose', 'lose', 24, false);
|
loser.animation.addByPrefix('lose', 'lose', 24, false);
|
||||||
loser.animation.play('lose');
|
loser.animation.play('lose');
|
||||||
// add(loser); */
|
add(loser);
|
||||||
|
|
||||||
var bf:Boyfriend = new Boyfriend(bfX, bfY);
|
var bf:Boyfriend = new Boyfriend(bfX, bfY);
|
||||||
// bf.scrollFactor.set();
|
// bf.scrollFactor.set();
|
||||||
@ -36,18 +36,18 @@ class GameOverState extends FlxTransitionableState
|
|||||||
bf.playAnim('firstDeath');
|
bf.playAnim('firstDeath');
|
||||||
|
|
||||||
FlxG.camera.follow(bf, LOCKON, 0.001);
|
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.setGraphicSize(Std.int(restart.width * 0.6));
|
||||||
restart.updateHitbox();
|
restart.updateHitbox();
|
||||||
restart.alpha = 0;
|
restart.alpha = 0;
|
||||||
restart.antialiasing = true;
|
restart.antialiasing = true;
|
||||||
// add(restart); */
|
add(restart);
|
||||||
|
|
||||||
FlxG.sound.music.fadeOut(2, FlxG.sound.music.volume * 0.6);
|
FlxG.sound.music.fadeOut(2, FlxG.sound.music.volume * 0.6);
|
||||||
|
|
||||||
// FlxTween.tween(restart, {alpha: 1}, 1, {ease: FlxEase.quartInOut});
|
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, {y: restart.y + 40}, 7, {ease: FlxEase.quartInOut, type: PINGPONG});
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,9 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||||||
{
|
{
|
||||||
var daStage = PlayState.curStage;
|
var daStage = PlayState.curStage;
|
||||||
var daBf:String = '';
|
var daBf:String = '';
|
||||||
switch (daStage)
|
switch (PlayState.SONG.player1)
|
||||||
{
|
{
|
||||||
case 'school':
|
case 'bf-pixel':
|
||||||
stageSuffix = '-pixel';
|
|
||||||
daBf = 'bf-pixel-dead';
|
|
||||||
case 'schoolEvil':
|
|
||||||
stageSuffix = '-pixel';
|
stageSuffix = '-pixel';
|
||||||
daBf = 'bf-pixel-dead';
|
daBf = 'bf-pixel-dead';
|
||||||
default:
|
default:
|
||||||
|
@ -63,6 +63,9 @@ class KadeEngineData
|
|||||||
if (FlxG.save.data.distractions == null)
|
if (FlxG.save.data.distractions == null)
|
||||||
FlxG.save.data.distractions = true;
|
FlxG.save.data.distractions = true;
|
||||||
|
|
||||||
|
if (FlxG.save.data.flashing == null)
|
||||||
|
FlxG.save.data.flashing = true;
|
||||||
|
|
||||||
Conductor.recalculateTimings();
|
Conductor.recalculateTimings();
|
||||||
|
|
||||||
Main.watermarks = FlxG.save.data.watermark;
|
Main.watermarks = FlxG.save.data.watermark;
|
||||||
|
@ -163,8 +163,10 @@ class MainMenuState extends MusicBeatState
|
|||||||
{
|
{
|
||||||
selectedSomethin = true;
|
selectedSomethin = true;
|
||||||
FlxG.sound.play(Paths.sound('confirmMenu'));
|
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)
|
menuItems.forEach(function(spr:FlxSprite)
|
||||||
{
|
{
|
||||||
|
@ -37,13 +37,14 @@ class MenuItem extends FlxSpriteGroup
|
|||||||
{
|
{
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
y = FlxMath.lerp(y, (targetY * 120) + 480, 0.17 * (60 / FlxG.save.data.fpsCap));
|
y = FlxMath.lerp(y, (targetY * 120) + 480, 0.17 * (60 / FlxG.save.data.fpsCap));
|
||||||
|
if(FlxG.save.data.flashing){
|
||||||
if (isFlashing)
|
if (isFlashing)
|
||||||
flashingInt += 1;
|
flashingInt += 1;
|
||||||
|
|
||||||
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2))
|
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2))
|
||||||
week.color = 0xFF33ffff;
|
week.color = 0xFF33ffff;
|
||||||
else
|
else
|
||||||
week.color = FlxColor.WHITE;
|
week.color = FlxColor.WHITE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
class Judgement extends Option
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -22,26 +22,36 @@ class OptionsMenu extends MusicBeatState
|
|||||||
var options:Array<OptionCatagory> = [
|
var options:Array<OptionCatagory> = [
|
||||||
new OptionCatagory("Gameplay", [
|
new OptionCatagory("Gameplay", [
|
||||||
new DFJKOption(controls),
|
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 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)"),
|
new Judgement("Customize your Hit Timings (LEFT or RIGHT)"),
|
||||||
#if desktop
|
#if desktop
|
||||||
new FPSCapOption("Cap your FPS (Left for -10, Right for +10. SHIFT to go faster)"),
|
new FPSCapOption("Cap your FPS (Left for -10, Right for +10. SHIFT to go faster)"),
|
||||||
#end
|
#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 AccuracyDOption("Change how accuracy is calculated. (Accurate = Simple, Complex = Milisecond Based)"),
|
||||||
// new OffsetMenu("Get a note offset based off of your inputs!"),
|
// new OffsetMenu("Get a note offset based off of your inputs!"),
|
||||||
new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference")
|
new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference")
|
||||||
]),
|
]),
|
||||||
new OptionCatagory("Appearance", [
|
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
|
#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
|
#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", [
|
new OptionCatagory("Misc", [
|
||||||
#if desktop
|
#if desktop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user