forked from RyoleBg/PE-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTitleState.hx
771 lines (660 loc) · 22.1 KB
/
TitleState.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
package;
#if desktop
import Discord.DiscordClient;
import sys.thread.Thread;
#end
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.input.keyboard.FlxKey;
import flixel.addons.display.FlxGridOverlay;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.transition.TransitionData;
import flixel.addons.display.FlxBackdrop;
import haxe.Json;
import openfl.display.Bitmap;
import openfl.display.BitmapData;
#if MODS_ALLOWED
import sys.FileSystem;
import sys.io.File;
#end
import options.GraphicsSettingsSubState;
//import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxGroup;
import flixel.input.gamepad.FlxGamepad;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxSound;
import flixel.system.ui.FlxSoundTray;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import lime.app.Application;
import openfl.Assets;
using StringTools;
typedef TitleData =
{
titlex:Float,
titley:Float,
startx:Float,
starty:Float,
gfx:Float,
gfy:Float,
backgroundSprite:String,
bpm:Int
}
class TitleState extends MusicBeatState
{
public static var muteKeys:Array<FlxKey> = [FlxKey.ZERO];
public static var volumeDownKeys:Array<FlxKey> = [FlxKey.NUMPADMINUS, FlxKey.MINUS];
public static var volumeUpKeys:Array<FlxKey> = [FlxKey.NUMPADPLUS, FlxKey.PLUS];
public static var initialized:Bool = false;
var newLogo:FlxSprite;
var blackScreen:FlxSprite;
var credGroup:FlxGroup;
var credTextShit:Alphabet;
var textGroup:FlxGroup;
var ngSpr:FlxSprite;
var yt:FlxSprite;
var funky:FlxSprite;
var curWacky:Array<String> = [];
var bgScroll:FlxBackdrop;
var bg:FlxSprite;
var wackyImage:FlxSprite;
#if TITLE_SCREEN_EASTER_EGG
var easterEggKeys:Array<String> = [
'SHADOW', 'RIVER', 'SHUBS', 'BBPANZU'
];
var allowedKeys:String = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var easterEggKeysBuffer:String = '';
#end
var mustUpdate:Bool = false;
var titleJSON:TitleData;
public static var updateVersion:String = '';
override public function create():Void
{
Paths.clearStoredMemory();
Paths.clearUnusedMemory();
// Just to load a mod on start up if ya got one. For mods that change the menu music and bg
WeekData.loadTheFirstEnabledMod();
//trace(path, FileSystem.exists(path));
/*#if (polymod && !html5)
if (sys.FileSystem.exists('mods/')) {
var folders:Array<String> = [];
for (file in sys.FileSystem.readDirectory('mods/')) {
var path = haxe.io.Path.join(['mods/', file]);
if (sys.FileSystem.isDirectory(path)) {
folders.push(file);
}
}
if(folders.length > 0) {
polymod.Polymod.init({modRoot: "mods", dirs: folders});
}
}
#end*/
#if CHECK_FOR_UPDATES
if(!closedState) {
trace('checking for update');
var http = new haxe.Http("https://raw.githubusercontent.com/ShadowMario/FNF-PsychEngine/main/gitVersion.txt");
http.onData = function (data:String)
{
updateVersion = data.split('\n')[0].trim();
var curVersion:String = MainMenuState.psychEngineVersion.trim();
trace('version online: ' + updateVersion + ', your version: ' + curVersion);
if(updateVersion != curVersion) {
trace('versions arent matching!');
mustUpdate = true;
}
}
http.onError = function (error) {
trace('error: $error');
}
http.request();
}
#end
FlxG.game.focusLostFramerate = 60;
FlxG.sound.muteKeys = muteKeys;
FlxG.sound.volumeDownKeys = volumeDownKeys;
FlxG.sound.volumeUpKeys = volumeUpKeys;
FlxG.keys.preventDefaultKeys = [TAB];
PlayerSettings.init();
curWacky = FlxG.random.getObject(getIntroTextShit());
// DEBUG BULLSHIT
swagShader = new ColorSwap();
super.create();
FlxG.save.bind('funkin', 'ninjamuffin99');
ClientPrefs.loadPrefs();
Highscore.load();
// IGNORE THIS!!!
titleJSON = Json.parse(Paths.getTextFromFile('images/gfDanceTitle.json'));
#if TITLE_SCREEN_EASTER_EGG
if (FlxG.save.data.psychDevsEasterEgg == null) FlxG.save.data.psychDevsEasterEgg = ''; //Crash prevention
switch(FlxG.save.data.psychDevsEasterEgg.toUpperCase())
{
case 'SHADOW':
titleJSON.gfx += 210;
titleJSON.gfy += 40;
case 'RIVER':
titleJSON.gfx += 100;
titleJSON.gfy += 20;
case 'SHUBS':
titleJSON.gfx += 160;
titleJSON.gfy -= 10;
case 'BBPANZU':
titleJSON.gfx += 45;
titleJSON.gfy += 100;
}
#end
if(!initialized && FlxG.save.data != null && FlxG.save.data.fullscreen)
{
FlxG.fullscreen = FlxG.save.data.fullscreen;
//trace('LOADED FULLSCREEN SETTING!!');
}
if (FlxG.save.data.weekCompleted != null)
{
StoryMenuState.weekCompleted = FlxG.save.data.weekCompleted;
}
FlxG.mouse.visible = false;
#if FREEPLAY
MusicBeatState.switchState(new FreeplayState());
#elseif CHARTING
MusicBeatState.switchState(new ChartingState());
#else
if(FlxG.save.data.flashing == null && !FlashingState.leftState) {
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
MusicBeatState.switchState(new FlashingState());
} else {
#if desktop
if (!DiscordClient.isInitialized)
{
DiscordClient.initialize();
Application.current.onExit.add (function (exitCode) {
DiscordClient.shutdown();
});
}
#end
new FlxTimer().start(1, function(tmr:FlxTimer)
{
startIntro();
});
}
#end
}
var logoBl:FlxSprite;
var gfDance:FlxSprite;
var danceLeft:Bool = false;
var titleText:FlxSprite;
var swagShader:ColorSwap = null;
function startIntro()
{
if (!initialized)
{
/*var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
diamond.persist = true;
diamond.destroyOnNoUse = false;
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
new FlxRect(-300, -300, FlxG.width * 1.8, FlxG.height * 1.8));
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
{asset: diamond, width: 32, height: 32}, new FlxRect(-300, -300, FlxG.width * 1.8, FlxG.height * 1.8));
transIn = FlxTransitionableState.defaultTransIn;
transOut = FlxTransitionableState.defaultTransOut;*/
// HAD TO MODIFY SOME BACKEND SHIT
// IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO
// https://github.com/HaxeFlixel/flixel-addons/pull/348
// var music:FlxSound = new FlxSound();
// music.loadStream(Paths.music('freakyMenu'));
// FlxG.sound.list.add(music);
// music.play();
if(FlxG.sound.music == null) {
FlxG.sound.playMusic(Paths.music('lecoolasssong'), 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
}
}
Conductor.changeBPM(titleJSON.bpm);
persistentUpdate = true;
var bg:FlxSprite = new FlxSprite();
if (titleJSON.backgroundSprite != null && titleJSON.backgroundSprite.length > 0 && titleJSON.backgroundSprite != "none"){
bg.loadGraphic(Paths.image(titleJSON.backgroundSprite));
}else{
bg.makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
}
// bg.antialiasing = ClientPrefs.globalAntialiasing;
// bg.setGraphicSize(Std.int(bg.width * 0.6));
// bg.updateHitbox();
add(bg);
logoBl = new FlxSprite(titleJSON.titlex, titleJSON.titley);
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
logoBl.antialiasing = ClientPrefs.globalAntialiasing;
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24, false);
logoBl.animation.play('bump');
logoBl.updateHitbox();
logoBl.screenCenter();
logoBl.visible = false;
// logoBl.color = FlxColor.BLACK;
swagShader = new ColorSwap();
gfDance = new FlxSprite(titleJSON.gfx, titleJSON.gfy);
gfDance.visible = false;
var easterEgg:String = FlxG.save.data.psychDevsEasterEgg;
switch(easterEgg.toUpperCase())
{
#if TITLE_SCREEN_EASTER_EGG
case 'SHADOW':
gfDance.frames = Paths.getSparrowAtlas('ShadowBump');
gfDance.animation.addByPrefix('danceLeft', 'Shadow Title Bump', 24);
gfDance.animation.addByPrefix('danceRight', 'Shadow Title Bump', 24);
case 'RIVER':
gfDance.frames = Paths.getSparrowAtlas('RiverBump');
gfDance.animation.addByIndices('danceLeft', 'River Title Bump', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
gfDance.animation.addByIndices('danceRight', 'River Title Bump', [29, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
case 'SHUBS':
gfDance.frames = Paths.getSparrowAtlas('ShubBump');
gfDance.animation.addByPrefix('danceLeft', 'Shub Title Bump', 24, false);
gfDance.animation.addByPrefix('danceRight', 'Shub Title Bump', 24, false);
case 'BBPANZU':
gfDance.frames = Paths.getSparrowAtlas('BBBump');
gfDance.animation.addByIndices('danceLeft', 'BB Title Bump', [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27], "", 24, false);
gfDance.animation.addByIndices('danceRight', 'BB Title Bump', [27, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], "", 24, false);
#end
default:
//EDIT THIS ONE IF YOU'RE MAKING A SOURCE CODE MOD!!!!
//EDIT THIS ONE IF YOU'RE MAKING A SOURCE CODE MOD!!!!
//EDIT THIS ONE IF YOU'RE MAKING A SOURCE CODE MOD!!!!
gfDance.frames = Paths.getSparrowAtlas('gfDanceTitle');
gfDance.animation.addByIndices('danceLeft', 'gfDance', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
}
gfDance.antialiasing = ClientPrefs.globalAntialiasing;
bg = new FlxSprite().loadGraphic(Paths.image('titleMenu/leTitleBG'));
bg.setGraphicSize(Std.int(bg.width * 1.1)); //replace the leTitleBG with your image
bg.screenCenter(); //my image isnt big enough so i gotta make it bigger if yours is enough then dont make that
bg.antialiasing = ClientPrefs.globalAntialiasing;
newLogo = new FlxSprite().loadGraphic(Paths.image('titleMenu/logoNew'));
newLogo.screenCenter(); //chnage the logoNew to you'r image
newLogo.offset.y += 60; //my logo needs a lil offset if your's is perfectly fine don't add this
newLogo.antialiasing = ClientPrefs.globalAntialiasing;
add(bg);
add(newLogo);
add(gfDance);
gfDance.shader = swagShader.shader;
add(logoBl);
logoBl.shader = swagShader.shader;
titleText = new FlxSprite(titleJSON.startx, titleJSON.starty);
#if (desktop && MODS_ALLOWED)
var path = "mods/" + Paths.currentModDirectory + "/images/titleEnter.png";
//trace(path, FileSystem.exists(path));
if (!FileSystem.exists(path)){
path = "mods/images/titleEnter.png";
}
//trace(path, FileSystem.exists(path));
if (!FileSystem.exists(path)){
path = "assets/images/titleEnter.png";
}
//trace(path, FileSystem.exists(path));
titleText.frames = FlxAtlasFrames.fromSparrow(BitmapData.fromFile(path),File.getContent(StringTools.replace(path,".png",".xml")));
#else
titleText.frames = Paths.getSparrowAtlas('titleEnter');
#end
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
titleText.antialiasing = ClientPrefs.globalAntialiasing;
titleText.animation.play('idle');
titleText.updateHitbox();
// titleText.screenCenter(X);
add(titleText);
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
logo.screenCenter();
logo.antialiasing = ClientPrefs.globalAntialiasing;
// add(logo);
// FlxTween.tween(logoBl, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG});
// FlxTween.tween(logo, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG, startDelay: 0.1});
credGroup = new FlxGroup();
add(credGroup);
textGroup = new FlxGroup();
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
credGroup.add(blackScreen);
bgScroll = new FlxBackdrop(Paths.image('titleMenu/titleSCROLL'), 0, 0, true, false);
bgScroll.velocity.set(100, 0); //change the titleSCROLL to the image you want to use
bgScroll.screenCenter(); //also set the speed as fast or slow as you want, just don't modify the 0
bgScroll.setGraphicSize(Std.int(bgScroll.width * 1.1));
bgScroll.antialiasing = ClientPrefs.globalAntialiasing;
credGroup.add(bgScroll); //the size is optional my image needs to be bigger if your's not then don't do so
credTextShit = new Alphabet(0, 0, "", true);
credTextShit.screenCenter();
// credTextShit.alignment = CENTER;
credTextShit.visible = false;
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('newgrounds_logo'));
add(ngSpr);
ngSpr.visible = false;
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
ngSpr.updateHitbox();
ngSpr.screenCenter(X);
ngSpr.antialiasing = ClientPrefs.globalAntialiasing;
yt = new FlxSprite().loadGraphic(Paths.image('titleMenu/ytLogo'));
yt.screenCenter(); //change the ytLogo to you'r image
yt.setGraphicSize(Std.int(yt.width * 0.25));
yt.visible = false;
yt.offset.y -= 115;
yt.offset.x -= 20; //change the offsets according to YOU'R image
yt.antialiasing = ClientPrefs.globalAntialiasing;
add(yt); // if you have only 1 sprite replacing the newgrounds one then just copy one of these and modify it
funky = new FlxSprite().loadGraphic(Paths.image('titleMenu/Funky'));
funky.visible = false;
funky.screenCenter();
funky.setGraphicSize(Std.int(funky.width * 0.7));
funky.offset.y -= 270;
funky.antialiasing = ClientPrefs.globalAntialiasing;
add(funky); //basically i have 2 sprites instead of newgrounds one
FlxTween.tween(credTextShit, {y: credTextShit.y + 20}, 2.9, {ease: FlxEase.quadInOut, type: PINGPONG});
if (initialized)
skipIntro();
else
initialized = true;
// credGroup.add(credTextShit);
}
function getIntroTextShit():Array<Array<String>>
{
var fullText:String = Assets.getText(Paths.txt('introText'));
var firstArray:Array<String> = fullText.split('\n');
var swagGoodArray:Array<Array<String>> = [];
for (i in firstArray)
{
swagGoodArray.push(i.split('--'));
}
return swagGoodArray;
}
var transitioning:Bool = false;
private static var playJingle:Bool = false;
override function update(elapsed:Float)
{
if (FlxG.sound.music != null)
Conductor.songPosition = FlxG.sound.music.time;
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER || controls.ACCEPT;
#if mobile
for (touch in FlxG.touches.list)
{
if (touch.justPressed)
{
pressedEnter = true;
}
}
#end
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
if (gamepad != null)
{
if (gamepad.justPressed.START)
pressedEnter = true;
#if switch
if (gamepad.justPressed.B)
pressedEnter = true;
#end
}
// EASTER EGG
if (initialized && !transitioning && skippedIntro)
{
if(pressedEnter)
{
if(titleText != null) titleText.animation.play('press');
FlxG.camera.flash(FlxColor.WHITE, 1);
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
transitioning = true;
// FlxG.sound.music.stop();
new FlxTimer().start(1, function(tmr:FlxTimer)
{
if (mustUpdate) {
MusicBeatState.switchState(new OutdatedState());
} else {
MusicBeatState.switchState(new MainMenuState());
}
closedState = true;
});
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
}
#if TITLE_SCREEN_EASTER_EGG
else if (FlxG.keys.firstJustPressed() != FlxKey.NONE)
{
var keyPressed:FlxKey = FlxG.keys.firstJustPressed();
var keyName:String = Std.string(keyPressed);
if(allowedKeys.contains(keyName)) {
easterEggKeysBuffer += keyName;
if(easterEggKeysBuffer.length >= 32) easterEggKeysBuffer = easterEggKeysBuffer.substring(1);
//trace('Test! Allowed Key pressed!!! Buffer: ' + easterEggKeysBuffer);
for (wordRaw in easterEggKeys)
{
var word:String = wordRaw.toUpperCase(); //just for being sure you're doing it right
if (easterEggKeysBuffer.contains(word))
{
//trace('YOOO! ' + word);
if (FlxG.save.data.psychDevsEasterEgg == word)
FlxG.save.data.psychDevsEasterEgg = '';
else
FlxG.save.data.psychDevsEasterEgg = word;
FlxG.save.flush();
FlxG.sound.play(Paths.sound('ToggleJingle'));
var black:FlxSprite = new FlxSprite(0, 0).makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
black.alpha = 0;
add(black);
FlxTween.tween(black, {alpha: 1}, 1, {onComplete:
function(twn:FlxTween) {
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
MusicBeatState.switchState(new TitleState());
}
});
FlxG.sound.music.fadeOut();
closedState = true;
transitioning = true;
playJingle = true;
easterEggKeysBuffer = '';
break;
}
}
}
}
#end
}
if (initialized && pressedEnter && !skippedIntro)
{
skipIntro();
}
if(swagShader != null)
{
if(controls.UI_LEFT) swagShader.hue -= elapsed * 0.1;
if(controls.UI_RIGHT) swagShader.hue += elapsed * 0.1;
}
super.update(elapsed);
}
function createCoolText(textArray:Array<String>, ?offset:Float = 0)
{
for (i in 0...textArray.length)
{
var money:Alphabet = new Alphabet(0, 0, textArray[i], true, false);
money.screenCenter(X);
money.y += (i * 60) + 200 + offset;
if(credGroup != null && textGroup != null) {
credGroup.add(money);
textGroup.add(money);
}
}
}
function addMoreText(text:String, ?offset:Float = 0)
{
if(textGroup != null && credGroup != null) {
var coolText:Alphabet = new Alphabet(0, 0, text, true, false);
coolText.screenCenter(X);
coolText.y += (textGroup.length * 60) + 200 + offset;
credGroup.add(coolText);
textGroup.add(coolText);
}
}
function deleteCoolText()
{
while (textGroup.members.length > 0)
{
credGroup.remove(textGroup.members[0], true);
textGroup.remove(textGroup.members[0], true);
}
}
private var sickBeats:Int = 0; //Basically curBeat but won't be skipped if you hold the tab or resize the screen
public static var closedState:Bool = false;
override function beatHit()
{
super.beatHit();
FlxTween.tween(FlxG.camera, {zoom:1.03}, 0.3, {ease: FlxEase.quadOut, type: BACKWARD});
if(logoBl != null)
logoBl.animation.play('bump', true);
if(gfDance != null) {
danceLeft = !danceLeft;
if (danceLeft)
gfDance.animation.play('danceRight');
else
gfDance.animation.play('danceLeft');
}
if(!closedState) {
sickBeats++;
switch (sickBeats)
{
case 1:
#if PSYCH_WATERMARKS
createCoolText(['Tutorial Made By'], 15);
#else
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
#end
// credTextShit.visible = true;
case 3:
#if PSYCH_WATERMARKS
addMoreText('EIT', 15);
#else
addMoreText('present');
#end
// credTextShit.text += '\npresent...';
// credTextShit.addText();
case 4:
deleteCoolText();
// credTextShit.visible = false;
// credTextShit.text = 'In association \nwith';
// credTextShit.screenCenter();
case 5:
#if PSYCH_WATERMARKS
createCoolText(['Remember', 'To'], -40);
#else
createCoolText(['In association', 'with'], -40);
#end
case 7:
addMoreText('Subscribe', -40);
yt.visible = true;
funky.visible = true;
// credTextShit.text += '\nNewgrounds';
case 8:
deleteCoolText();
yt.visible = false;
funky.visible = false;
// credTextShit.visible = false;
// credTextShit.text = 'Shoutouts Tom Fulp';
// credTextShit.screenCenter();
case 9:
createCoolText([curWacky[0]]);
// credTextShit.visible = true;
case 11:
addMoreText(curWacky[1]);
// credTextShit.text += '\nlmao';
case 12:
deleteCoolText();
// credTextShit.visible = false;
// credTextShit.text = "Friday";
// credTextShit.screenCenter();
case 13:
addMoreText('Friday');
// credTextShit.visible = true;
case 14:
addMoreText('Night');
// credTextShit.text += '\nNight';
case 15:
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
case 16:
addMoreText('Tutorials');
case 17:
skipIntro();
}
}
}
var skippedIntro:Bool = false;
var increaseVolume:Bool = false;
function skipIntro():Void
{
if (!skippedIntro)
{
if (playJingle) //Ignore deez
{
var easteregg:String = FlxG.save.data.psychDevsEasterEgg;
if (easteregg == null) easteregg = '';
easteregg = easteregg.toUpperCase();
var sound:FlxSound = null;
switch(easteregg)
{
case 'RIVER':
sound = FlxG.sound.play(Paths.sound('JingleRiver'));
case 'SHUBS':
sound = FlxG.sound.play(Paths.sound('JingleShubs'));
case 'SHADOW':
FlxG.sound.play(Paths.sound('JingleShadow'));
case 'BBPANZU':
sound = FlxG.sound.play(Paths.sound('JingleBB'));
default: //Go back to normal ugly ass boring GF
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 2);
skippedIntro = true;
playJingle = false;
FlxG.sound.playMusic(Paths.music('lecoolasssong'), 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
return;
}
transitioning = true;
if(easteregg == 'SHADOW')
{
new FlxTimer().start(3.2, function(tmr:FlxTimer)
{
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 0.6);
transitioning = false;
});
}
else
{
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 3);
sound.onComplete = function() {
FlxG.sound.playMusic(Paths.music('lecoolasssong'), 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
transitioning = false;
};
}
playJingle = false;
}
else //Default! Edit this one!!
{
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 4);
var easteregg:String = FlxG.save.data.psychDevsEasterEgg;
if (easteregg == null) easteregg = '';
easteregg = easteregg.toUpperCase();
#if TITLE_SCREEN_EASTER_EGG
if(easteregg == 'SHADOW')
{
FlxG.sound.music.fadeOut();
}
#end
}
skippedIntro = true;
}
}
}