senpai and roses on easy
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+1
-5181
File diff suppressed because one or more lines are too long
+72
-43
@@ -1,25 +1,26 @@
|
|||||||
package;
|
package;
|
||||||
|
|
||||||
|
import Controls.Control;
|
||||||
import flash.text.TextField;
|
import flash.text.TextField;
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.addons.display.FlxGridOverlay;
|
import flixel.addons.display.FlxGridOverlay;
|
||||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
|
import flixel.input.keyboard.FlxKey;
|
||||||
import flixel.math.FlxMath;
|
import flixel.math.FlxMath;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
import lime.utils.Assets;
|
import lime.utils.Assets;
|
||||||
|
|
||||||
class OptionsMenu extends MusicBeatState
|
class OptionsMenu extends MusicBeatState
|
||||||
{
|
{
|
||||||
|
|
||||||
var selector:FlxText;
|
var selector:FlxText;
|
||||||
var curSelected:Int = 0;
|
var curSelected:Int = 0;
|
||||||
|
|
||||||
var controlsStrings:Array<String> = [];
|
var controlsStrings:Array<String> = [];
|
||||||
|
|
||||||
private var grpControls:FlxTypedGroup<Alphabet>;
|
private var grpControls:FlxTypedGroup<Alphabet>;
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
var menuBG:FlxSprite = new FlxSprite().loadGraphic('assets/images/menuDesat.png');
|
var menuBG:FlxSprite = new FlxSprite().loadGraphic('assets/images/menuDesat.png');
|
||||||
@@ -33,11 +34,12 @@ class OptionsMenu extends MusicBeatState
|
|||||||
|
|
||||||
grpControls = new FlxTypedGroup<Alphabet>();
|
grpControls = new FlxTypedGroup<Alphabet>();
|
||||||
add(grpControls);
|
add(grpControls);
|
||||||
|
|
||||||
for (i in 0...controlsStrings.length)
|
for (i in 0...controlsStrings.length)
|
||||||
{
|
{
|
||||||
if(controlsStrings[i].indexOf('set') != -1){
|
if (controlsStrings[i].indexOf('set') != -1)
|
||||||
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3)+': '+controlsStrings[i+1], true, false);
|
{
|
||||||
|
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ': ' + controlsStrings[i + 1], true, false);
|
||||||
controlLabel.isMenuItem = true;
|
controlLabel.isMenuItem = true;
|
||||||
controlLabel.targetY = i;
|
controlLabel.targetY = i;
|
||||||
grpControls.add(controlLabel);
|
grpControls.add(controlLabel);
|
||||||
@@ -52,48 +54,75 @@ class OptionsMenu extends MusicBeatState
|
|||||||
{
|
{
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
|
||||||
if (controls.BACK)
|
if (controls.ACCEPT)
|
||||||
FlxG.switchState(new MainMenuState());
|
{
|
||||||
if(controls.UP_P)
|
changeBinding();
|
||||||
changeSelection(-1);
|
}
|
||||||
if(controls.DOWN_P)
|
|
||||||
changeSelection(1);
|
if (isSettingControl)
|
||||||
|
waitingInput();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (controls.BACK)
|
||||||
|
FlxG.switchState(new MainMenuState());
|
||||||
|
if (controls.UP_P)
|
||||||
|
changeSelection(-1);
|
||||||
|
if (controls.DOWN_P)
|
||||||
|
changeSelection(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function waitingInput():Void
|
||||||
|
{
|
||||||
|
if (FlxG.keys.getIsDown().length > 0)
|
||||||
|
{
|
||||||
|
PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxG.keys.getIsDown()[0].ID, null);
|
||||||
|
}
|
||||||
|
// PlayerSettings.player1.controls.replaceBinding(Control)
|
||||||
|
}
|
||||||
|
|
||||||
|
var isSettingControl:Bool = false;
|
||||||
|
|
||||||
|
function changeBinding():Void
|
||||||
|
{
|
||||||
|
if (!isSettingControl)
|
||||||
|
{
|
||||||
|
isSettingControl = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeSelection(change:Int = 0)
|
function changeSelection(change:Int = 0)
|
||||||
|
{
|
||||||
|
#if !switch
|
||||||
|
NGio.logEvent('Fresh');
|
||||||
|
#end
|
||||||
|
|
||||||
|
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt, 0.4);
|
||||||
|
|
||||||
|
curSelected += change;
|
||||||
|
|
||||||
|
if (curSelected < 0)
|
||||||
|
curSelected = grpControls.length - 1;
|
||||||
|
if (curSelected >= grpControls.length)
|
||||||
|
curSelected = 0;
|
||||||
|
|
||||||
|
// selector.y = (70 * curSelected) + 30;
|
||||||
|
|
||||||
|
var bullShit:Int = 0;
|
||||||
|
|
||||||
|
for (item in grpControls.members)
|
||||||
{
|
{
|
||||||
#if !switch
|
item.targetY = bullShit - curSelected;
|
||||||
NGio.logEvent('Fresh');
|
bullShit++;
|
||||||
#end
|
|
||||||
|
item.alpha = 0.6;
|
||||||
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt, 0.4);
|
// item.setGraphicSize(Std.int(item.width * 0.8));
|
||||||
|
|
||||||
curSelected += change;
|
if (item.targetY == 0)
|
||||||
|
|
||||||
if (curSelected < 0)
|
|
||||||
curSelected = controlsStrings.length - 1;
|
|
||||||
if (curSelected >= controlsStrings.length)
|
|
||||||
curSelected = 0;
|
|
||||||
|
|
||||||
// selector.y = (70 * curSelected) + 30;
|
|
||||||
|
|
||||||
var bullShit:Int = 0;
|
|
||||||
|
|
||||||
for (item in grpControls.members)
|
|
||||||
{
|
{
|
||||||
item.targetY = bullShit - curSelected;
|
item.alpha = 1;
|
||||||
bullShit++;
|
// item.setGraphicSize(Std.int(item.width));
|
||||||
|
|
||||||
item.alpha = 0.6;
|
|
||||||
// item.setGraphicSize(Std.int(item.width * 0.8));
|
|
||||||
|
|
||||||
if (item.targetY == 0)
|
|
||||||
{
|
|
||||||
item.alpha = 1;
|
|
||||||
// item.setGraphicSize(Std.int(item.width));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user