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

Commit

Permalink
shhhh guys dont say anything
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnusStrom committed Jun 17, 2021
1 parent 01be6e9 commit 586ea21
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 14 deletions.
13 changes: 3 additions & 10 deletions assets/preload/data/options.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
setOptions Test One
True
setOptions Test Two
False
setOptions Test Three
1
setOptions Test Four
5
setOptions Test Five
Only on sundays
setGhost Tapping|| Hitting a key (if not giving you a hit) will give you a miss || True
setDownscroll || The notes scroll down || False
setMiss Shake || Screen shakes on miss || False
152 changes: 152 additions & 0 deletions source/CreditsMenu.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
package;

import flixel.util.FlxTimer;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import Controls.Control;
import flash.text.TextField;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.display.FlxGridOverlay;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.input.keyboard.FlxKey;
import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import lime.utils.Assets;

class CreditsMenu extends MusicBeatState
{
var selector:FlxText;
var curSelected:Int = 0;

var controlsStrings:Array<String> = [];

private var grpControls:FlxTypedGroup<Alphabet>;

var bg:FlxSprite;

override function create()
{
trace("Opened credits! From " + CumFart.stateFrom);

bg = new FlxSprite(-1300, -90);
add(bg);
bg.loadGraphic(Paths.image('mainMenuCity'));
FlxTween.linearMotion(bg, -1300, -90, -600, -90, 1, true, {type: FlxTween.ONESHOT, ease: FlxEase.expoInOut});

controlsStrings = CoolUtil.coolTextFile(Paths.txt("credits"));

grpControls = new FlxTypedGroup<Alphabet>();
//add(grpControls);
for (i in 0...controlsStrings.length)
{
if (controlsStrings[i].indexOf('set') != -1)
{
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ' : ' + controlsStrings[i + 1], true, false);
controlLabel.isMenuItem = true;
controlLabel.targetY = i;
grpControls.add(controlLabel);
}
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
}
new FlxTimer().start(0.9, function(tmr:FlxTimer) {
add(grpControls);
changeSelection();
});
super.create();
}

override function update(elapsed:Float)
{
super.update(elapsed);
if (controls.ACCEPT)
{
switch(curSelected) {
case 0:
FlxG.openURL("https://youtube.com/channel/UCVgVvwOzvsR8pRwVy316SyA");
case 1:
FlxG.openURL("https://www.youtube.com/channel/UC7M0aIL8-eVSJker9p0OyUQ");
case 2:
FlxG.openURL("https://twitter.com/EvanClubYT");
case 3:
FlxG.openURL("https://twitter.com/C0nfuzzl3dis/");
case 4:
FlxG.openURL("https://youtube.com/channel/UCVgVvwOzvsR8pRwVy316SyA");
case 5:
FlxG.openURL("https://twitter.com/ninja_muffin99");
}
// var funnystring = Std.string(curSelected);
// FlxG.openURL(funnystring);
}

if (isSettingControl)
waitingInput();
{
if (controls.BACK)
CumFart.stateFrom = "freeplay"; // doesnt rlly matter
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)
{
// #if !switch
//NGio.logEvent('Fresh');
// #end

FlxG.sound.play(Paths.sound('scrollMenu'), 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)
{
item.targetY = bullShit - curSelected;
bullShit++;

item.alpha = 0;
// item.setGraphicSize(Std.int(item.width * 0.8));

if (item.targetY == 0)
{
item.alpha = 1;
// item.setGraphicSize(Std.int(item.width));
}
if (item.targetY - 1 == 0 || item.targetY + 1 == 0) {
item.alpha = 0.6;
}
}
}
}
15 changes: 11 additions & 4 deletions source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class OptionsMenu extends MusicBeatState
private var grpControls:FlxTypedGroup<Alphabet>;

var optionsText:FlxText;
var optionsDesc:FlxText;

override function create()
{
Expand All @@ -35,10 +36,14 @@ class OptionsMenu extends MusicBeatState
add(menuBG);
optionsText = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
optionsText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
optionsDesc = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
optionsDesc.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
var optionsBG:FlxSprite = new FlxSprite(optionsText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.55), 80, 0xFF000000);
optionsBG.alpha = 0.6;
add(optionsBG);
add(optionsText);
add(optionsDesc);
optionsDesc.screenCenter(XY);


grpControls = new FlxTypedGroup<Alphabet>();
Expand All @@ -47,7 +52,7 @@ class OptionsMenu extends MusicBeatState
{
if (controlsStrings[i].indexOf('set') != -1)
{
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3), true, false);
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3).split("||")[0], true, false);
controlLabel.isMenuItem = true;
controlLabel.targetY = i;
grpControls.add(controlLabel);
Expand Down Expand Up @@ -114,15 +119,17 @@ class OptionsMenu extends MusicBeatState
curSelected = 0;


optionsText.text = controlsStrings[curSelected + 1];
// selector.y = (70 * curSelected) + 30;
// how did it take me this long to figure this out bruh
optionsText.text = controlsStrings[curSelected].split("||")[2];
optionsDesc.text = controlsStrings[curSelected].split("||")[1];

// selector.y = (70 * curSelected) + 30;
var bullShit:Int = 0;
for (item in grpControls.members)
{
item.targetY = bullShit - curSelected;
bullShit++;

item.alpha = 0.6;
// item.setGraphicSize(Std.int(item.width * 0.8));

Expand Down

0 comments on commit 586ea21

Please sign in to comment.