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

Commit 586ea21

Browse files
committed
shhhh guys dont say anything
1 parent 01be6e9 commit 586ea21

File tree

3 files changed

+166
-14
lines changed

3 files changed

+166
-14
lines changed

assets/preload/data/options.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
setOptions Test One
2-
True
3-
setOptions Test Two
4-
False
5-
setOptions Test Three
6-
1
7-
setOptions Test Four
8-
5
9-
setOptions Test Five
10-
Only on sundays
1+
setGhost Tapping|| Hitting a key (if not giving you a hit) will give you a miss || True
2+
setDownscroll || The notes scroll down || False
3+
setMiss Shake || Screen shakes on miss || False

source/CreditsMenu.hx

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
package;
2+
3+
import flixel.util.FlxTimer;
4+
import flixel.tweens.FlxEase;
5+
import flixel.tweens.FlxTween;
6+
import Controls.Control;
7+
import flash.text.TextField;
8+
import flixel.FlxG;
9+
import flixel.FlxSprite;
10+
import flixel.addons.display.FlxGridOverlay;
11+
import flixel.group.FlxGroup.FlxTypedGroup;
12+
import flixel.input.keyboard.FlxKey;
13+
import flixel.math.FlxMath;
14+
import flixel.text.FlxText;
15+
import flixel.util.FlxColor;
16+
import lime.utils.Assets;
17+
18+
class CreditsMenu extends MusicBeatState
19+
{
20+
var selector:FlxText;
21+
var curSelected:Int = 0;
22+
23+
var controlsStrings:Array<String> = [];
24+
25+
private var grpControls:FlxTypedGroup<Alphabet>;
26+
27+
var bg:FlxSprite;
28+
29+
override function create()
30+
{
31+
trace("Opened credits! From " + CumFart.stateFrom);
32+
33+
bg = new FlxSprite(-1300, -90);
34+
add(bg);
35+
bg.loadGraphic(Paths.image('mainMenuCity'));
36+
FlxTween.linearMotion(bg, -1300, -90, -600, -90, 1, true, {type: FlxTween.ONESHOT, ease: FlxEase.expoInOut});
37+
38+
controlsStrings = CoolUtil.coolTextFile(Paths.txt("credits"));
39+
40+
grpControls = new FlxTypedGroup<Alphabet>();
41+
//add(grpControls);
42+
for (i in 0...controlsStrings.length)
43+
{
44+
if (controlsStrings[i].indexOf('set') != -1)
45+
{
46+
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ' : ' + controlsStrings[i + 1], true, false);
47+
controlLabel.isMenuItem = true;
48+
controlLabel.targetY = i;
49+
grpControls.add(controlLabel);
50+
}
51+
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
52+
}
53+
new FlxTimer().start(0.9, function(tmr:FlxTimer) {
54+
add(grpControls);
55+
changeSelection();
56+
});
57+
super.create();
58+
}
59+
60+
override function update(elapsed:Float)
61+
{
62+
super.update(elapsed);
63+
if (controls.ACCEPT)
64+
{
65+
switch(curSelected) {
66+
case 0:
67+
FlxG.openURL("https://youtube.com/channel/UCVgVvwOzvsR8pRwVy316SyA");
68+
case 1:
69+
FlxG.openURL("https://www.youtube.com/channel/UC7M0aIL8-eVSJker9p0OyUQ");
70+
case 2:
71+
FlxG.openURL("https://twitter.com/EvanClubYT");
72+
case 3:
73+
FlxG.openURL("https://twitter.com/C0nfuzzl3dis/");
74+
case 4:
75+
FlxG.openURL("https://youtube.com/channel/UCVgVvwOzvsR8pRwVy316SyA");
76+
case 5:
77+
FlxG.openURL("https://twitter.com/ninja_muffin99");
78+
}
79+
// var funnystring = Std.string(curSelected);
80+
// FlxG.openURL(funnystring);
81+
}
82+
83+
if (isSettingControl)
84+
waitingInput();
85+
{
86+
if (controls.BACK)
87+
CumFart.stateFrom = "freeplay"; // doesnt rlly matter
88+
FlxG.switchState(new MainMenuState());
89+
if (controls.UP_P)
90+
changeSelection(-1);
91+
if (controls.DOWN_P)
92+
changeSelection(1);
93+
}
94+
}
95+
96+
function waitingInput():Void
97+
{
98+
if (FlxG.keys.getIsDown().length > 0)
99+
{
100+
PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxG.keys.getIsDown()[0].ID, null);
101+
}
102+
// PlayerSettings.player1.controls.replaceBinding(Control)
103+
}
104+
105+
var isSettingControl:Bool = false;
106+
107+
function changeBinding():Void
108+
{
109+
if (!isSettingControl)
110+
{
111+
isSettingControl = true;
112+
}
113+
}
114+
115+
function changeSelection(change:Int = 0)
116+
{
117+
// #if !switch
118+
//NGio.logEvent('Fresh');
119+
// #end
120+
121+
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
122+
123+
curSelected += change;
124+
125+
if (curSelected < 0)
126+
curSelected = grpControls.length - 1;
127+
if (curSelected >= grpControls.length)
128+
curSelected = 0;
129+
130+
// selector.y = (70 * curSelected) + 30;
131+
132+
var bullShit:Int = 0;
133+
134+
for (item in grpControls.members)
135+
{
136+
item.targetY = bullShit - curSelected;
137+
bullShit++;
138+
139+
item.alpha = 0;
140+
// item.setGraphicSize(Std.int(item.width * 0.8));
141+
142+
if (item.targetY == 0)
143+
{
144+
item.alpha = 1;
145+
// item.setGraphicSize(Std.int(item.width));
146+
}
147+
if (item.targetY - 1 == 0 || item.targetY + 1 == 0) {
148+
item.alpha = 0.6;
149+
}
150+
}
151+
}
152+
}

source/OptionsMenu.hx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class OptionsMenu extends MusicBeatState
2222
private var grpControls:FlxTypedGroup<Alphabet>;
2323

2424
var optionsText:FlxText;
25+
var optionsDesc:FlxText;
2526

2627
override function create()
2728
{
@@ -35,10 +36,14 @@ class OptionsMenu extends MusicBeatState
3536
add(menuBG);
3637
optionsText = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
3738
optionsText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
39+
optionsDesc = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
40+
optionsDesc.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
3841
var optionsBG:FlxSprite = new FlxSprite(optionsText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.55), 80, 0xFF000000);
3942
optionsBG.alpha = 0.6;
4043
add(optionsBG);
4144
add(optionsText);
45+
add(optionsDesc);
46+
optionsDesc.screenCenter(XY);
4247

4348

4449
grpControls = new FlxTypedGroup<Alphabet>();
@@ -47,7 +52,7 @@ class OptionsMenu extends MusicBeatState
4752
{
4853
if (controlsStrings[i].indexOf('set') != -1)
4954
{
50-
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3), true, false);
55+
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3).split("||")[0], true, false);
5156
controlLabel.isMenuItem = true;
5257
controlLabel.targetY = i;
5358
grpControls.add(controlLabel);
@@ -114,15 +119,17 @@ class OptionsMenu extends MusicBeatState
114119
curSelected = 0;
115120

116121

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

126+
// selector.y = (70 * curSelected) + 30;
120127
var bullShit:Int = 0;
121128
for (item in grpControls.members)
122129
{
123130
item.targetY = bullShit - curSelected;
124131
bullShit++;
125-
132+
126133
item.alpha = 0.6;
127134
// item.setGraphicSize(Std.int(item.width * 0.8));
128135

0 commit comments

Comments
 (0)