Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
LilDrippyMyFnf
GitHub Repository: LilDrippyMyFnf/FNF-BitEnigne
Path: blob/master/compressed/CompressedState.cpp
939 views
1
class state {
2
trace("Welcome to Bit Engine ALT");
3
trace("press enter",'enter');
4
ifkeypressed('enter');
5
fetch('menuALT.cpp');
6
class ALT {
7
trace('this is a ALT of the main menu,to return,press 7','7');
8
trace('you got here by pressing 9 on the main menu screen');
9
}
10
ifkeypressed('7');
11
fetch('mainmenu');
12
ifkeypressed('down');
13
fetch('freeplayALT.cpp');
14
class ALT {
15
trace('this is a ALT of the freeplay screen,to return,press 7','7');
16
trace('you got here by pressing 9 on the freeplay screen');
17
}
18
ifkeypressed('7');
19
fetch('freeplay');
20
ifkeypressed('down');
21
fetch('creditsALT.cpp');
22
class ALT {
23
trace('this is a ALT of the credits screen,to return,press 7','7');
24
trace('you got here by pressing 9 on the credits screen');
25
}
26
ifkeypressed('7');
27
fetch('credits');
28
class reset {
29
trace('outdated,go to echo engine to find new updates','enter','backspace')
30
}
31
ifkeypressed('enter');
32
fetch('https://github.com/LilDrippyMyFnf/Fnf-EchoEngine/releases/tag/0.1.0');
33
ifkeypressed('backspace');
34
fetch('storymodemenu');
35
package;
36
37
#if desktop
38
import Discord.DiscordClient;
39
#end
40
import flash.text.TextField;
41
import flixel.FlxG;
42
import flixel.FlxSprite;
43
import flixel.addons.display.FlxGridOverlay;
44
import flixel.group.FlxGroup.FlxTypedGroup;
45
import flixel.math.FlxMath;
46
import flixel.text.FlxText;
47
import flixel.util.FlxColor;
48
import flixel.tweens.FlxTween;
49
import flixel.tweens.FlxEase;
50
#if MODS_ALLOWED
51
import sys.FileSystem;
52
import sys.io.File;
53
#end
54
import lime.utils.Assets;
55
56
using StringTools;
57
58
class CreditsState extends MusicBeatState
59
{
60
var curSelected:Int = -1;
61
62
private var grpOptions:FlxTypedGroup<Alphabet>;
63
private var iconArray:Array<AttachedSprite> = [];
64
private var creditsStuff:Array<Array<String>> = [];
65
66
var bg:FlxSprite;
67
var descText:FlxText;
68
var intendedColor:Int;
69
var colorTween:FlxTween;
70
var descBox:AttachedSprite;
71
72
var offsetThing:Float = -75;
73
74
override function create()
75
{
76
#if desktop
77
// Updating Discord Rich Presence
78
DiscordClient.changePresence("In the Menus", null);
79
#end
80
81
persistentUpdate = true;
82
bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
83
add(bg);
84
bg.screenCenter();
85
86
grpOptions = new FlxTypedGroup<Alphabet>();
87
add(grpOptions);
88
89
#if MODS_ALLOWED
90
var path:String = 'modsList.txt';
91
if(FileSystem.exists(path))
92
{
93
var leMods:Array<String> = CoolUtil.coolTextFile(path);
94
for (i in 0...leMods.length)
95
{
96
if(leMods.length > 1 && leMods[0].length > 0) {
97
var modSplit:Array<String> = leMods[i].split('|');
98
if(!Paths.ignoreModFolders.contains(modSplit[0].toLowerCase()) && !modsAdded.contains(modSplit[0]))
99
{
100
if(modSplit[1] == '1')
101
pushModCreditsToList(modSplit[0]);
102
else
103
modsAdded.push(modSplit[0]);
104
}
105
}
106
}
107
}
108
109
var arrayOfFolders:Array<String> = Paths.getModDirectories();
110
arrayOfFolders.push('');
111
for (folder in arrayOfFolders)
112
{
113
pushModCreditsToList(folder);
114
}
115
#end
116
117
var pisspoop:Array<Array<String>> = [ //Name - Icon name - Description - Link - BG Color
118
['Bit Engine Team'],
119
['MyFnf', 'my', 'Main Programmer of Bit Engine', 'https://twitter.com/goofyahhemoboi', '429E9D'],
120
['MasterOak', 'oak', 'Bug Handler', 'https://github.com/MasterOak', '3E813A'],
121
['Stefan[BETA]2008', '2008', 'Android porter', 'https://github.com/StefanBETA2008', 'B42F71'],
122
['MemeHoovy', 'meme', 'Compile helper', 'https://github.com/MemeHoovy', '5E99DF'],
123
['Engine Contributors'],
124
['ArtableBOX', 'box', 'lua programmer', 'https://github.com/ArtableBOX', 'FFFFFF'
125
['WarlyFarly_GitHub!', 'hub', 'a lil member', 'https://github.com/WarlyFarly_GitHub!', '3E813A'],
126
['MMbay64', '64', 'headache', 'https://github.com/MMbay64', 'FFFFFF'],
127
[''],
128
['Engine Contributors'],
129
['iFlicky', 'flicky', 'Composer of Psync and Tea Time\nMade the Dialogue Sounds', 'https://twitter.com/flicky_i', '9E29CF'],
130
['SqirraRNG', 'sqirra', 'Crash Handler and Base code for\nChart Editor\'s Waveform', 'https://twitter.com/gedehari', 'E1843A'],
131
['PolybiusProxy', 'proxy', '.MP4 Video Loader Library (hxCodec)', 'https://twitter.com/polybiusproxy', 'DCD294'],
132
['KadeDev', 'kade', 'Fixed some cool stuff on Chart Editor\nand other PRs', 'https://twitter.com/kade0912', '64A250'],
133
['Keoiki', 'keoiki', 'Note Splash Animations', 'https://twitter.com/Keoiki_', 'D2D2D2'],
134
['Nebula the Zorua', 'nebula', 'LUA JIT Fork and some Lua reworks', 'https://twitter.com/Nebula_Zorua', '7D40B2'],
135
['Smokey', 'smokey', 'Sprite Atlas Support', 'https://twitter.com/Smokey_5_', '483D92'],
136
[''],
137
["Funkin' Crew"],
138
['ninjamuffin99', 'ninjamuffin99', "Programmer of Friday Night Funkin'", 'https://twitter.com/ninja_muffin99', 'CF2D2D'],
139
['PhantomArcade', 'phantomarcade', "Animator of Friday Night Funkin'", 'https://twitter.com/PhantomArcade3K', 'FADC45'],
140
['evilsk8r', 'evilsk8r', "Artist of Friday Night Funkin'", 'https://twitter.com/evilsk8r', '5ABD4B'],
141
['kawaisprite', 'kawaisprite', "Composer of Friday Night Funkin'", 'https://twitter.com/kawaisprite', '378FC7'],
142
];
143
144
for(i in pisspoop){
145
creditsStuff.push(i);
146
}
147
148
for (i in 0...creditsStuff.length)
149
{
150
var isSelectable:Bool = !unselectableCheck(i);
151
var optionText:Alphabet = new Alphabet(0, 70 * i, creditsStuff[i][0], !isSelectable, false);
152
optionText.isMenuItem = true;
153
optionText.screenCenter(X);
154
optionText.yAdd -= 70;
155
if(isSelectable) {
156
optionText.x -= 70;
157
}
158
optionText.forceX = optionText.x;
159
//optionText.yMult = 90;
160
optionText.targetY = i;
161
grpOptions.add(optionText);
162
163
if(isSelectable) {
164
if(creditsStuff[i][5] != null)
165
{
166
Paths.currentModDirectory = creditsStuff[i][5];
167
}
168
169
var icon:AttachedSprite = new AttachedSprite('credits/' + creditsStuff[i][1]);
170
icon.xAdd = optionText.width + 10;
171
icon.sprTracker = optionText;
172
173
// using a FlxGroup is too much fuss!
174
iconArray.push(icon);
175
add(icon);
176
Paths.currentModDirectory = '';
177
178
if(curSelected == -1) curSelected = i;
179
}
180
}
181
182
descBox = new AttachedSprite();
183
descBox.makeGraphic(1, 1, FlxColor.BLACK);
184
descBox.xAdd = -10;
185
descBox.yAdd = -10;
186
descBox.alphaMult = 0.6;
187
descBox.alpha = 0.6;
188
add(descBox);
189
190
descText = new FlxText(50, FlxG.height + offsetThing - 25, 1180, "", 32);
191
descText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER/*, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK*/);
192
descText.scrollFactor.set();
193
//descText.borderSize = 2.4;
194
descBox.sprTracker = descText;
195
add(descText);
196
197
bg.color = getCurrentBGColor();
198
intendedColor = bg.color;
199
changeSelection();
200
super.create();
201
}
202
203
var quitting:Bool = false;
204
var holdTime:Float = 0;
205
override function update(elapsed:Float)
206
{
207
if (FlxG.sound.music.volume < 0.7)
208
{
209
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
210
}
211
212
if(!quitting)
213
{
214
if(creditsStuff.length > 1)
215
{
216
var shiftMult:Int = 1;
217
if(FlxG.keys.pressed.SHIFT) shiftMult = 3;
218
219
var upP = controls.UI_UP_P;
220
var downP = controls.UI_DOWN_P;
221
222
if (upP)
223
{
224
changeSelection(-1 * shiftMult);
225
holdTime = 0;
226
}
227
if (downP)
228
{
229
changeSelection(1 * shiftMult);
230
holdTime = 0;
231
}
232
233
if(controls.UI_DOWN || controls.UI_UP)
234
{
235
var checkLastHold:Int = Math.floor((holdTime - 0.5) * 10);
236
holdTime += elapsed;
237
var checkNewHold:Int = Math.floor((holdTime - 0.5) * 10);
238
239
if(holdTime > 0.5 && checkNewHold - checkLastHold > 0)
240
{
241
changeSelection((checkNewHold - checkLastHold) * (controls.UI_UP ? -shiftMult : shiftMult));
242
}
243
}
244
}
245
246
if(controls.ACCEPT && (creditsStuff[curSelected][3] == null || creditsStuff[curSelected][3].length > 4)) {
247
CoolUtil.browserLoad(creditsStuff[curSelected][3]);
248
}
249
if (controls.BACK)
250
{
251
if(colorTween != null) {
252
colorTween.cancel();
253
}
254
FlxG.sound.play(Paths.sound('cancelMenu'));
255
MusicBeatState.switchState(new MainMenuState());
256
quitting = true;
257
}
258
}
259
260
for (item in grpOptions.members)
261
{
262
if(!item.isBold)
263
{
264
var lerpVal:Float = CoolUtil.boundTo(elapsed * 12, 0, 1);
265
if(item.targetY == 0)
266
{
267
var lastX:Float = item.x;
268
item.screenCenter(X);
269
item.x = FlxMath.lerp(lastX, item.x - 70, lerpVal);
270
item.forceX = item.x;
271
}
272
else
273
{
274
item.x = FlxMath.lerp(item.x, 200 + -40 * Math.abs(item.targetY), lerpVal);
275
item.forceX = item.x;
276
}
277
}
278
}
279
super.update(elapsed);
280
}
281
282
var moveTween:FlxTween = null;
283
function changeSelection(change:Int = 0)
284
{
285
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
286
do {
287
curSelected += change;
288
if (curSelected < 0)
289
curSelected = creditsStuff.length - 1;
290
if (curSelected >= creditsStuff.length)
291
curSelected = 0;
292
} while(unselectableCheck(curSelected));
293
294
var newColor:Int = getCurrentBGColor();
295
if(newColor != intendedColor) {
296
if(colorTween != null) {
297
colorTween.cancel();
298
}
299
intendedColor = newColor;
300
colorTween = FlxTween.color(bg, 1, bg.color, intendedColor, {
301
onComplete: function(twn:FlxTween) {
302
colorTween = null;
303
}
304
});
305
}
306
307
var bullShit:Int = 0;
308
309
for (item in grpOptions.members)
310
{
311
item.targetY = bullShit - curSelected;
312
bullShit++;
313
314
if(!unselectableCheck(bullShit-1)) {
315
item.alpha = 0.6;
316
if (item.targetY == 0) {
317
item.alpha = 1;
318
}
319
}
320
}
321
322
descText.text = creditsStuff[curSelected][2];
323
descText.y = FlxG.height - descText.height + offsetThing - 60;
324
325
if(moveTween != null) moveTween.cancel();
326
moveTween = FlxTween.tween(descText, {y : descText.y + 75}, 0.25, {ease: FlxEase.sineOut});
327
328
descBox.setGraphicSize(Std.int(descText.width + 20), Std.int(descText.height + 25));
329
descBox.updateHitbox();
330
}
331
332
#if MODS_ALLOWED
333
private var modsAdded:Array<String> = [];
334
function pushModCreditsToList(folder:String)
335
{
336
if(modsAdded.contains(folder)) return;
337
338
var creditsFile:String = null;
339
if(folder != null && folder.trim().length > 0) creditsFile = Paths.mods(folder + '/data/credits.txt');
340
else creditsFile = Paths.mods('data/credits.txt');
341
342
if (FileSystem.exists(creditsFile))
343
{
344
var firstarray:Array<String> = File.getContent(creditsFile).split('\n');
345
for(i in firstarray)
346
{
347
var arr:Array<String> = i.replace('\\n', '\n').split("::");
348
if(arr.length >= 5) arr.push(folder);
349
creditsStuff.push(arr);
350
}
351
creditsStuff.push(['']);
352
}
353
modsAdded.push(folder);
354
}
355
#end
356
357
function getCurrentBGColor() {
358
var bgColor:String = creditsStuff[curSelected][4];
359
if(!bgColor.startsWith('0x')) {
360
bgColor = '0xFF' + bgColor;
361
}
362
return Std.parseInt(bgColor);
363
}
364
365
private function unselectableCheck(num:Int):Bool {
366
return creditsStuff[num].length <= 1;
367
}
368
}
369
370
//had to fix something shit-like
371
package;
372
373
#if desktop
374
import Discord.DiscordClient;
375
#end
376
import flash.text.TextField;
377
import flixel.FlxG;
378
import flixel.FlxSprite;
379
import flixel.addons.display.FlxGridOverlay;
380
import flixel.group.FlxGroup.FlxTypedGroup;
381
import flixel.math.FlxMath;
382
import flixel.text.FlxText;
383
import flixel.util.FlxColor;
384
import lime.utils.Assets;
385
386
using StringTools;
387
388
class FreeplayState extends MusicBeatState
389
{
390
var songs:Array<SongMetadata> = [];
391
392
var selector:FlxText;
393
var curSelected:Int = 0;
394
var curDifficulty:Int = 1;
395
396
var scoreText:FlxText;
397
var diffText:FlxText;
398
var lerpScore:Int = 0;
399
var intendedScore:Int = 0;
400
401
private var grpSongs:FlxTypedGroup<Alphabet>;
402
private var curPlaying:Bool = false;
403
404
private var iconArray:Array<HealthIcon> = [];
405
406
override function create()
407
{
408
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
409
410
for (i in 0...initSonglist.length)
411
{
412
songs.push(new SongMetadata(initSonglist[i], 1, 'gf'));
413
}
414
415
/*
416
if (FlxG.sound.music != null)
417
{
418
if (!FlxG.sound.music.playing)
419
FlxG.sound.playMusic(Paths.music('freakyMenu'));
420
}
421
*/
422
423
#if desktop
424
// Updating Discord Rich Presence
425
DiscordClient.changePresence("In the Menus", null);
426
#end
427
428
var isDebug:Bool = false;
429
430
#if debug
431
isDebug = true;
432
#end
433
434
if (StoryMenuState.weekUnlocked[2] || isDebug)
435
addWeek(['StuckBeenDust'], 1, ['bf']);
436
437
if (StoryMenuState.weekUnlocked[2] || isDebug)
438
addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky']);
439
440
if (StoryMenuState.weekUnlocked[3] || isDebug)
441
addWeek(['Pico', 'Philly', 'Blammed'], 3, ['pico']);
442
443
if (StoryMenuState.weekUnlocked[4] || isDebug)
444
addWeek(['Satin-Panties', 'High', 'Milf'], 4, ['mom']);
445
446
if (StoryMenuState.weekUnlocked[5] || isDebug)
447
addWeek(['Cocoa', 'Eggnog', 'Winter-Horrorland'], 5, ['parents-christmas', 'parents-christmas', 'monster-christmas']);
448
449
if (StoryMenuState.weekUnlocked[6] || isDebug)
450
addWeek(['Senpai', 'Roses', 'Thorns'], 6, ['senpai', 'senpai', 'spirit']);
451
452
// LOAD MUSIC
453
454
// LOAD CHARACTERS
455
456
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuBGBlue'));
457
add(bg);
458
459
grpSongs = new FlxTypedGroup<Alphabet>();
460
add(grpSongs);
461
462
for (i in 0...songs.length)
463
{
464
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i].songName, true, false);
465
songText.isMenuItem = true;
466
songText.targetY = i;
467
grpSongs.add(songText);
468
469
var icon:HealthIcon = new HealthIcon(songs[i].songCharacter);
470
icon.sprTracker = songText;
471
472
// using a FlxGroup is too much fuss!
473
iconArray.push(icon);
474
add(icon);
475
476
// songText.x += 40;
477
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
478
// songText.screenCenter(X);
479
}
480
481
scoreText = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
482
// scoreText.autoSize = false;
483
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
484
// scoreText.alignment = RIGHT;
485
486
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
487
scoreBG.alpha = 0.6;
488
add(scoreBG);
489
490
diffText = new FlxText(scoreText.x, scoreText.y + 36, 0, "", 24);
491
diffText.font = scoreText.font;
492
add(diffText);
493
494
add(scoreText);
495
496
changeSelection();
497
changeDiff();
498
499
// FlxG.sound.playMusic(Paths.music('title'), 0);
500
// FlxG.sound.music.fadeIn(2, 0, 0.8);
501
selector = new FlxText();
502
503
selector.size = 40;
504
selector.text = ">";
505
// add(selector);
506
507
var swag:Alphabet = new Alphabet(1, 0, "swag");
508
509
// JUST DOIN THIS SHIT FOR TESTING!!!
510
/*
511
var md:String = Markdown.markdownToHtml(Assets.getText('CHANGELOG.md'));
512
513
var texFel:TextField = new TextField();
514
texFel.width = FlxG.width;
515
texFel.height = FlxG.height;
516
// texFel.
517
texFel.htmlText = md;
518
519
FlxG.stage.addChild(texFel);
520
521
// scoreText.textField.htmlText = md;
522
523
trace(md);
524
*/
525
526
super.create();
527
}
528
529
public function addSong(songName:String, weekNum:Int, songCharacter:String)
530
{
531
songs.push(new SongMetadata(songName, weekNum, songCharacter));
532
}
533
534
public function addWeek(songs:Array<String>, weekNum:Int, ?songCharacters:Array<String>)
535
{
536
if (songCharacters == null)
537
songCharacters = ['bf'];
538
539
var num:Int = 0;
540
for (song in songs)
541
{
542
addSong(song, weekNum, songCharacters[num]);
543
544
if (songCharacters.length != 1)
545
num++;
546
}
547
}
548
549
override function update(elapsed:Float)
550
{
551
super.update(elapsed);
552
553
if (FlxG.sound.music.volume < 0.7)
554
{
555
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
556
}
557
558
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4));
559
560
if (Math.abs(lerpScore - intendedScore) <= 10)
561
lerpScore = intendedScore;
562
563
scoreText.text = "PERSONAL BEST:" + lerpScore;
564
565
var upP = controls.UP_P;
566
var downP = controls.DOWN_P;
567
var accepted = controls.ACCEPT;
568
569
if (upP)
570
{
571
changeSelection(-1);
572
}
573
if (downP)
574
{
575
changeSelection(1);
576
}
577
578
if (controls.LEFT_P)
579
changeDiff(-1);
580
if (controls.RIGHT_P)
581
changeDiff(1);
582
583
if (controls.BACK)
584
{
585
FlxG.switchState(new MainMenuState());
586
}
587
588
if (accepted)
589
{
590
var poop:String = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), curDifficulty);
591
592
trace(poop);
593
594
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase());
595
PlayState.isStoryMode = false;
596
PlayState.storyDifficulty = curDifficulty;
597
598
PlayState.storyWeek = songs[curSelected].week;
599
trace('CUR WEEK' + PlayState.storyWeek);
600
LoadingState.loadAndSwitchState(new PlayState());
601
}
602
}
603
604
function changeDiff(change:Int = 0)
605
{
606
curDifficulty += change;
607
608
if (curDifficulty < 0)
609
curDifficulty = 2;
610
if (curDifficulty > 2)
611
curDifficulty = 0;
612
613
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
614
615
switch (curDifficulty)
616
{
617
case 0:
618
diffText.text = "EASY";
619
case 1:
620
diffText.text = 'NORMAL';
621
case 2:
622
diffText.text = "HARD";
623
case 3:
624
difftext.text = "ENCORE";
625
}
626
}
627
628
function changeSelection(change:Int = 0)
629
{
630
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
631
632
curSelected += change;
633
634
if (curSelected < 0)
635
curSelected = songs.length - 1;
636
if (curSelected >= songs.length)
637
curSelected = 0;
638
639
// selector.y = (70 * curSelected) + 30;
640
641
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
642
643
#if PRELOAD_ALL
644
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
645
#end
646
647
var bullShit:Int = 0;
648
649
for (i in 0...iconArray.length)
650
{
651
iconArray[i].alpha = 0.6;
652
}
653
654
iconArray[curSelected].alpha = 1;
655
656
for (item in grpSongs.members)
657
{
658
item.targetY = bullShit - curSelected;
659
bullShit++;
660
661
item.alpha = 0.6;
662
// item.setGraphicSize(Std.int(item.width * 0.8));
663
664
if (item.targetY == 0)
665
{
666
item.alpha = 1;
667
// item.setGraphicSize(Std.int(item.width));
668
}
669
}
670
}
671
}
672
673
class SongMetadata
674
{
675
public var songName:String = "";
676
public var week:Int = 0;
677
public var songCharacter:String = "";
678
679
public function new(song:String, week:Int, songCharacter:String)
680
{
681
this.songName = song;
682
this.week = week;
683
this.songCharacter = songCharacter;
684
}
685
}
686
package;
687
688
#if desktop
689
import Discord.DiscordClient;
690
#end
691
import flixel.FlxG;
692
import flixel.FlxSprite;
693
import flixel.addons.transition.FlxTransitionableState;
694
import flixel.graphics.frames.FlxAtlasFrames;
695
import flixel.group.FlxGroup.FlxTypedGroup;
696
import flixel.group.FlxGroup;
697
import flixel.math.FlxMath;
698
import flixel.text.FlxText;
699
import flixel.tweens.FlxTween;
700
import flixel.util.FlxColor;
701
import flixel.util.FlxTimer;
702
import lime.net.curl.CURLCode;
703
704
using StringTools;
705
706
class StoryMenuState extends MusicBeatState
707
{
708
var scoreText:FlxText;
709
710
var weekData:Array<Dynamic> = [
711
['Tutorial'],
712
['Bopeebo', 'Fresh', 'Dadbattle'],
713
['Spookeez', 'South', "Monster"],
714
['Pico', 'Philly', "Blammed"],
715
['Satin-Panties', "High", "Milf"],
716
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
717
['Senpai', 'Roses', 'Thorns']
718
];
719
var curDifficulty:Int = 1;
720
721
public static var weekUnlocked:Array<Bool> = [true, true, true, true, true, true, true];
722
723
var weekCharacters:Array<Dynamic> = [
724
['dad', 'bf', 'gf'],
725
['dad', 'bf', 'gf'],
726
['spooky', 'bf', 'gf'],
727
['pico', 'bf', 'gf'],
728
['mom', 'bf', 'gf'],
729
['parents-christmas', 'bf', 'gf'],
730
['senpai', 'bf', 'gf']
731
];
732
733
var weekNames:Array<String> = [
734
"",
735
"Daddy Dearest",
736
"Spooky Month",
737
"PICO",
738
"MOMMY MUST MURDER",
739
"RED SNOW",
740
"hating simulator ft. moawling"
741
];
742
743
var txtWeekTitle:FlxText;
744
745
var curWeek:Int = 0;
746
747
var txtTracklist:FlxText;
748
749
var grpWeekText:FlxTypedGroup<MenuItem>;
750
var grpWeekCharacters:FlxTypedGroup<MenuCharacter>;
751
752
var grpLocks:FlxTypedGroup<FlxSprite>;
753
754
var difficultySelectors:FlxGroup;
755
var sprDifficulty:FlxSprite;
756
var leftArrow:FlxSprite;
757
var rightArrow:FlxSprite;
758
759
override function create()
760
{
761
transIn = FlxTransitionableState.defaultTransIn;
762
transOut = FlxTransitionableState.defaultTransOut;
763
764
if (FlxG.sound.music != null)
765
{
766
if (!FlxG.sound.music.playing)
767
FlxG.sound.playMusic(Paths.music('freakyMenu'));
768
}
769
770
persistentUpdate = persistentDraw = true;
771
772
scoreText = new FlxText(10, 10, 0, "SCORE: 49324858", 36);
773
scoreText.setFormat("VCR OSD Mono", 32);
774
775
txtWeekTitle = new FlxText(FlxG.width * 0.7, 10, 0, "", 32);
776
txtWeekTitle.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, RIGHT);
777
txtWeekTitle.alpha = 0.7;
778
779
var rankText:FlxText = new FlxText(0, 10);
780
rankText.text = 'RANK: GREAT';
781
rankText.setFormat(Paths.font("vcr.ttf"), 32);
782
rankText.size = scoreText.size;
783
rankText.screenCenter(X);
784
785
var ui_tex = Paths.getSparrowAtlas('campaign_menu_UI_assets');
786
var yellowBG:FlxSprite = new FlxSprite(0, 56).makeGraphic(FlxG.width, 400, 0xFFF9CF51);
787
788
grpWeekText = new FlxTypedGroup<MenuItem>();
789
add(grpWeekText);
790
791
var blackBarThingie:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, 56, FlxColor.BLACK);
792
add(blackBarThingie);
793
794
grpWeekCharacters = new FlxTypedGroup<MenuCharacter>();
795
796
grpLocks = new FlxTypedGroup<FlxSprite>();
797
add(grpLocks);
798
799
trace("Line 70");
800
801
#if desktop
802
// Updating Discord Rich Presence
803
DiscordClient.changePresence("In the Menus", null);
804
#end
805
806
for (i in 0...weekData.length)
807
{
808
var weekThing:MenuItem = new MenuItem(0, yellowBG.y + yellowBG.height + 10, i);
809
weekThing.y += ((weekThing.height + 20) * i);
810
weekThing.targetY = i;
811
grpWeekText.add(weekThing);
812
813
weekThing.screenCenter(X);
814
weekThing.antialiasing = true;
815
// weekThing.updateHitbox();
816
817
// Needs an offset thingie
818
if (!weekUnlocked[i])
819
{
820
var lock:FlxSprite = new FlxSprite(weekThing.width + 10 + weekThing.x);
821
lock.frames = ui_tex;
822
lock.animation.addByPrefix('lock', 'lock');
823
lock.animation.play('lock');
824
lock.ID = i;
825
lock.antialiasing = true;
826
grpLocks.add(lock);
827
}
828
}
829
830
trace("Line 96");
831
832
for (char in 0...3)
833
{
834
var weekCharacterThing:MenuCharacter = new MenuCharacter((FlxG.width * 0.25) * (1 + char) - 150, weekCharacters[curWeek][char]);
835
weekCharacterThing.y += 70;
836
weekCharacterThing.antialiasing = true;
837
switch (weekCharacterThing.character)
838
{
839
case 'dad':
840
weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.5));
841
weekCharacterThing.updateHitbox();
842
843
case 'bf':
844
weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.9));
845
weekCharacterThing.updateHitbox();
846
weekCharacterThing.x -= 80;
847
case 'gf':
848
weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.5));
849
weekCharacterThing.updateHitbox();
850
case 'pico':
851
weekCharacterThing.flipX = true;
852
case 'parents-christmas':
853
weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.9));
854
weekCharacterThing.updateHitbox();
855
}
856
857
grpWeekCharacters.add(weekCharacterThing);
858
}
859
860
difficultySelectors = new FlxGroup();
861
add(difficultySelectors);
862
863
trace("Line 124");
864
865
leftArrow = new FlxSprite(grpWeekText.members[0].x + grpWeekText.members[0].width + 10, grpWeekText.members[0].y + 10);
866
leftArrow.frames = ui_tex;
867
leftArrow.animation.addByPrefix('idle', "arrow left");
868
leftArrow.animation.addByPrefix('press', "arrow push left");
869
leftArrow.animation.play('idle');
870
difficultySelectors.add(leftArrow);
871
872
sprDifficulty = new FlxSprite(leftArrow.x + 130, leftArrow.y);
873
sprDifficulty.frames = ui_tex;
874
sprDifficulty.animation.addByPrefix('easy', 'EASY');
875
sprDifficulty.animation.addByPrefix('normal', 'NORMAL');
876
sprDifficulty.animation.addByPrefix('hard', 'HARD');
877
sprDifficulty.animation.play('easy');
878
changeDifficulty();
879
880
difficultySelectors.add(sprDifficulty);
881
882
rightArrow = new FlxSprite(sprDifficulty.x + sprDifficulty.width + 50, leftArrow.y);
883
rightArrow.frames = ui_tex;
884
rightArrow.animation.addByPrefix('idle', 'arrow right');
885
rightArrow.animation.addByPrefix('press', "arrow push right", 24, false);
886
rightArrow.animation.play('idle');
887
difficultySelectors.add(rightArrow);
888
889
trace("Line 150");
890
891
add(yellowBG);
892
add(grpWeekCharacters);
893
894
txtTracklist = new FlxText(FlxG.width * 0.05, yellowBG.x + yellowBG.height + 100, 0, "Tracks", 32);
895
txtTracklist.alignment = CENTER;
896
txtTracklist.font = rankText.font;
897
txtTracklist.color = 0xFFe55777;
898
add(txtTracklist);
899
// add(rankText);
900
add(scoreText);
901
add(txtWeekTitle);
902
903
updateText();
904
905
trace("Line 165");
906
907
super.create();
908
}
909
910
override function update(elapsed:Float)
911
{
912
// scoreText.setFormat('VCR OSD Mono', 32);
913
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.5));
914
915
scoreText.text = "WEEK SCORE:" + lerpScore;
916
917
txtWeekTitle.text = weekNames[curWeek].toUpperCase();
918
txtWeekTitle.x = FlxG.width - (txtWeekTitle.width + 10);
919
920
// FlxG.watch.addQuick('font', scoreText.font);
921
922
difficultySelectors.visible = weekUnlocked[curWeek];
923
924
grpLocks.forEach(function(lock:FlxSprite)
925
{
926
lock.y = grpWeekText.members[lock.ID].y;
927
});
928
929
if (!movedBack)
930
{
931
if (!selectedWeek)
932
{
933
if (controls.UP_P)
934
{
935
changeWeek(-1);
936
}
937
938
if (controls.DOWN_P)
939
{
940
changeWeek(1);
941
}
942
943
if (controls.RIGHT)
944
rightArrow.animation.play('press')
945
else
946
rightArrow.animation.play('idle');
947
948
if (controls.LEFT)
949
leftArrow.animation.play('press');
950
else
951
leftArrow.animation.play('idle');
952
953
if (controls.RIGHT_P)
954
changeDifficulty(1);
955
if (controls.LEFT_P)
956
changeDifficulty(-1);
957
}
958
959
if (controls.ACCEPT)
960
{
961
selectWeek();
962
}
963
}
964
965
if (controls.BACK && !movedBack && !selectedWeek)
966
{
967
FlxG.sound.play(Paths.sound('cancelMenu'));
968
movedBack = true;
969
FlxG.switchState(new MainMenuState());
970
}
971
972
super.update(elapsed);
973
}
974
975
var movedBack:Bool = false;
976
var selectedWeek:Bool = false;
977
var stopspamming:Bool = false;
978
979
function selectWeek()
980
{
981
if (weekUnlocked[curWeek])
982
{
983
if (stopspamming == false)
984
{
985
FlxG.sound.play(Paths.sound('confirmMenu'));
986
987
grpWeekText.members[curWeek].startFlashing();
988
grpWeekCharacters.members[1].animation.play('bfConfirm');
989
stopspamming = true;
990
}
991
992
PlayState.storyPlaylist = weekData[curWeek];
993
PlayState.isStoryMode = true;
994
selectedWeek = true;
995
996
var diffic = "";
997
998
switch (curDifficulty)
999
{
1000
case 0:
1001
diffic = '-easy';
1002
case 2:
1003
diffic = '-hard';
1004
}
1005
1006
PlayState.storyDifficulty = curDifficulty;
1007
1008
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + diffic, PlayState.storyPlaylist[0].toLowerCase());
1009
PlayState.storyWeek = curWeek;
1010
PlayState.campaignScore = 0;
1011
new FlxTimer().start(1, function(tmr:FlxTimer)
1012
{
1013
LoadingState.loadAndSwitchState(new PlayState(), true);
1014
});
1015
}
1016
}
1017
1018
function changeDifficulty(change:Int = 0):Void
1019
{
1020
curDifficulty += change;
1021
1022
if (curDifficulty < 0)
1023
curDifficulty = 2;
1024
if (curDifficulty > 2)
1025
curDifficulty = 0;
1026
1027
sprDifficulty.offset.x = 0;
1028
1029
switch (curDifficulty)
1030
{
1031
case 0:
1032
sprDifficulty.animation.play('easy');
1033
sprDifficulty.offset.x = 20;
1034
case 1:
1035
sprDifficulty.animation.play('normal');
1036
sprDifficulty.offset.x = 70;
1037
case 2:
1038
sprDifficulty.animation.play('hard');
1039
sprDifficulty.offset.x = 20;
1040
}
1041
1042
sprDifficulty.alpha = 0;
1043
1044
// USING THESE WEIRD VALUES SO THAT IT DOESNT FLOAT UP
1045
sprDifficulty.y = leftArrow.y - 15;
1046
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
1047
1048
#if !switch
1049
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
1050
#end
1051
1052
FlxTween.tween(sprDifficulty, {y: leftArrow.y + 15, alpha: 1}, 0.07);
1053
}
1054
1055
var lerpScore:Int = 0;
1056
var intendedScore:Int = 0;
1057
1058
function changeWeek(change:Int = 0):Void
1059
{
1060
curWeek += change;
1061
1062
if (curWeek >= weekData.length)
1063
curWeek = 0;
1064
if (curWeek < 0)
1065
curWeek = weekData.length - 1;
1066
1067
var bullShit:Int = 0;
1068
1069
for (item in grpWeekText.members)
1070
{
1071
item.targetY = bullShit - curWeek;
1072
if (item.targetY == Std.int(0) && weekUnlocked[curWeek])
1073
item.alpha = 1;
1074
else
1075
item.alpha = 0.6;
1076
bullShit++;
1077
}
1078
1079
FlxG.sound.play(Paths.sound('scrollMenu'));
1080
1081
updateText();
1082
}
1083
1084
function updateText()
1085
{
1086
grpWeekCharacters.members[0].animation.play(weekCharacters[curWeek][0]);
1087
grpWeekCharacters.members[1].animation.play(weekCharacters[curWeek][1]);
1088
grpWeekCharacters.members[2].animation.play(weekCharacters[curWeek][2]);
1089
txtTracklist.text = "Tracks\n";
1090
1091
switch (grpWeekCharacters.members[0].animation.curAnim.name)
1092
{
1093
case 'parents-christmas':
1094
grpWeekCharacters.members[0].offset.set(200, 200);
1095
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 0.99));
1096
1097
case 'senpai':
1098
grpWeekCharacters.members[0].offset.set(130, 0);
1099
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1.4));
1100
1101
case 'mom':
1102
grpWeekCharacters.members[0].offset.set(100, 200);
1103
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
1104
1105
case 'dad':
1106
grpWeekCharacters.members[0].offset.set(120, 200);
1107
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
1108
1109
default:
1110
grpWeekCharacters.members[0].offset.set(100, 100);
1111
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
1112
// grpWeekCharacters.members[0].updateHitbox();
1113
}
1114
1115
var stringThing:Array<String> = weekData[curWeek];
1116
1117
for (i in stringThing)
1118
{
1119
txtTracklist.text += "\n" + i;
1120
}
1121
1122
txtTracklist.text = txtTracklist.text.toUpperCase();
1123
1124
txtTracklist.screenCenter(X);
1125
txtTracklist.x -= FlxG.width * 0.35;
1126
1127
#if !switch
1128
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
1129
#end
1130
}
1131
}
1132
package;
1133
1134
#if desktop
1135
import Discord.DiscordClient;
1136
#end
1137
import Section.SwagSection;
1138
import Song.SwagSong;
1139
import WiggleEffect.WiggleEffectType;
1140
import flixel.FlxBasic;
1141
import flixel.FlxCamera;
1142
import flixel.FlxG;
1143
import flixel.FlxGame;
1144
import flixel.FlxObject;
1145
import flixel.FlxSprite;
1146
import flixel.FlxState;
1147
import flixel.FlxSubState;
1148
import flixel.addons.display.FlxGridOverlay;
1149
import flixel.addons.effects.FlxTrail;
1150
import flixel.addons.effects.FlxTrailArea;
1151
import flixel.addons.effects.chainable.FlxEffectSprite;
1152
import flixel.addons.effects.chainable.FlxWaveEffect;
1153
import flixel.addons.transition.FlxTransitionableState;
1154
import flixel.graphics.atlas.FlxAtlas;
1155
import flixel.graphics.frames.FlxAtlasFrames;
1156
import flixel.group.FlxGroup.FlxTypedGroup;
1157
import flixel.math.FlxMath;
1158
import flixel.math.FlxPoint;
1159
import flixel.math.FlxRect;
1160
import flixel.system.FlxSound;
1161
import flixel.text.FlxText;
1162
import flixel.tweens.FlxEase;
1163
import flixel.tweens.FlxTween;
1164
import flixel.ui.FlxBar;
1165
import flixel.util.FlxCollision;
1166
import flixel.util.FlxColor;
1167
import flixel.util.FlxSort;
1168
import flixel.util.FlxStringUtil;
1169
import flixel.util.FlxTimer;
1170
import haxe.Json;
1171
import lime.utils.Assets;
1172
import openfl.display.BlendMode;
1173
import openfl.display.StageQuality;
1174
import openfl.filters.ShaderFilter;
1175
1176
using StringTools;
1177
1178
class PlayState extends MusicBeatState {
1179
public static var curStage:String = '';
1180
public static var SONG:SwagSong;
1181
public static var isStoryMode:Bool = false;
1182
public static var storyWeek:Int = 0;
1183
public static var storyPlaylist:Array<String> = [];
1184
public static var storyDifficulty:Int = 1;
1185
1186
var halloweenLevel:Bool = false;
1187
1188
private var vocals:FlxSound;
1189
1190
private var dad:Character;
1191
private var gf:Character;
1192
private var boyfriend:Boyfriend;
1193
1194
private var notes:FlxTypedGroup<Note>;
1195
private var unspawnNotes:Array<Note> = [];
1196
1197
private var strumLine:FlxSprite;
1198
private var curSection:Int = 0;
1199
1200
private var camFollow:FlxObject;
1201
1202
private static var prevCamFollow:FlxObject;
1203
1204
private var strumLineNotes:FlxTypedGroup<FlxSprite>;
1205
private var playerStrums:FlxTypedGroup<FlxSprite>;
1206
1207
private var camZooming:Bool = false;
1208
private var curSong:String = "";
1209
1210
private var gfSpeed:Int = 1;
1211
private var health:Float = 1;
1212
private var combo:Int = 0;
1213
1214
private var healthBarBG:FlxSprite;
1215
private var healthBar:FlxBar;
1216
1217
private var generatedMusic:Bool = false;
1218
private var startingSong:Bool = false;
1219
1220
private var iconP1:HealthIcon;
1221
private var iconP2:HealthIcon;
1222
private var camHUD:FlxCamera;
1223
private var camGame:FlxCamera;
1224
1225
var dialogue:Array<String> = ['strange code', '>:]'];
1226
1227
var halloweenBG:FlxSprite;
1228
var isHalloween:Bool = false;
1229
1230
var phillyCityLights:FlxTypedGroup<FlxSprite>;
1231
var phillyTrain:FlxSprite;
1232
var trainSound:FlxSound;
1233
1234
var limo:FlxSprite;
1235
var grpLimoDancers:FlxTypedGroup<BackgroundDancer>;
1236
var fastCar:FlxSprite;
1237
1238
var upperBoppers:FlxSprite;
1239
var bottomBoppers:FlxSprite;
1240
var santa:FlxSprite;
1241
1242
var bgGirls:BackgroundGirls;
1243
var wiggleShit:WiggleEffect = new WiggleEffect();
1244
1245
var talking:Bool = true;
1246
var songScore:Int = 0;
1247
var scoreTxt:FlxText;
1248
1249
public static var campaignScore:Int = 0;
1250
1251
var defaultCamZoom:Float = 1.05;
1252
1253
public var stepsFuncs:Array<HardcodedEvents> = [];
1254
1255
// how big to stretch the pixel art assets
1256
public static var daPixelZoom:Float = 6;
1257
1258
var inCutscene:Bool = false;
1259
1260
#if desktop
1261
// Discord RPC variables
1262
var storyDifficultyText:String = "";
1263
var iconRPC:String = "";
1264
var songLength:Float = 0;
1265
var detailsText:String = "";
1266
var detailsPausedText:String = "";
1267
#end
1268
1269
function pushStepEvent(callback:Void->Void, step:Int){
1270
stepsFuncs.push(new HardcodedEvents(callback, step));
1271
}
1272
1273
public var camBeat:Int = 4;
1274
/*
1275
pushStepEvent(function(), yourstephere{
1276
camBeat = 1;
1277
});
1278
*/
1279
1280
override public function create() {
1281
if (FlxG.sound.music != null)
1282
FlxG.sound.music.stop();
1283
1284
// var gameCam:FlxCamera = FlxG.camera;
1285
camGame = new FlxCamera();
1286
camHUD = new FlxCamera();
1287
camHUD.bgColor.alpha = 0;
1288
1289
FlxG.cameras.reset(camGame);
1290
FlxG.cameras.add(camHUD);
1291
1292
FlxCamera.defaultCameras = [camGame];
1293
1294
persistentUpdate = true;
1295
persistentDraw = true;
1296
1297
if (SONG == null)
1298
SONG = Song.loadFromJson('tutorial');
1299
1300
Conductor.mapBPMChanges(SONG);
1301
Conductor.changeBPM(SONG.bpm);
1302
1303
switch (SONG.song.toLowerCase()) {
1304
case 'senpai':
1305
dialogue = CoolUtil.coolTextFile(Paths.txt('senpai/senpaiDialogue'));
1306
case 'roses':
1307
dialogue = CoolUtil.coolTextFile(Paths.txt('roses/rosesDialogue'));
1308
case 'thorns':
1309
dialogue = CoolUtil.coolTextFile(Paths.txt('thorns/thornsDialogue'));
1310
}
1311
1312
#if desktop
1313
// Making difficulty text for Discord Rich Presence.
1314
switch (storyDifficulty) {
1315
case 0:
1316
storyDifficultyText = "Easy";
1317
case 1:
1318
storyDifficultyText = "Normal";
1319
case 2:
1320
storyDifficultyText = "Hard";
1321
}
1322
1323
iconRPC = SONG.player2;
1324
1325
// To avoid having duplicate images in Discord assets
1326
switch (iconRPC) {
1327
case 'senpai-angry':
1328
iconRPC = 'senpai';
1329
case 'monster-christmas':
1330
iconRPC = 'monster';
1331
case 'mom-car':
1332
iconRPC = 'mom';
1333
}
1334
1335
// String that contains the mode defined here so it isn't necessary to call changePresence for each mode
1336
if (isStoryMode) {
1337
detailsText = "Story Mode: Week " + storyWeek;
1338
} else {
1339
detailsText = "Freeplay";
1340
}
1341
1342
// String for when the game is paused
1343
detailsPausedText = "Paused - " + detailsText;
1344
1345
// Updating Discord Rich Presence.
1346
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
1347
#end
1348
1349
switch (SONG.song.toLowerCase()) {
1350
case 'spookeez' | 'monster' | 'south':
1351
{
1352
curStage = 'spooky';
1353
halloweenLevel = true;
1354
1355
var hallowTex = Paths.getSparrowAtlas('halloween_bg');
1356
1357
halloweenBG = new FlxSprite(-200, -100);
1358
halloweenBG.frames = hallowTex;
1359
halloweenBG.animation.addByPrefix('idle', 'halloweem bg0');
1360
halloweenBG.animation.addByPrefix('lightning', 'halloweem bg lightning strike', 24, false);
1361
halloweenBG.animation.play('idle');
1362
halloweenBG.antialiasing = true;
1363
add(halloweenBG);
1364
1365
isHalloween = true;
1366
}
1367
case 'pico' | 'blammed' | 'philly':
1368
{
1369
curStage = 'philly';
1370
1371
var bg:FlxSprite = new FlxSprite(-100).loadGraphic(Paths.image('philly/sky'));
1372
bg.scrollFactor.set(0.1, 0.1);
1373
add(bg);
1374
1375
var city:FlxSprite = new FlxSprite(-10).loadGraphic(Paths.image('philly/city'));
1376
city.scrollFactor.set(0.3, 0.3);
1377
city.setGraphicSize(Std.int(city.width * 0.85));
1378
city.updateHitbox();
1379
add(city);
1380
1381
phillyCityLights = new FlxTypedGroup<FlxSprite>();
1382
add(phillyCityLights);
1383
1384
for (i in 0...5) {
1385
var light:FlxSprite = new FlxSprite(city.x).loadGraphic(Paths.image('philly/win' + i));
1386
light.scrollFactor.set(0.3, 0.3);
1387
light.visible = false;
1388
light.setGraphicSize(Std.int(light.width * 0.85));
1389
light.updateHitbox();
1390
light.antialiasing = true;
1391
phillyCityLights.add(light);
1392
}
1393
1394
var streetBehind:FlxSprite = new FlxSprite(-40, 50).loadGraphic(Paths.image('philly/behindTrain'));
1395
add(streetBehind);
1396
1397
phillyTrain = new FlxSprite(2000, 360).loadGraphic(Paths.image('philly/train'));
1398
add(phillyTrain);
1399
1400
trainSound = new FlxSound().loadEmbedded(Paths.sound('train_passes'));
1401
FlxG.sound.list.add(trainSound);
1402
1403
// var cityLights:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.win0.png);
1404
1405
var street:FlxSprite = new FlxSprite(-40, streetBehind.y).loadGraphic(Paths.image('philly/street'));
1406
add(street);
1407
}
1408
case 'milf' | 'satin-panties' | 'high':
1409
{
1410
curStage = 'limo';
1411
defaultCamZoom = 0.90;
1412
1413
var skyBG:FlxSprite = new FlxSprite(-120, -50).loadGraphic(Paths.image('limo/limoSunset'));
1414
skyBG.scrollFactor.set(0.1, 0.1);
1415
add(skyBG);
1416
1417
var bgLimo:FlxSprite = new FlxSprite(-200, 480);
1418
bgLimo.frames = Paths.getSparrowAtlas('limo/bgLimo');
1419
bgLimo.animation.addByPrefix('drive', "background limo pink", 24);
1420
bgLimo.animation.play('drive');
1421
bgLimo.scrollFactor.set(0.4, 0.4);
1422
add(bgLimo);
1423
1424
grpLimoDancers = new FlxTypedGroup<BackgroundDancer>();
1425
add(grpLimoDancers);
1426
1427
for (i in 0...5) {
1428
var dancer:BackgroundDancer = new BackgroundDancer((370 * i) + 130, bgLimo.y - 400);
1429
dancer.scrollFactor.set(0.4, 0.4);
1430
grpLimoDancers.add(dancer);
1431
}
1432
1433
var overlayShit:FlxSprite = new FlxSprite(-500, -600).loadGraphic(Paths.image('limo/limoOverlay'));
1434
overlayShit.alpha = 0.5;
1435
// add(overlayShit);
1436
1437
// var shaderBullshit = new BlendModeEffect(new OverlayShader(), FlxColor.RED);
1438
1439
// FlxG.camera.setFilters([new ShaderFilter(cast shaderBullshit.shader)]);
1440
1441
// overlayShit.shader = shaderBullshit;
1442
1443
var limoTex = Paths.getSparrowAtlas('limo/limoDrive');
1444
1445
limo = new FlxSprite(-120, 550);
1446
limo.frames = limoTex;
1447
limo.animation.addByPrefix('drive', "Limo stage", 24);
1448
limo.animation.play('drive');
1449
limo.antialiasing = true;
1450
1451
fastCar = new FlxSprite(-300, 160).loadGraphic(Paths.image('limo/fastCarLol'));
1452
// add(limo);
1453
}
1454
case 'cocoa' | 'eggnog':
1455
{
1456
curStage = 'mall';
1457
1458
defaultCamZoom = 0.80;
1459
1460
var bg:FlxSprite = new FlxSprite(-1000, -500).loadGraphic(Paths.image('christmas/bgWalls'));
1461
bg.antialiasing = true;
1462
bg.scrollFactor.set(0.2, 0.2);
1463
bg.active = false;
1464
bg.setGraphicSize(Std.int(bg.width * 0.8));
1465
bg.updateHitbox();
1466
add(bg);
1467
1468
upperBoppers = new FlxSprite(-240, -90);
1469
upperBoppers.frames = Paths.getSparrowAtlas('christmas/upperBop');
1470
upperBoppers.animation.addByPrefix('bop', "Upper Crowd Bob", 24, false);
1471
upperBoppers.antialiasing = true;
1472
upperBoppers.scrollFactor.set(0.33, 0.33);
1473
upperBoppers.setGraphicSize(Std.int(upperBoppers.width * 0.85));
1474
upperBoppers.updateHitbox();
1475
add(upperBoppers);
1476
1477
var bgEscalator:FlxSprite = new FlxSprite(-1100, -600).loadGraphic(Paths.image('christmas/bgEscalator'));
1478
bgEscalator.antialiasing = true;
1479
bgEscalator.scrollFactor.set(0.3, 0.3);
1480
bgEscalator.active = false;
1481
bgEscalator.setGraphicSize(Std.int(bgEscalator.width * 0.9));
1482
bgEscalator.updateHitbox();
1483
add(bgEscalator);
1484
1485
var tree:FlxSprite = new FlxSprite(370, -250).loadGraphic(Paths.image('christmas/christmasTree'));
1486
tree.antialiasing = true;
1487
tree.scrollFactor.set(0.40, 0.40);
1488
add(tree);
1489
1490
bottomBoppers = new FlxSprite(-300, 140);
1491
bottomBoppers.frames = Paths.getSparrowAtlas('christmas/bottomBop');
1492
bottomBoppers.animation.addByPrefix('bop', 'Bottom Level Boppers', 24, false);
1493
bottomBoppers.antialiasing = true;
1494
bottomBoppers.scrollFactor.set(0.9, 0.9);
1495
bottomBoppers.setGraphicSize(Std.int(bottomBoppers.width * 1));
1496
bottomBoppers.updateHitbox();
1497
add(bottomBoppers);
1498
1499
var fgSnow:FlxSprite = new FlxSprite(-600, 700).loadGraphic(Paths.image('christmas/fgSnow'));
1500
fgSnow.active = false;
1501
fgSnow.antialiasing = true;
1502
add(fgSnow);
1503
1504
santa = new FlxSprite(-840, 150);
1505
santa.frames = Paths.getSparrowAtlas('christmas/santa');
1506
santa.animation.addByPrefix('idle', 'santa idle in fear', 24, false);
1507
santa.antialiasing = true;
1508
add(santa);
1509
}
1510
case 'winter-horrorland':
1511
{
1512
curStage = 'mallEvil';
1513
var bg:FlxSprite = new FlxSprite(-400, -500).loadGraphic(Paths.image('christmas/evilBG'));
1514
bg.antialiasing = true;
1515
bg.scrollFactor.set(0.2, 0.2);
1516
bg.active = false;
1517
bg.setGraphicSize(Std.int(bg.width * 0.8));
1518
bg.updateHitbox();
1519
add(bg);
1520
1521
var evilTree:FlxSprite = new FlxSprite(300, -300).loadGraphic(Paths.image('christmas/evilTree'));
1522
evilTree.antialiasing = true;
1523
evilTree.scrollFactor.set(0.2, 0.2);
1524
add(evilTree);
1525
1526
var evilSnow:FlxSprite = new FlxSprite(-200, 700).loadGraphic(Paths.image("christmas/evilSnow"));
1527
evilSnow.antialiasing = true;
1528
add(evilSnow);
1529
}
1530
case 'senpai' | 'roses':
1531
{
1532
curStage = 'school';
1533
1534
// defaultCamZoom = 0.9;
1535
1536
var bgSky = new FlxSprite().loadGraphic(Paths.image('weeb/weebSky'));
1537
bgSky.scrollFactor.set(0.1, 0.1);
1538
add(bgSky);
1539
1540
var repositionShit = -200;
1541
1542
var bgSchool:FlxSprite = new FlxSprite(repositionShit, 0).loadGraphic(Paths.image('weeb/weebSchool'));
1543
bgSchool.scrollFactor.set(0.6, 0.90);
1544
add(bgSchool);
1545
1546
var bgStreet:FlxSprite = new FlxSprite(repositionShit).loadGraphic(Paths.image('weeb/weebStreet'));
1547
bgStreet.scrollFactor.set(0.95, 0.95);
1548
add(bgStreet);
1549
1550
var fgTrees:FlxSprite = new FlxSprite(repositionShit + 170, 130).loadGraphic(Paths.image('weeb/weebTreesBack'));
1551
fgTrees.scrollFactor.set(0.9, 0.9);
1552
add(fgTrees);
1553
1554
var bgTrees:FlxSprite = new FlxSprite(repositionShit - 380, -800);
1555
var treetex = Paths.getPackerAtlas('weeb/weebTrees');
1556
bgTrees.frames = treetex;
1557
bgTrees.animation.add('treeLoop', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], 12);
1558
bgTrees.animation.play('treeLoop');
1559
bgTrees.scrollFactor.set(0.85, 0.85);
1560
add(bgTrees);
1561
1562
var treeLeaves:FlxSprite = new FlxSprite(repositionShit, -40);
1563
treeLeaves.frames = Paths.getSparrowAtlas('weeb/petals');
1564
treeLeaves.animation.addByPrefix('leaves', 'PETALS ALL', 24, true);
1565
treeLeaves.animation.play('leaves');
1566
treeLeaves.scrollFactor.set(0.85, 0.85);
1567
add(treeLeaves);
1568
1569
var widShit = Std.int(bgSky.width * 6);
1570
1571
bgSky.setGraphicSize(widShit);
1572
bgSchool.setGraphicSize(widShit);
1573
bgStreet.setGraphicSize(widShit);
1574
bgTrees.setGraphicSize(Std.int(widShit * 1.4));
1575
fgTrees.setGraphicSize(Std.int(widShit * 0.8));
1576
treeLeaves.setGraphicSize(widShit);
1577
1578
fgTrees.updateHitbox();
1579
bgSky.updateHitbox();
1580
bgSchool.updateHitbox();
1581
bgStreet.updateHitbox();
1582
bgTrees.updateHitbox();
1583
treeLeaves.updateHitbox();
1584
1585
bgGirls = new BackgroundGirls(-100, 190);
1586
bgGirls.scrollFactor.set(0.9, 0.9);
1587
1588
if (SONG.song.toLowerCase() == 'roses') {
1589
bgGirls.getScared();
1590
}
1591
1592
bgGirls.setGraphicSize(Std.int(bgGirls.width * daPixelZoom));
1593
bgGirls.updateHitbox();
1594
add(bgGirls);
1595
}
1596
case 'thorns':
1597
{
1598
curStage = 'schoolEvil';
1599
1600
var waveEffectBG = new FlxWaveEffect(FlxWaveMode.ALL, 2, -1, 3, 2);
1601
var waveEffectFG = new FlxWaveEffect(FlxWaveMode.ALL, 2, -1, 5, 2);
1602
1603
var posX = 400;
1604
var posY = 200;
1605
1606
var bg:FlxSprite = new FlxSprite(posX, posY);
1607
bg.frames = Paths.getSparrowAtlas('weeb/animatedEvilSchool');
1608
bg.animation.addByPrefix('idle', 'background 2', 24);
1609
bg.animation.play('idle');
1610
bg.scrollFactor.set(0.8, 0.9);
1611
bg.scale.set(6, 6);
1612
add(bg);
1613
1614
/*
1615
var bg:FlxSprite = new FlxSprite(posX, posY).loadGraphic(Paths.image('weeb/evilSchoolBG'));
1616
bg.scale.set(6, 6);
1617
// bg.setGraphicSize(Std.int(bg.width * 6));
1618
// bg.updateHitbox();
1619
add(bg);
1620
1621
var fg:FlxSprite = new FlxSprite(posX, posY).loadGraphic(Paths.image('weeb/evilSchoolFG'));
1622
fg.scale.set(6, 6);
1623
// fg.setGraphicSize(Std.int(fg.width * 6));
1624
// fg.updateHitbox();
1625
add(fg);
1626
1627
wiggleShit.effectType = WiggleEffectType.DREAMY;
1628
wiggleShit.waveAmplitude = 0.01;
1629
wiggleShit.waveFrequency = 60;
1630
wiggleShit.waveSpeed = 0.8;
1631
*/
1632
1633
// bg.shader = wiggleShit.shader;
1634
// fg.shader = wiggleShit.shader;
1635
1636
/*
1637
var waveSprite = new FlxEffectSprite(bg, [waveEffectBG]);
1638
var waveSpriteFG = new FlxEffectSprite(fg, [waveEffectFG]);
1639
1640
// Using scale since setGraphicSize() doesnt work???
1641
waveSprite.scale.set(6, 6);
1642
waveSpriteFG.scale.set(6, 6);
1643
waveSprite.setPosition(posX, posY);
1644
waveSpriteFG.setPosition(posX, posY);
1645
1646
waveSprite.scrollFactor.set(0.7, 0.8);
1647
waveSpriteFG.scrollFactor.set(0.9, 0.8);
1648
1649
// waveSprite.setGraphicSize(Std.int(waveSprite.width * 6));
1650
// waveSprite.updateHitbox();
1651
// waveSpriteFG.setGraphicSize(Std.int(fg.width * 6));
1652
// waveSpriteFG.updateHitbox();
1653
1654
add(waveSprite);
1655
add(waveSpriteFG);
1656
*/
1657
}
1658
default:
1659
{
1660
defaultCamZoom = 0.9;
1661
curStage = 'stage';
1662
var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(Paths.image('stageback'));
1663
bg.antialiasing = true;
1664
bg.scrollFactor.set(0.9, 0.9);
1665
bg.active = false;
1666
add(bg);
1667
1668
var stageFront:FlxSprite = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront'));
1669
stageFront.setGraphicSize(Std.int(stageFront.width * 1.1));
1670
stageFront.updateHitbox();
1671
stageFront.antialiasing = true;
1672
stageFront.scrollFactor.set(0.9, 0.9);
1673
stageFront.active = false;
1674
add(stageFront);
1675
1676
var stageCurtains:FlxSprite = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains'));
1677
stageCurtains.setGraphicSize(Std.int(stageCurtains.width * 0.9));
1678
stageCurtains.updateHitbox();
1679
stageCurtains.antialiasing = true;
1680
stageCurtains.scrollFactor.set(1.3, 1.3);
1681
stageCurtains.active = false;
1682
1683
add(stageCurtains);
1684
}
1685
}
1686
1687
var gfVersion:String = 'gf';
1688
1689
switch (curStage) {
1690
case 'limo':
1691
gfVersion = 'gf-car';
1692
case 'mall' | 'mallEvil':
1693
gfVersion = 'gf-christmas';
1694
case 'school':
1695
gfVersion = 'gf-pixel';
1696
case 'schoolEvil':
1697
gfVersion = 'gf-pixel';
1698
}
1699
1700
if (curStage == 'limo')
1701
gfVersion = 'gf-car';
1702
1703
gf = new Character(400, 130, gfVersion);
1704
gf.scrollFactor.set(0.95, 0.95);
1705
1706
dad = new Character(100, 100, SONG.player2);
1707
1708
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
1709
1710
switch (SONG.player2) {
1711
case 'gf':
1712
dad.setPosition(gf.x, gf.y);
1713
gf.visible = false;
1714
if (isStoryMode) {
1715
camPos.x += 600;
1716
tweenCamIn();
1717
}
1718
1719
case "spooky":
1720
dad.y += 200;
1721
case "monster":
1722
dad.y += 100;
1723
case 'monster-christmas':
1724
dad.y += 130;
1725
case 'dad':
1726
camPos.x += 400;
1727
case 'pico':
1728
camPos.x += 600;
1729
dad.y += 300;
1730
case 'parents-christmas':
1731
dad.x -= 500;
1732
case 'senpai':
1733
dad.x += 150;
1734
dad.y += 360;
1735
camPos.set(dad.getGraphicMidpoint().x + 300, dad.getGraphicMidpoint().y);
1736
case 'senpai-angry':
1737
dad.x += 150;
1738
dad.y += 360;
1739
camPos.set(dad.getGraphicMidpoint().x + 300, dad.getGraphicMidpoint().y);
1740
case 'spirit':
1741
dad.x -= 150;
1742
dad.y += 100;
1743
camPos.set(dad.getGraphicMidpoint().x + 300, dad.getGraphicMidpoint().y);
1744
}
1745
1746
boyfriend = new Boyfriend(770, 450, SONG.player1);
1747
1748
// REPOSITIONING PER STAGE
1749
switch (curStage) {
1750
case 'limo':
1751
boyfriend.y -= 220;
1752
boyfriend.x += 260;
1753
1754
resetFastCar();
1755
add(fastCar);
1756
1757
case 'mall':
1758
boyfriend.x += 200;
1759
1760
case 'mallEvil':
1761
boyfriend.x += 320;
1762
dad.y -= 80;
1763
case 'school':
1764
boyfriend.x += 200;
1765
boyfriend.y += 220;
1766
gf.x += 180;
1767
gf.y += 300;
1768
case 'schoolEvil':
1769
// trailArea.scrollFactor.set();
1770
1771
var evilTrail = new FlxTrail(dad, null, 4, 24, 0.3, 0.069);
1772
// evilTrail.changeValuesEnabled(false, false, false, false);
1773
// evilTrail.changeGraphic()
1774
add(evilTrail);
1775
// evilTrail.scrollFactor.set(1.1, 1.1);
1776
1777
boyfriend.x += 200;
1778
boyfriend.y += 220;
1779
gf.x += 180;
1780
gf.y += 300;
1781
}
1782
1783
add(gf);
1784
1785
// Shitty layering but whatev it works LOL
1786
if (curStage == 'limo')
1787
add(limo);
1788
1789
add(dad);
1790
add(boyfriend);
1791
1792
var doof:DialogueBox = new DialogueBox(false, dialogue);
1793
// doof.x += 70;
1794
// doof.y = FlxG.height * 0.5;
1795
doof.scrollFactor.set();
1796
doof.finishThing = startCountdown;
1797
1798
Conductor.songPosition = -5000;
1799
1800
strumLine = new FlxSprite(0, 50).makeGraphic(FlxG.width, 10);
1801
strumLine.scrollFactor.set();
1802
1803
strumLineNotes = new FlxTypedGroup<FlxSprite>();
1804
add(strumLineNotes);
1805
1806
playerStrums = new FlxTypedGroup<FlxSprite>();
1807
1808
// startCountdown();
1809
1810
generateSong(SONG.song);
1811
1812
// add(strumLine);
1813
1814
camFollow = new FlxObject(0, 0, 1, 1);
1815
1816
camFollow.setPosition(camPos.x, camPos.y);
1817
1818
if (prevCamFollow != null) {
1819
camFollow = prevCamFollow;
1820
prevCamFollow = null;
1821
}
1822
1823
add(camFollow);
1824
1825
FlxG.camera.follow(camFollow, LOCKON, 0.04);
1826
// FlxG.camera.setScrollBounds(0, FlxG.width, 0, FlxG.height);
1827
FlxG.camera.zoom = defaultCamZoom;
1828
FlxG.camera.focusOn(camFollow.getPosition());
1829
1830
FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height);
1831
1832
FlxG.fixedTimestep = false;
1833
1834
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(Paths.image('healthBar'));
1835
healthBarBG.screenCenter(X);
1836
healthBarBG.scrollFactor.set();
1837
add(healthBarBG);
1838
1839
healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, RIGHT_TO_LEFT, Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
1840
'health', 0, 2);
1841
healthBar.scrollFactor.set();
1842
healthBar.createFilledBar(0xFFFF0000, 0xFF66FF33);
1843
// healthBar
1844
add(healthBar);
1845
1846
scoreTxt = new FlxText(healthBarBG.x + healthBarBG.width - 190, healthBarBG.y + 30, 0, "", 20);
1847
scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT);
1848
scoreTxt.scrollFactor.set();
1849
add(scoreTxt);
1850
1851
iconP1 = new HealthIcon(SONG.player1, true);
1852
iconP1.y = healthBar.y - (iconP1.height / 2);
1853
add(iconP1);
1854
1855
iconP2 = new HealthIcon(SONG.player2, false);
1856
iconP2.y = healthBar.y - (iconP2.height / 2);
1857
add(iconP2);
1858
1859
strumLineNotes.cameras = [camHUD];
1860
notes.cameras = [camHUD];
1861
healthBar.cameras = [camHUD];
1862
healthBarBG.cameras = [camHUD];
1863
iconP1.cameras = [camHUD];
1864
iconP2.cameras = [camHUD];
1865
scoreTxt.cameras = [camHUD];
1866
doof.cameras = [camHUD];
1867
1868
startingSong = true;
1869
1870
if (isStoryMode) {
1871
switch (curSong.toLowerCase()) {
1872
case "winter-horrorland":
1873
var blackScreen:FlxSprite = new FlxSprite(0, 0).makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.BLACK);
1874
add(blackScreen);
1875
blackScreen.scrollFactor.set();
1876
camHUD.visible = false;
1877
1878
new FlxTimer().start(0.1, function(cum:FlxTimer) {
1879
remove(blackScreen);
1880
FlxG.sound.play(Paths.sound('Lights_Turn_On'));
1881
camFollow.y = -2050;
1882
camFollow.x += 200;
1883
FlxG.camera.focusOn(camFollow.getPosition());
1884
FlxG.camera.zoom = 1.5;
1885
1886
new FlxTimer().start(0.8, function(cum:FlxTimer) {
1887
camHUD.visible = true;
1888
remove(blackScreen);
1889
FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, 2.5, {
1890
ease: FlxEase.quadInOut,
1891
onComplete: function(twn:FlxTween) {
1892
startCountdown();
1893
}
1894
});
1895
});
1896
});
1897
case 'senpai':
1898
schoolIntro(doof);
1899
case 'roses':
1900
FlxG.sound.play(Paths.sound('ANGRY'));
1901
schoolIntro(doof);
1902
case 'thorns':
1903
schoolIntro(doof);
1904
default:
1905
startCountdown();
1906
}
1907
} else {
1908
switch (curSong.toLowerCase()) {
1909
default:
1910
startCountdown();
1911
}
1912
}
1913
1914
super.create();
1915
}
1916
1917
function schoolIntro(?dialogueBox:DialogueBox):Void {
1918
var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);
1919
black.scrollFactor.set();
1920
add(black);
1921
1922
var red:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, 0xFFff1b31);
1923
red.scrollFactor.set();
1924
1925
var senpaiEvil:FlxSprite = new FlxSprite();
1926
senpaiEvil.frames = Paths.getSparrowAtlas('weeb/senpaiCrazy');
1927
senpaiEvil.animation.addByPrefix('idle', 'Senpai Pre Explosion', 24, false);
1928
senpaiEvil.setGraphicSize(Std.int(senpaiEvil.width * 6));
1929
senpaiEvil.scrollFactor.set();
1930
senpaiEvil.updateHitbox();
1931
senpaiEvil.screenCenter();
1932
1933
if (SONG.song.toLowerCase() == 'roses' || SONG.song.toLowerCase() == 'thorns') {
1934
remove(black);
1935
1936
if (SONG.song.toLowerCase() == 'thorns') {
1937
add(red);
1938
}
1939
}
1940
1941
new FlxTimer().start(0.3, function(cum:FlxTimer) {
1942
black.alpha -= 0.15;
1943
1944
if (black.alpha > 0) {
1945
cum.reset(0.3);
1946
} else {
1947
if (dialogueBox != null) {
1948
inCutscene = true;
1949
1950
if (SONG.song.toLowerCase() == 'thorns') {
1951
add(senpaiEvil);
1952
senpaiEvil.alpha = 0;
1953
new FlxTimer().start(0.3, function(swagTimer:FlxTimer) {
1954
senpaiEvil.alpha += 0.15;
1955
if (senpaiEvil.alpha < 1) {
1956
swagTimer.reset();
1957
} else {
1958
senpaiEvil.animation.play('idle');
1959
FlxG.sound.play(Paths.sound('Senpai_Dies'), 1, false, null, true, function() {
1960
remove(senpaiEvil);
1961
remove(red);
1962
FlxG.camera.fade(FlxColor.WHITE, 0.01, true, function() {
1963
add(dialogueBox);
1964
}, true);
1965
});
1966
new FlxTimer().start(3.2, function(deadTime:FlxTimer) {
1967
FlxG.camera.fade(FlxColor.WHITE, 1.6, false);
1968
});
1969
}
1970
});
1971
} else {
1972
add(dialogueBox);
1973
}
1974
} else
1975
startCountdown();
1976
1977
remove(black);
1978
}
1979
});
1980
}
1981
1982
var startTimer:FlxTimer;
1983
var perfectMode:Bool = false;
1984
1985
function startCountdown():Void {
1986
inCutscene = false;
1987
1988
generateStaticArrows(0);
1989
generateStaticArrows(1);
1990
1991
talking = false;
1992
startedCountdown = true;
1993
Conductor.songPosition = 0;
1994
Conductor.songPosition -= Conductor.crochet * 5;
1995
1996
var swagCounter:Int = 0;
1997
1998
startTimer = new FlxTimer().start(Conductor.crochet / 1000, function(cum:FlxTimer) {
1999
dad.dance();
2000
gf.dance();
2001
boyfriend.playAnim('idle');
2002
2003
var introAssets:Map<String, Array<String>> = new Map<String, Array<String>>();
2004
introAssets.set('default', ['ready', "set", "go"]);
2005
introAssets.set('school', ['weeb/pixelUI/ready-pixel', 'weeb/pixelUI/set-pixel', 'weeb/pixelUI/date-pixel']);
2006
introAssets.set('schoolEvil', ['weeb/pixelUI/ready-pixel', 'weeb/pixelUI/set-pixel', 'weeb/pixelUI/date-pixel']);
2007
2008
var introAlts:Array<String> = introAssets.get('default');
2009
var altSuffix:String = "";
2010
2011
for (value in introAssets.keys()) {
2012
if (value == curStage) {
2013
introAlts = introAssets.get(value);
2014
altSuffix = '-pixel';
2015
}
2016
}
2017
2018
switch (swagCounter) {
2019
case 0:
2020
FlxG.sound.play(Paths.sound('intro3'), 0.6);
2021
case 1:
2022
var ready:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[0]));
2023
ready.scrollFactor.set();
2024
ready.updateHitbox();
2025
2026
if (curStage.startsWith('school'))
2027
ready.setGraphicSize(Std.int(ready.width * daPixelZoom));
2028
2029
ready.screenCenter();
2030
add(ready);
2031
FlxTween.tween(ready, {y: ready.y += 100, alpha: 0}, Conductor.crochet / 1000, {
2032
ease: FlxEase.cubeInOut,
2033
onComplete: function(twn:FlxTween) {
2034
ready.destroy();
2035
}
2036
});
2037
FlxG.sound.play(Paths.sound('intro2'), 0.6);
2038
case 2:
2039
var set:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[1]));
2040
set.scrollFactor.set();
2041
2042
if (curStage.startsWith('school'))
2043
set.setGraphicSize(Std.int(set.width * daPixelZoom));
2044
2045
set.screenCenter();
2046
add(set);
2047
FlxTween.tween(set, {y: set.y += 100, alpha: 0}, Conductor.crochet / 1000, {
2048
ease: FlxEase.cubeInOut,
2049
onComplete: function(twn:FlxTween) {
2050
set.destroy();
2051
}
2052
});
2053
FlxG.sound.play(Paths.sound('intro1'), 0.6);
2054
case 3:
2055
var go:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[2]));
2056
go.scrollFactor.set();
2057
2058
if (curStage.startsWith('school'))
2059
go.setGraphicSize(Std.int(go.width * daPixelZoom));
2060
2061
go.updateHitbox();
2062
2063
go.screenCenter();
2064
add(go);
2065
FlxTween.tween(go, {y: go.y += 100, alpha: 0}, Conductor.crochet / 1000, {
2066
ease: FlxEase.cubeInOut,
2067
onComplete: function(twn:FlxTween) {
2068
go.destroy();
2069
}
2070
});
2071
FlxG.sound.play(Paths.sound('introGo'), 0.6);
2072
case 4:
2073
}
2074
2075
swagCounter += 1;
2076
// generateSong('fresh');
2077
}, 5);
2078
}
2079
2080
var previousFrameTime:Int = 0;
2081
var lastReportedPlayheadPosition:Int = 0;
2082
var songTime:Float = 0;
2083
2084
function startSong():Void {
2085
startingSong = false;
2086
2087
previousFrameTime = FlxG.game.ticks;
2088
lastReportedPlayheadPosition = 0;
2089
2090
if (!paused)
2091
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
2092
FlxG.sound.music.onComplete = endSong;
2093
vocals.play();
2094
2095
#if desktop
2096
// Song duration in a float, useful for the time left feature
2097
songLength = FlxG.sound.music.length;
2098
2099
// Updating Discord Rich Presence (with Time Left)
2100
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength);
2101
#end
2102
}
2103
2104
var debugNum:Int = 0;
2105
2106
private function generateSong(dataPath:String):Void {
2107
2108
var songData = SONG;
2109
Conductor.changeBPM(songData.bpm);
2110
2111
curSong = songData.song;
2112
2113
if (SONG.needsVoices)
2114
vocals = new FlxSound().loadEmbedded(Paths.voices(PlayState.SONG.song));
2115
else
2116
vocals = new FlxSound();
2117
2118
FlxG.sound.list.add(vocals);
2119
2120
notes = new FlxTypedGroup<Note>();
2121
add(notes);
2122
2123
var noteData:Array<SwagSection>;
2124
2125
// NEW SHIT
2126
noteData = songData.notes;
2127
2128
var playerCounter:Int = 0;
2129
2130
var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped
2131
2132
var curDenominator = Conductor.timeSignature[1];
2133
2134
for (section in noteData) {
2135
var coolSection:Int = Std.int(section.lengthInSteps / 4);
2136
2137
for (songNotes in section.sectionNotes) {
2138
var daStrumTime:Float = songNotes[0];
2139
var daNoteData:Int = Std.int(songNotes[1] % 4);
2140
2141
var gottaHitNote:Bool = section.mustHitSection;
2142
2143
if (songNotes[1] > 3) {
2144
gottaHitNote = !section.mustHitSection;
2145
}
2146
2147
var oldNote:Note;
2148
if (unspawnNotes.length > 0)
2149
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
2150
else
2151
oldNote = null;
2152
2153
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote);
2154
swagNote.sustainLength = songNotes[2];
2155
swagNote.scrollFactor.set(0, 0);
2156
2157
var susLength:Float = swagNote.sustainLength;
2158
2159
susLength = susLength / Conductor.stepCrochet;
2160
unspawnNotes.push(swagNote);
2161
2162
for (susNote in 0...Math.floor(susLength)) {
2163
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
2164
2165
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true);
2166
sustainNote.scrollFactor.set();
2167
unspawnNotes.push(sustainNote);
2168
2169
sustainNote.mustPress = gottaHitNote;
2170
2171
if (sustainNote.mustPress) {
2172
sustainNote.x += FlxG.width / 2; // general offset
2173
}
2174
}
2175
2176
swagNote.mustPress = gottaHitNote;
2177
2178
if (swagNote.mustPress) {
2179
swagNote.x += FlxG.width / 2; // general offset
2180
} else {}
2181
}
2182
daBeats += 1;
2183
}
2184
2185
unspawnNotes.sort(sortByShit);
2186
2187
generatedMusic = true;
2188
}
2189
2190
function sortByShit(Obj1:Note, Obj2:Note):Int {
2191
return FlxSort.byValues(FlxSort.ASCENDING, Obj1.strumTime, Obj2.strumTime);
2192
}
2193
2194
private function generateStaticArrows(player:Int):Void {
2195
for (i in 0...4) {
2196
var babyArrow:FlxSprite = new FlxSprite(0, strumLine.y);
2197
2198
switch (curStage) {
2199
case 'school' | 'schoolEvil':
2200
babyArrow.loadGraphic(Paths.image('weeb/pixelUI/arrows-pixels'), true, 17, 17);
2201
babyArrow.animation.add('green', [6]);
2202
babyArrow.animation.add('red', [7]);
2203
babyArrow.animation.add('blue', [5]);
2204
babyArrow.animation.add('purplel', [4]);
2205
2206
babyArrow.setGraphicSize(Std.int(babyArrow.width * daPixelZoom));
2207
babyArrow.updateHitbox();
2208
babyArrow.antialiasing = false;
2209
2210
switch (Math.abs(i)) {
2211
case 0:
2212
babyArrow.x += Note.swagWidth * 0;
2213
babyArrow.animation.add('static', [0]);
2214
babyArrow.animation.add('pressed', [4, 8], 12, false);
2215
babyArrow.animation.add('confirm', [12, 16], 24, false);
2216
case 1:
2217
babyArrow.x += Note.swagWidth * 1;
2218
babyArrow.animation.add('static', [1]);
2219
babyArrow.animation.add('pressed', [5, 9], 12, false);
2220
babyArrow.animation.add('confirm', [13, 17], 24, false);
2221
case 2:
2222
babyArrow.x += Note.swagWidth * 2;
2223
babyArrow.animation.add('static', [2]);
2224
babyArrow.animation.add('pressed', [6, 10], 12, false);
2225
babyArrow.animation.add('confirm', [14, 18], 12, false);
2226
case 3:
2227
babyArrow.x += Note.swagWidth * 3;
2228
babyArrow.animation.add('static', [3]);
2229
babyArrow.animation.add('pressed', [7, 11], 12, false);
2230
babyArrow.animation.add('confirm', [15, 19], 24, false);
2231
}
2232
2233
default:
2234
babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
2235
babyArrow.animation.addByPrefix('green', 'arrowUP');
2236
babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
2237
babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
2238
babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
2239
2240
babyArrow.antialiasing = true;
2241
babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
2242
2243
switch (Math.abs(i)) {
2244
case 0:
2245
babyArrow.x += Note.swagWidth * 0;
2246
babyArrow.animation.addByPrefix('static', 'arrowLEFT');
2247
babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
2248
babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
2249
case 1:
2250
babyArrow.x += Note.swagWidth * 1;
2251
babyArrow.animation.addByPrefix('static', 'arrowDOWN');
2252
babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
2253
babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
2254
case 2:
2255
babyArrow.x += Note.swagWidth * 2;
2256
babyArrow.animation.addByPrefix('static', 'arrowUP');
2257
babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
2258
babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
2259
case 3:
2260
babyArrow.x += Note.swagWidth * 3;
2261
babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
2262
babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
2263
babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
2264
}
2265
}
2266
2267
babyArrow.updateHitbox();
2268
babyArrow.scrollFactor.set();
2269
2270
if (!isStoryMode) {
2271
babyArrow.y -= 10;
2272
babyArrow.alpha = 0;
2273
FlxTween.tween(babyArrow, {y: babyArrow.y + 10, alpha: 1}, 1, {ease: FlxEase.circOut, startDelay: 0.5 + (0.2 * i)});
2274
}
2275
2276
babyArrow.ID = i;
2277
2278
if (player == 1) {
2279
playerStrums.add(babyArrow);
2280
}
2281
2282
babyArrow.animation.play('static');
2283
babyArrow.x += 50;
2284
babyArrow.x += ((FlxG.width / 2) * player);
2285
2286
strumLineNotes.add(babyArrow);
2287
}
2288
}
2289
2290
function tweenCamIn():Void {
2291
FlxTween.tween(FlxG.camera, {zoom: 1.3}, (Conductor.stepCrochet * 4 / 1000), {ease: FlxEase.elasticInOut});
2292
}
2293
2294
override function openSubState(SubState:FlxSubState) {
2295
if (paused) {
2296
if (FlxG.sound.music != null) {
2297
FlxG.sound.music.pause();
2298
vocals.pause();
2299
}
2300
2301
if (!startTimer.finished)
2302
startTimer.active = false;
2303
}
2304
2305
super.openSubState(SubState);
2306
}
2307
2308
override function closeSubState() {
2309
if (paused) {
2310
if (FlxG.sound.music != null && !startingSong) {
2311
resyncVocals();
2312
}
2313
2314
if (!startTimer.finished)
2315
startTimer.active = true;
2316
paused = false;
2317
2318
#if desktop
2319
if (startTimer.finished) {
2320
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition);
2321
} else {
2322
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
2323
}
2324
#end
2325
}
2326
2327
super.closeSubState();
2328
}
2329
2330
override public function onFocus():Void {
2331
#if desktop
2332
if (health > 0 && !paused) {
2333
if (Conductor.songPosition > 0.0) {
2334
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition);
2335
} else {
2336
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
2337
}
2338
}
2339
#end
2340
2341
super.onFocus();
2342
}
2343
2344
override public function onFocusLost():Void {
2345
#if desktop
2346
if (health > 0 && !paused) {
2347
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
2348
}
2349
#end
2350
2351
super.onFocusLost();
2352
}
2353
2354
function resyncVocals():Void {
2355
vocals.pause();
2356
2357
FlxG.sound.music.play();
2358
Conductor.songPosition = FlxG.sound.music.time;
2359
vocals.time = Conductor.songPosition;
2360
vocals.play();
2361
}
2362
2363
private var paused:Bool = false;
2364
var startedCountdown:Bool = false;
2365
var canPause:Bool = true;
2366
2367
override public function update(elapsed:Float) {
2368
#if !debug
2369
perfectMode = false;
2370
#end
2371
2372
if (FlxG.keys.justPressed.NINE) {
2373
if (iconP1.animation.curAnim.name == 'bf-old')
2374
iconP1.animation.play(SONG.player1);
2375
else
2376
iconP1.animation.play('bf-old');
2377
}
2378
2379
switch (curStage) {
2380
case 'philly':
2381
if (trainMoving) {
2382
trainFrameTiming += elapsed;
2383
2384
if (trainFrameTiming >= 1 / 24) {
2385
updateTrainPos();
2386
trainFrameTiming = 0;
2387
}
2388
}
2389
}
2390
2391
super.update(elapsed);
2392
2393
scoreTxt.text = "Score:" + songScore;
2394
2395
if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause) {
2396
persistentUpdate = false;
2397
persistentDraw = true;
2398
paused = true;
2399
2400
// 1 / 1000 chance for Gitaroo Man easter egg
2401
if (FlxG.random.bool(0.1)) {
2402
// gitaroo man easter egg
2403
FlxG.switchState(new GitarooPause());
2404
} else
2405
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
2406
2407
#if desktop
2408
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
2409
#end
2410
}
2411
2412
if (FlxG.keys.justPressed.SEVEN) {
2413
FlxG.switchState(new ChartingState());
2414
2415
#if desktop
2416
DiscordClient.changePresence("Chart Editor", null, null, true);
2417
#end
2418
}
2419
2420
// FlxG.watch.addQuick('VOL', vocals.amplitudeLeft);
2421
// FlxG.watch.addQuick('VOLRight', vocals.amplitudeRight);
2422
2423
iconP1.setGraphicSize(Std.int(FlxMath.lerp(150, iconP1.width, 0.50)));
2424
iconP2.setGraphicSize(Std.int(FlxMath.lerp(150, iconP2.width, 0.50)));
2425
2426
iconP1.updateHitbox();
2427
iconP2.updateHitbox();
2428
2429
var iconOffset:Int = 26;
2430
2431
iconP1.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01) - iconOffset);
2432
iconP2.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) - (iconP2.width - iconOffset);
2433
2434
if (health > 2)
2435
health = 2;
2436
2437
if (healthBar.percent < 20)
2438
iconP1.animation.curAnim.curFrame = 1;
2439
else
2440
iconP1.animation.curAnim.curFrame = 0;
2441
2442
if (healthBar.percent > 80)
2443
iconP2.animation.curAnim.curFrame = 1;
2444
else
2445
iconP2.animation.curAnim.curFrame = 0;
2446
2447
#if debug
2448
if (FlxG.keys.justPressed.EIGHT)
2449
FlxG.switchState(new AnimationDebug(SONG.player2));
2450
#end
2451
2452
if (startingSong) {
2453
if (startedCountdown) {
2454
Conductor.songPosition += FlxG.elapsed * 1000;
2455
if (Conductor.songPosition >= 0)
2456
startSong();
2457
}
2458
} else {
2459
// Conductor.songPosition = FlxG.sound.music.time;
2460
Conductor.songPosition += FlxG.elapsed * 1000;
2461
2462
if (!paused) {
2463
songTime += FlxG.game.ticks - previousFrameTime;
2464
previousFrameTime = FlxG.game.ticks;
2465
2466
// Interpolation type beat
2467
if (Conductor.lastSongPos != Conductor.songPosition) {
2468
songTime = (songTime + Conductor.songPosition) / 2;
2469
Conductor.lastSongPos = Conductor.songPosition;
2470
// Conductor.songPosition += FlxG.elapsed * 1000;
2471
// trace('MISSED FRAME');
2472
}
2473
}
2474
2475
// Conductor.lastSongPos = FlxG.sound.music.time;
2476
}
2477
2478
if (generatedMusic && PlayState.SONG.notes[Std.int(curStep / 16)] != null) {
2479
if (curBeat % 4 == 0) {
2480
// trace(PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection);
2481
}
2482
2483
if (camFollow.x != dad.getMidpoint().x + 150 && !PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection) {
2484
camFollow.setPosition(dad.getMidpoint().x + 150, dad.getMidpoint().y - 100);
2485
// camFollow.setPosition(lucky.getMidpoint().x - 120, lucky.getMidpoint().y + 210);
2486
2487
switch (dad.curCharacter) {
2488
case 'mom':
2489
camFollow.y = dad.getMidpoint().y;
2490
case 'senpai':
2491
camFollow.y = dad.getMidpoint().y - 430;
2492
camFollow.x = dad.getMidpoint().x - 100;
2493
case 'senpai-angry':
2494
camFollow.y = dad.getMidpoint().y - 430;
2495
camFollow.x = dad.getMidpoint().x - 100;
2496
}
2497
2498
if (dad.curCharacter == 'mom')
2499
vocals.volume = 1;
2500
2501
if (SONG.song.toLowerCase() == 'tutorial') {
2502
tweenCamIn();
2503
}
2504
}
2505
2506
if (PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection && camFollow.x != boyfriend.getMidpoint().x - 100) {
2507
camFollow.setPosition(boyfriend.getMidpoint().x - 100, boyfriend.getMidpoint().y - 100);
2508
2509
switch (curStage) {
2510
case 'limo':
2511
camFollow.x = boyfriend.getMidpoint().x - 300;
2512
case 'mall':
2513
camFollow.y = boyfriend.getMidpoint().y - 200;
2514
case 'school':
2515
camFollow.x = boyfriend.getMidpoint().x - 200;
2516
camFollow.y = boyfriend.getMidpoint().y - 200;
2517
case 'schoolEvil':
2518
camFollow.x = boyfriend.getMidpoint().x - 200;
2519
camFollow.y = boyfriend.getMidpoint().y - 200;
2520
}
2521
2522
if (SONG.song.toLowerCase() == 'tutorial') {
2523
FlxTween.tween(FlxG.camera, {zoom: 1}, (Conductor.stepCrochet * 4 / 1000), {ease: FlxEase.elasticInOut});
2524
}
2525
}
2526
}
2527
2528
if (camZooming) {
2529
FlxG.camera.zoom = FlxMath.lerp(defaultCamZoom, FlxG.camera.zoom, 0.95);
2530
camHUD.zoom = FlxMath.lerp(1, camHUD.zoom, 0.95);
2531
}
2532
2533
FlxG.watch.addQuick("beatShit", curBeat);
2534
FlxG.watch.addQuick("stepShit", curStep);
2535
2536
if (curSong == 'Fresh') {
2537
switch (curBeat) {
2538
case 16:
2539
camZooming = true;
2540
gfSpeed = 2;
2541
case 48:
2542
gfSpeed = 1;
2543
case 80:
2544
gfSpeed = 2;
2545
case 112:
2546
gfSpeed = 1;
2547
case 163:
2548
// FlxG.sound.music.stop();
2549
// FlxG.switchState(new TitleState());
2550
}
2551
}
2552
2553
if (curSong == 'Bopeebo') {
2554
switch (curBeat) {
2555
case 128, 129, 130:
2556
vocals.volume = 0;
2557
// FlxG.sound.music.stop();
2558
// FlxG.switchState(new PlayState());
2559
}
2560
}
2561
// better streaming of shit
2562
2563
// RESET = Quick Game Over Screen
2564
if (controls.RESET) {
2565
health = 0;
2566
trace("RESET = True");
2567
}
2568
2569
// CHEAT = brandon's a pussy
2570
if (controls.CHEAT) {
2571
health += 1;
2572
trace("User is cheating!");
2573
}
2574
2575
if (health <= 0) {
2576
boyfriend.stunned = true;
2577
2578
persistentUpdate = false;
2579
persistentDraw = false;
2580
paused = true;
2581
2582
vocals.stop();
2583
FlxG.sound.music.stop();
2584
2585
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
2586
2587
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
2588
2589
#if desktop
2590
// Game Over doesn't get his own variable because it's only used here
2591
DiscordClient.changePresence("Game Over - " + detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
2592
#end
2593
}
2594
2595
if (unspawnNotes[0] != null) {
2596
if (unspawnNotes[0].strumTime - Conductor.songPosition < 1500) {
2597
var dunceNote:Note = unspawnNotes[0];
2598
notes.add(dunceNote);
2599
2600
var index:Int = unspawnNotes.indexOf(dunceNote);
2601
unspawnNotes.splice(index, 1);
2602
}
2603
}
2604
2605
if (generatedMusic) {
2606
notes.forEachAlive(function(daNote:Note) {
2607
if (daNote.y > FlxG.height) {
2608
daNote.active = false;
2609
daNote.visible = false;
2610
} else {
2611
daNote.visible = true;
2612
daNote.active = true;
2613
}
2614
2615
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
2616
2617
// i am so fucking sorry for this if condition
2618
if (daNote.isSustainNote
2619
&& daNote.y + daNote.offset.y <= strumLine.y + Note.swagWidth / 2
2620
&& (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))) {
2621
var swagRect = new FlxRect(0, strumLine.y + Note.swagWidth / 2 - daNote.y, daNote.width * 2, daNote.height * 2);
2622
swagRect.y /= daNote.scale.y;
2623
swagRect.height -= swagRect.y;
2624
2625
daNote.clipRect = swagRect;
2626
}
2627
2628
if (!daNote.mustPress && daNote.wasGoodHit) {
2629
if (SONG.song != 'Tutorial')
2630
camZooming = true;
2631
2632
var altAnim:String = "";
2633
2634
if (SONG.notes[Math.floor(curStep / 16)] != null) {
2635
if (SONG.notes[Math.floor(curStep / 16)].altAnim)
2636
altAnim = '-alt';
2637
}
2638
2639
switch (Math.abs(daNote.noteData)) {
2640
case 0:
2641
dad.playAnim('singLEFT' + altAnim, true);
2642
case 1:
2643
dad.playAnim('singDOWN' + altAnim, true);
2644
case 2:
2645
dad.playAnim('singUP' + altAnim, true);
2646
case 3:
2647
dad.playAnim('singRIGHT' + altAnim, true);
2648
}
2649
2650
dad.holdTimer = 0;
2651
2652
if (SONG.needsVoices)
2653
vocals.volume = 1;
2654
2655
daNote.kill();
2656
notes.remove(daNote, true);
2657
daNote.destroy();
2658
}
2659
2660
// WIP interpolation shit? Need to fix the pause issue
2661
// daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * PlayState.SONG.speed));
2662
2663
if (daNote.y < -daNote.height) {
2664
if (daNote.tooLate || !daNote.wasGoodHit) {
2665
health -= 0.0475;
2666
vocals.volume = 0;
2667
}
2668
2669
daNote.active = false;
2670
daNote.visible = false;
2671
2672
daNote.kill();
2673
notes.remove(daNote, true);
2674
daNote.destroy();
2675
}
2676
});
2677
}
2678
2679
if (!inCutscene)
2680
keyShit();
2681
2682
#if debug
2683
if (FlxG.keys.justPressed.ONE)
2684
endSong();
2685
#end
2686
}
2687
2688
function endSong():Void {
2689
canPause = false;
2690
FlxG.sound.music.volume = 0;
2691
vocals.volume = 0;
2692
if (SONG.validScore) {
2693
#if !switch
2694
Highscore.saveScore(SONG.song, songScore, storyDifficulty);
2695
#end
2696
}
2697
2698
if (isStoryMode) {
2699
campaignScore += songScore;
2700
2701
storyPlaylist.remove(storyPlaylist[0]);
2702
2703
if (storyPlaylist.length <= 0) {
2704
FlxG.sound.playMusic(Paths.music('freakyMenu'));
2705
2706
transIn = FlxTransitionableState.defaultTransIn;
2707
transOut = FlxTransitionableState.defaultTransOut;
2708
2709
FlxG.switchState(new StoryMenuState());
2710
2711
// if ()
2712
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
2713
2714
if (SONG.validScore) {
2715
NGio.unlockMedal(60961);
2716
Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
2717
}
2718
2719
FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked;
2720
FlxG.save.flush();
2721
} else {
2722
var difficulty:String = "";
2723
2724
if (storyDifficulty == 0)
2725
difficulty = '-easy';
2726
2727
if (storyDifficulty == 2)
2728
difficulty = '-hard';
2729
2730
trace('LOADING NEXT SONG');
2731
trace(PlayState.storyPlaylist[0].toLowerCase() + difficulty);
2732
2733
if (SONG.song.toLowerCase() == 'eggnog') {
2734
var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom,
2735
-FlxG.height * FlxG.camera.zoom).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK);
2736
blackShit.scrollFactor.set();
2737
add(blackShit);
2738
camHUD.visible = false;
2739
2740
FlxG.sound.play(Paths.sound('Lights_Shut_off'));
2741
}
2742
2743
FlxTransitionableState.skipNextTransIn = true;
2744
FlxTransitionableState.skipNextTransOut = true;
2745
prevCamFollow = camFollow;
2746
2747
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]);
2748
FlxG.sound.music.stop();
2749
2750
LoadingState.loadAndSwitchState(new PlayState());
2751
}
2752
} else {
2753
trace('WENT BACK TO FREEPLAY??');
2754
FlxG.switchState(new FreeplayState());
2755
}
2756
}
2757
2758
var endingSong:Bool = false;
2759
2760
private function popUpScore(strumtime:Float):Void {
2761
var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition);
2762
// boyfriend.playAnim('hey');
2763
vocals.volume = 1;
2764
2765
var placement:String = Std.string(combo);
2766
2767
var coolText:FlxText = new FlxText(0, 0, 0, placement, 32);
2768
coolText.screenCenter();
2769
coolText.x = FlxG.width * 0.55;
2770
//
2771
2772
var rating:FlxSprite = new FlxSprite();
2773
var score:Int = 350;
2774
2775
var daRating:String = "sick";
2776
2777
if (noteDiff > Conductor.safeZoneOffset * 0.9) {
2778
daRating = 'shit';
2779
score = 50;
2780
} else if (noteDiff > Conductor.safeZoneOffset * 0.75) {
2781
daRating = 'bad';
2782
score = 100;
2783
} else if (noteDiff > Conductor.safeZoneOffset * 0.2) {
2784
daRating = 'good';
2785
score = 200;
2786
}
2787
2788
songScore += score;
2789
2790
/* if (combo > 60)
2791
daRating = 'sick';
2792
else if (combo > 12)
2793
daRating = 'good'
2794
else if (combo > 4)
2795
daRating = 'bad';
2796
*/
2797
2798
var pixelShitPart1:String = "";
2799
var pixelShitPart2:String = '';
2800
2801
if (curStage.startsWith('school')) {
2802
pixelShitPart1 = 'weeb/pixelUI/';
2803
pixelShitPart2 = '-pixel';
2804
}
2805
2806
rating.loadGraphic(Paths.image(pixelShitPart1 + daRating + pixelShitPart2));
2807
rating.screenCenter();
2808
rating.x = coolText.x - 40;
2809
rating.y -= 60;
2810
rating.acceleration.y = 550;
2811
rating.velocity.y -= FlxG.random.int(140, 175);
2812
rating.velocity.x -= FlxG.random.int(0, 10);
2813
2814
var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2));
2815
comboSpr.screenCenter();
2816
comboSpr.x = coolText.x;
2817
comboSpr.acceleration.y = 600;
2818
comboSpr.velocity.y -= 150;
2819
2820
comboSpr.velocity.x += FlxG.random.int(1, 10);
2821
add(rating);
2822
2823
if (!curStage.startsWith('school')) {
2824
rating.setGraphicSize(Std.int(rating.width * 0.7));
2825
rating.antialiasing = true;
2826
comboSpr.setGraphicSize(Std.int(comboSpr.width * 0.7));
2827
comboSpr.antialiasing = true;
2828
} else {
2829
rating.setGraphicSize(Std.int(rating.width * daPixelZoom * 0.7));
2830
comboSpr.setGraphicSize(Std.int(comboSpr.width * daPixelZoom * 0.7));
2831
}
2832
2833
comboSpr.updateHitbox();
2834
rating.updateHitbox();
2835
2836
var seperatedScore:Array<Int> = [];
2837
2838
seperatedScore.push(Math.floor(combo / 100));
2839
seperatedScore.push(Math.floor((combo - (seperatedScore[0] * 100)) / 10));
2840
seperatedScore.push(combo % 10);
2841
2842
var daLoop:Int = 0;
2843
for (i in seperatedScore) {
2844
var numScore:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'num' + Std.int(i) + pixelShitPart2));
2845
numScore.screenCenter();
2846
numScore.x = coolText.x + (43 * daLoop) - 90;
2847
numScore.y += 80;
2848
2849
if (!curStage.startsWith('school')) {
2850
numScore.antialiasing = true;
2851
numScore.setGraphicSize(Std.int(numScore.width * 0.5));
2852
} else {
2853
numScore.setGraphicSize(Std.int(numScore.width * daPixelZoom));
2854
}
2855
numScore.updateHitbox();
2856
2857
numScore.acceleration.y = FlxG.random.int(200, 300);
2858
numScore.velocity.y -= FlxG.random.int(140, 160);
2859
numScore.velocity.x = FlxG.random.float(-5, 5);
2860
2861
if (combo >= 10 || combo == 0)
2862
add(numScore);
2863
2864
FlxTween.tween(numScore, {alpha: 0}, 0.2, {
2865
onComplete: function(tween:FlxTween) {
2866
numScore.destroy();
2867
},
2868
startDelay: Conductor.crochet * 0.002
2869
});
2870
2871
daLoop++;
2872
}
2873
/*
2874
trace(combo);
2875
trace(seperatedScore);
2876
*/
2877
2878
coolText.text = Std.string(seperatedScore);
2879
// add(coolText);
2880
2881
FlxTween.tween(rating, {alpha: 0}, 0.2, {
2882
startDelay: Conductor.crochet * 0.001
2883
});
2884
2885
FlxTween.tween(comboSpr, {alpha: 0}, 0.2, {
2886
onComplete: function(tween:FlxTween) {
2887
coolText.destroy();
2888
comboSpr.destroy();
2889
2890
rating.destroy();
2891
},
2892
startDelay: Conductor.crochet * 0.001
2893
});
2894
2895
curSection += 1;
2896
}
2897
2898
private function keyShit():Void {
2899
// HOLDING
2900
var up = controls.UP;
2901
var right = controls.RIGHT;
2902
var down = controls.DOWN;
2903
var left = controls.LEFT;
2904
2905
var upP = controls.UP_P;
2906
var rightP = controls.RIGHT_P;
2907
var downP = controls.DOWN_P;
2908
var leftP = controls.LEFT_P;
2909
2910
var upR = controls.UP_R;
2911
var rightR = controls.RIGHT_R;
2912
var downR = controls.DOWN_R;
2913
var leftR = controls.LEFT_R;
2914
2915
var controlArray:Array<Bool> = [leftP, downP, upP, rightP];
2916
2917
// FlxG.watch.addQuick('asdfa', upP);
2918
if ((upP || rightP || downP || leftP) && !boyfriend.stunned && generatedMusic) {
2919
boyfriend.holdTimer = 0;
2920
2921
var possibleNotes:Array<Note> = [];
2922
2923
var ignoreList:Array<Int> = [];
2924
2925
notes.forEachAlive(function(daNote:Note) {
2926
if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit) {
2927
// the sorting probably doesn't need to be in here? who cares lol
2928
possibleNotes.push(daNote);
2929
possibleNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
2930
2931
ignoreList.push(daNote.noteData);
2932
}
2933
});
2934
2935
if (possibleNotes.length > 0) {
2936
var daNote = possibleNotes[0];
2937
2938
if (perfectMode)
2939
noteCheck(true, daNote);
2940
2941
// Jump notes
2942
if (possibleNotes.length >= 2) {
2943
if (possibleNotes[0].strumTime == possibleNotes[1].strumTime) {
2944
for (coolNote in possibleNotes) {
2945
if (controlArray[coolNote.noteData])
2946
goodNoteHit(coolNote);
2947
else {
2948
var inIgnoreList:Bool = false;
2949
for (shit in 0...ignoreList.length) {
2950
if (controlArray[ignoreList[shit]])
2951
inIgnoreList = true;
2952
}
2953
if (!inIgnoreList)
2954
badNoteCheck();
2955
}
2956
}
2957
} else if (possibleNotes[0].noteData == possibleNotes[1].noteData) {
2958
noteCheck(controlArray[daNote.noteData], daNote);
2959
} else {
2960
for (coolNote in possibleNotes) {
2961
noteCheck(controlArray[coolNote.noteData], coolNote);
2962
}
2963
}
2964
} else // regular notes?
2965
{
2966
noteCheck(controlArray[daNote.noteData], daNote);
2967
}
2968
/*
2969
if (controlArray[daNote.noteData])
2970
goodNoteHit(daNote);
2971
*/
2972
// trace(daNote.noteData);
2973
/*
2974
switch (daNote.noteData)
2975
{
2976
case 2: // NOTES YOU JUST PRESSED
2977
if (upP || rightP || downP || leftP)
2978
noteCheck(upP, daNote);
2979
case 3:
2980
if (upP || rightP || downP || leftP)
2981
noteCheck(rightP, daNote);
2982
case 1:
2983
if (upP || rightP || downP || leftP)
2984
noteCheck(downP, daNote);
2985
case 0:
2986
if (upP || rightP || downP || leftP)
2987
noteCheck(leftP, daNote);
2988
}
2989
2990
//this is already done in noteCheck / goodNoteHit
2991
if (daNote.wasGoodHit)
2992
{
2993
daNote.kill();
2994
notes.remove(daNote, true);
2995
daNote.destroy();
2996
}
2997
*/
2998
} else {
2999
badNoteCheck();
3000
}
3001
}
3002
3003
if ((up || right || down || left) && !boyfriend.stunned && generatedMusic) {
3004
notes.forEachAlive(function(daNote:Note) {
3005
if (daNote.canBeHit && daNote.mustPress && daNote.isSustainNote) {
3006
switch (daNote.noteData) {
3007
// NOTES YOU ARE HOLDING
3008
case 0:
3009
if (left)
3010
goodNoteHit(daNote);
3011
case 1:
3012
if (down)
3013
goodNoteHit(daNote);
3014
case 2:
3015
if (up)
3016
goodNoteHit(daNote);
3017
case 3:
3018
if (right)
3019
goodNoteHit(daNote);
3020
}
3021
}
3022
});
3023
}
3024
3025
if (boyfriend.holdTimer > Conductor.stepCrochet * 4 * 0.001 && !up && !down && !right && !left) {
3026
if (boyfriend.animation.curAnim.name.startsWith('sing') && !boyfriend.animation.curAnim.name.endsWith('miss')) {
3027
boyfriend.playAnim('idle');
3028
}
3029
}
3030
3031
playerStrums.forEach(function(spr:FlxSprite) {
3032
switch (spr.ID) {
3033
case 0:
3034
if (leftP && spr.animation.curAnim.name != 'confirm')
3035
spr.animation.play('pressed');
3036
if (leftR)
3037
spr.animation.play('static');
3038
case 1:
3039
if (downP && spr.animation.curAnim.name != 'confirm')
3040
spr.animation.play('pressed');
3041
if (downR)
3042
spr.animation.play('static');
3043
case 2:
3044
if (upP && spr.animation.curAnim.name != 'confirm')
3045
spr.animation.play('pressed');
3046
if (upR)
3047
spr.animation.play('static');
3048
case 3:
3049
if (rightP && spr.animation.curAnim.name != 'confirm')
3050
spr.animation.play('pressed');
3051
if (rightR)
3052
spr.animation.play('static');
3053
}
3054
3055
if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) {
3056
spr.centerOffsets();
3057
spr.offset.x -= 13;
3058
spr.offset.y -= 13;
3059
} else
3060
spr.centerOffsets();
3061
});
3062
}
3063
3064
function noteMiss(direction:Int = 1):Void {
3065
if (!boyfriend.stunned) {
3066
health -= 0.04;
3067
if (combo > 5 && gf.animOffsets.exists('sad')) {
3068
gf.playAnim('sad');
3069
}
3070
combo = 0;
3071
3072
songScore -= 10;
3073
3074
FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
3075
// FlxG.sound.play(Paths.sound('missnote1'), 1, false);
3076
// FlxG.log.add('played imss note');
3077
3078
boyfriend.stunned = true;
3079
3080
// get stunned for 5 seconds
3081
new FlxTimer().start(5 / 60, function(cum:FlxTimer) {
3082
boyfriend.stunned = false;
3083
});
3084
3085
switch (direction) {
3086
case 0:
3087
boyfriend.playAnim('singLEFTmiss', true);
3088
case 1:
3089
boyfriend.playAnim('singDOWNmiss', true);
3090
case 2:
3091
boyfriend.playAnim('singUPmiss', true);
3092
case 3:
3093
boyfriend.playAnim('singRIGHTmiss', true);
3094
}
3095
}
3096
}
3097
3098
function badNoteCheck() {
3099
// just double pasting this shit cuz fuk u
3100
// REDO THIS SYSTEM!
3101
var upP = controls.UP_P;
3102
var rightP = controls.RIGHT_P;
3103
var downP = controls.DOWN_P;
3104
var leftP = controls.LEFT_P;
3105
3106
if (leftP)
3107
noteMiss(0);
3108
if (downP)
3109
noteMiss(1);
3110
if (upP)
3111
noteMiss(2);
3112
if (rightP)
3113
noteMiss(3);
3114
}
3115
3116
function noteCheck(keyP:Bool, note:Note):Void {
3117
if (keyP)
3118
goodNoteHit(note);
3119
else {
3120
badNoteCheck();
3121
}
3122
}
3123
3124
function goodNoteHit(note:Note):Void {
3125
if (!note.wasGoodHit) {
3126
if (!note.isSustainNote) {
3127
popUpScore(note.strumTime);
3128
combo += 1;
3129
}
3130
3131
if (note.noteData >= 0)
3132
health += 0.023;
3133
else
3134
health += 0.004;
3135
3136
switch (note.noteData) {
3137
case 0:
3138
boyfriend.playAnim('singLEFT', true);
3139
case 1:
3140
boyfriend.playAnim('singDOWN', true);
3141
case 2:
3142
boyfriend.playAnim('singUP', true);
3143
case 3:
3144
boyfriend.playAnim('singRIGHT', true);
3145
}
3146
3147
playerStrums.forEach(function(spr:FlxSprite) {
3148
if (Math.abs(note.noteData) == spr.ID) {
3149
spr.animation.play('confirm', true);
3150
}
3151
});
3152
3153
note.wasGoodHit = true;
3154
vocals.volume = 1;
3155
3156
if (!note.isSustainNote) {
3157
note.kill();
3158
notes.remove(note, true);
3159
note.destroy();
3160
}
3161
}
3162
}
3163
3164
var fastCarCanDrive:Bool = true;
3165
3166
function resetFastCar():Void {
3167
fastCar.x = -12600;
3168
fastCar.y = FlxG.random.int(140, 250);
3169
fastCar.velocity.x = 0;
3170
fastCarCanDrive = true;
3171
}
3172
3173
function fastCarDrive() {
3174
FlxG.sound.play(Paths.soundRandom('carPass', 0, 1), 0.7);
3175
3176
fastCar.velocity.x = (FlxG.random.int(170, 220) / FlxG.elapsed) * 3;
3177
fastCarCanDrive = false;
3178
new FlxTimer().start(2, function(cum:FlxTimer) {
3179
resetFastCar();
3180
});
3181
}
3182
3183
var trainMoving:Bool = false;
3184
var trainFrameTiming:Float = 0;
3185
3186
var trainCars:Int = 8;
3187
var trainFinishing:Bool = false;
3188
var trainCooldown:Int = 0;
3189
3190
function trainStart():Void {
3191
trainMoving = true;
3192
if (!trainSound.playing)
3193
trainSound.play(true);
3194
}
3195
3196
var startedMoving:Bool = false;
3197
3198
function updateTrainPos():Void {
3199
if (trainSound.time >= 4700) {
3200
startedMoving = true;
3201
gf.playAnim('hairBlow');
3202
}
3203
3204
if (startedMoving) {
3205
phillyTrain.x -= 400;
3206
3207
if (phillyTrain.x < -2000 && !trainFinishing) {
3208
phillyTrain.x = -1150;
3209
trainCars -= 1;
3210
3211
if (trainCars <= 0)
3212
trainFinishing = true;
3213
}
3214
3215
if (phillyTrain.x < -4000 && trainFinishing)
3216
trainReset();
3217
}
3218
}
3219
3220
function trainReset():Void {
3221
gf.playAnim('hairFall');
3222
phillyTrain.x = FlxG.width + 200;
3223
trainMoving = false;
3224
// trainSound.stop();
3225
// trainSound.time = 0;
3226
trainCars = 8;
3227
trainFinishing = false;
3228
startedMoving = false;
3229
}
3230
3231
function lightningStrikeShit():Void {
3232
FlxG.sound.play(Paths.soundRandom('thunder_', 1, 2));
3233
halloweenBG.animation.play('lightning');
3234
3235
lightningStrikeBeat = curBeat;
3236
lightningOffset = FlxG.random.int(8, 24);
3237
3238
boyfriend.playAnim('scared', true);
3239
gf.playAnim('scared', true);
3240
}
3241
3242
override function stepHit() {
3243
super.stepHit();
3244
if (FlxG.sound.music.time > Conductor.songPosition + 20 || FlxG.sound.music.time < Conductor.songPosition - 20) {
3245
resyncVocals();
3246
}
3247
3248
if (dad.curCharacter == 'spooky' && curStep % 4 == 2) {
3249
// dad.dance();
3250
}
3251
}
3252
3253
var lightningStrikeBeat:Int = 0;
3254
var lightningOffset:Int = 8;
3255
3256
override function beatHit() {
3257
super.beatHit();
3258
3259
if (generatedMusic) {
3260
notes.sort(FlxSort.byY, FlxSort.DESCENDING);
3261
}
3262
3263
if (SONG.notes[Math.floor(curStep / 16)] != null) {
3264
if (SONG.notes[Math.floor(curStep / 16)].changeBPM) {
3265
Conductor.changeBPM(SONG.notes[Math.floor(curStep / 16)].bpm);
3266
FlxG.log.add('CHANGED BPM!');
3267
}
3268
// else
3269
// Conductor.changeBPM(SONG.bpm);
3270
3271
// Dad doesnt interupt his own notes
3272
if (SONG.notes[Math.floor(curStep / 16)].mustHitSection)
3273
dad.dance();
3274
}
3275
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
3276
wiggleShit.update(Conductor.crochet);
3277
3278
// HARDCODING FOR MILF ZOOMS!
3279
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat < 200 && camZooming && FlxG.camera.zoom < 1.35) {
3280
FlxG.camera.zoom += 0.015;
3281
camHUD.zoom += 0.03;
3282
}
3283
3284
if (camZooming && FlxG.camera.zoom < 1.35 && curBeat % camBeat == 0) {
3285
FlxG.camera.zoom += 0.015;
3286
camHUD.zoom += 0.03;
3287
}
3288
3289
iconP1.setGraphicSize(Std.int(iconP1.width + 30));
3290
iconP2.setGraphicSize(Std.int(iconP2.width + 30));
3291
3292
iconP1.updateHitbox();
3293
iconP2.updateHitbox();
3294
3295
if (curBeat % gfSpeed == 0) {
3296
gf.dance();
3297
}
3298
3299
if (!boyfriend.animation.curAnim.name.startsWith("sing")) {
3300
boyfriend.playAnim('idle');
3301
}
3302
3303
if (curBeat % 8 == 7 && curSong == 'Bopeebo') {
3304
boyfriend.playAnim('hey', true);
3305
}
3306
3307
if (curBeat % 16 == 15 && SONG.song == 'Tutorial' && dad.curCharacter == 'gf' && curBeat > 16 && curBeat < 48) {
3308
boyfriend.playAnim('hey', true);
3309
dad.playAnim('cheer', true);
3310
}
3311
3312
switch (curStage) {
3313
case 'school':
3314
bgGirls.dance();
3315
3316
case 'mall':
3317
upperBoppers.animation.play('bop', true);
3318
bottomBoppers.animation.play('bop', true);
3319
santa.animation.play('idle', true);
3320
3321
case 'limo':
3322
grpLimoDancers.forEach(function(dancer:BackgroundDancer) {
3323
dancer.dance();
3324
});
3325
3326
if (FlxG.random.bool(10) && fastCarCanDrive)
3327
fastCarDrive();
3328
case "philly":
3329
if (!trainMoving)
3330
trainCooldown += 1;
3331
3332
if (curBeat % 4 == 0) {
3333
phillyCityLights.forEach(function(light:FlxSprite) {
3334
light.visible = false;
3335
});
3336
3337
curLight = FlxG.random.int(0, phillyCityLights.length - 1);
3338
3339
phillyCityLights.members[curLight].visible = true;
3340
// phillyCityLights.members[curLight].alpha = 1;
3341
}
3342
3343
if (curBeat % 8 == 4 && FlxG.random.bool(30) && !trainMoving && trainCooldown > 8) {
3344
trainCooldown = FlxG.random.int(-4, 0);
3345
trainStart();
3346
}
3347
}
3348
3349
if (isHalloween && FlxG.random.bool(10) && curBeat > lightningStrikeBeat + lightningOffset) {
3350
lightningStrikeShit();
3351
}
3352
}
3353
3354
var curLight:Int = 0;
3355
}
3356
}
3357
3358