Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request FunkinCrew#383 from CyndaquilDAC/flashing-lights-t…
Browse files Browse the repository at this point in the history
…oggle

Flashing lights toggle + old code updated with new asset system
  • Loading branch information
Kade-github authored May 5, 2021
2 parents 3e7b462 + f550148 commit b822973
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 29 deletions.
16 changes: 8 additions & 8 deletions source/GameOverState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ 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();
add(bf);
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();
}
Expand Down
7 changes: 2 additions & 5 deletions source/GameOverSubstate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions source/KadeEngineData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
17 changes: 9 additions & 8 deletions source/MenuItem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
20 changes: 20 additions & 0 deletions source/Options.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
{

Expand Down
22 changes: 16 additions & 6 deletions source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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 OptionCatagory("Indicators, Notices, and Displays", [
new AccuracyOption("Display accuracy information."),
new NPSDisplayOption("Shows your current Notes Per Second.")
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
Expand Down

0 comments on commit b822973

Please sign in to comment.