train in progress

This commit is contained in:
Cameron Taylor committed 2020-12-10 18:23:53 -05:00
1 parent 60f53dccca
commit 19ed82aa0d
17 files changed
+141 -2

No files matched your search

Binary file not shown.
+1
View File
@@ -0,0 +1 @@
{"song":{"song":"Blammed","notes":[{"lengthInSteps":16,"bpm":95,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[11818.181818181818,1,0],[12000.000000000002,3,0],[12181.818181818182,0,0],[12363.636363636366,0,0],[12545.454545454546,1,0],[12727.27272727273,3,157.89473684210526]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[13090.90909090909,2,0],[13272.72727272727,0,0],[13454.545454545454,2,0],[13636.363636363634,3,0],[13727.272727272726,0,0],[13818.181818181818,3,0],[13999.999999999998,3,0],[14181.818181818182,1,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[14727.272727272726,1,0],[14909.09090909091,3,0],[15090.90909090909,0,0],[15272.727272727274,0,0],[15454.545454545454,1,0],[15818.181818181818,2,0],[15636.363636363638,3,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[15999.999999999998,3,0],[16454.545454545456,3,0],[16181.818181818178,1,236.8421052631579],[16636.363636363632,2,0],[16818.181818181816,1,157.89473684210526],[17000,3,0],[17181.818181818177,1,157.89473684210526]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[[17636.363636363636,1,0],[17818.18181818182,3,0],[18000,0,0],[18181.818181818184,0,0],[18363.636363636364,1,0],[18545.454545454548,3,157.89473684210526]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[[18909.090909090908,2,0],[19090.90909090909,0,0],[19272.727272727272,2,0],[19454.545454545452,3,0],[19545.454545454544,0,0],[19636.363636363636,3,0],[19818.181818181816,3,0],[20000,1,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[[20545.454545454544,1,0],[20727.272727272728,3,0],[20909.090909090908,0,0],[21090.909090909092,0,0],[21272.727272727272,1,0],[21636.363636363636,2,0],[21454.545454545456,3,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[[21818.181818181816,3,0],[22272.727272727272,3,0],[21999.999999999996,1,236.8421052631579],[22454.545454545452,2,0],[22636.363636363636,1,157.89473684210526],[22818.181818181816,3,0],[22999.999999999996,1,157.89473684210526]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[23454.54545454545,2,0],[23636.363636363632,3,0],[23818.181818181816,3,0],[24000,2,0],[24181.818181818177,0,0],[24363.63636363636,3,0],[24545.454545454544,1,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[24727.272727272728,3,0],[24909.090909090904,1,0],[25090.90909090909,0,0],[25272.727272727272,1,0],[25454.545454545456,2,0],[25636.363636363632,3,0],[25818.181818181816,0,0],[26000,1,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[26363.63636363636,2,0],[26545.454545454544,3,0],[26727.272727272728,3,0],[26909.09090909091,1,0],[27090.909090909096,0,0],[27272.727272727272,3,0],[27454.545454545456,2,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":false,"sectionNotes":[[27636.36363636364,3,0],[27818.181818181823,0,0],[28000,1,0],[28181.818181818184,1,0],[28363.636363636368,3,0],[28545.45454545455,2,0],[28727.272727272728,0,0],[28909.09090909091,1,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[[29272.72727272727,2,0],[29454.545454545452,3,0],[29636.363636363632,3,0],[29818.181818181816,2,0],[29999.999999999996,0,0],[30181.81818181818,3,0],[30363.63636363636,1,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHitSection":true,"sectionNotes":[[30545.454545454544,3,0],[30727.272727272724,1,0],[30909.090909090908,0,0],[31090.90909090909,1,0],[31272.727272727272,2,0],[31454.545454545452,3,0],[31636.363636363636,0,0],[31818.181818181816,1,0]],"typeOfSection":0},{"lengthInSteps":16,"bpm":165,"changeBPM":false,"mustHiLine truncated
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -12,7 +12,7 @@ import lime.utils.Assets;
class FreeplayState extends MusicBeatState class FreeplayState extends MusicBeatState
{ {
var songs:Array<String> = ["Pico", "Bopeebo", "Dadbattle", "Fresh", "Tutorial"]; var songs:Array<String> = ["Pico", "Blammed", "Bopeebo", "Dadbattle", "Fresh", "Tutorial"];
var selector:FlxText; var selector:FlxText;
var curSelected:Int = 0; var curSelected:Int = 0;
+138
View File
@@ -35,6 +35,7 @@ using StringTools;
class PlayState extends MusicBeatState class PlayState extends MusicBeatState
{ {
public static var curLevel:String = 'Tutorial'; public static var curLevel:String = 'Tutorial';
public static var curStage:String = '';
public static var SONG:SwagSong; public static var SONG:SwagSong;
public static var isStoryMode:Bool = false; public static var isStoryMode:Bool = false;
public static var storyWeek:Int = 0; public static var storyWeek:Int = 0;
@@ -81,6 +82,10 @@ class PlayState extends MusicBeatState
var halloweenBG:FlxSprite; var halloweenBG:FlxSprite;
var isHalloween:Bool = false; var isHalloween:Bool = false;
var phillyCityLights:FlxTypedGroup<FlxSprite>;
var phillyTrain:FlxSprite;
var trainSound:FlxSound;
var talking:Bool = true; var talking:Bool = true;
var songScore:Int = 0; var songScore:Int = 0;
var scoreTxt:FlxText; var scoreTxt:FlxText;
@@ -144,6 +149,47 @@ class PlayState extends MusicBeatState
isHalloween = true; isHalloween = true;
} }
else if (SONG.song.toLowerCase() == 'pico' || SONG.song.toLowerCase() == 'blammed')
{
curStage = 'philly';
var bg:FlxSprite = new FlxSprite(-100).loadGraphic(AssetPaths.sky__png);
bg.scrollFactor.set(0.1, 0.1);
add(bg);
var city:FlxSprite = new FlxSprite(-10).loadGraphic(AssetPaths.city__png);
city.scrollFactor.set(0.3, 0.3);
city.setGraphicSize(Std.int(city.width * 0.85));
city.updateHitbox();
add(city);
phillyCityLights = new FlxTypedGroup<FlxSprite>();
add(phillyCityLights);
for (i in 0...5)
{
var light:FlxSprite = new FlxSprite(city.x).loadGraphic('assets/images/philly/win' + i + '.png');
light.scrollFactor.set(0.3, 0.3);
light.visible = false;
light.setGraphicSize(Std.int(light.width * 0.85));
light.updateHitbox();
phillyCityLights.add(light);
}
var streetBehind:FlxSprite = new FlxSprite(-40, 50).loadGraphic(AssetPaths.behindTrain__png);
add(streetBehind);
phillyTrain = new FlxSprite(2000, 300).loadGraphic(AssetPaths.train__png);
add(phillyTrain);
trainSound = new FlxSound().loadEmbedded('assets/sounds/train_passes' + TitleState.soundExt);
FlxG.sound.list.add(trainSound);
// var cityLights:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.win0__png);
var street:FlxSprite = new FlxSprite(-40, streetBehind.y).loadGraphic(AssetPaths.street__png);
add(street);
}
else else
{ {
var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(AssetPaths.stageback__png); var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(AssetPaths.stageback__png);
@@ -200,6 +246,7 @@ class PlayState extends MusicBeatState
case 'dad': case 'dad':
camPos.x += 400; camPos.x += 400;
case 'pico': case 'pico':
camPos.x += 600;
dad.y += 300; dad.y += 300;
} }
@@ -598,6 +645,23 @@ class PlayState extends MusicBeatState
override public function update(elapsed:Float) override public function update(elapsed:Float)
{ {
switch (curStage)
{
case 'philly':
if (trainMoving)
{
trainFrameTiming += elapsed;
if (trainFrameTiming >= 1 / 24)
{
updateTrainPos();
trainFrameTiming = 0;
}
}
phillyCityLights.members[curLight].alpha -= (Conductor.crochet / 1000) * FlxG.elapsed;
}
super.update(elapsed); super.update(elapsed);
scoreTxt.text = "Score:" + songScore; scoreTxt.text = "Score:" + songScore;
@@ -1308,6 +1372,56 @@ class PlayState extends MusicBeatState
} }
} }
var trainMoving:Bool = false;
var trainFrameTiming:Float = 0;
var trainCars:Int = 8;
var trainFinishing:Bool = false;
function trainStart():Void
{
trainMoving = true;
if (!trainSound.playing)
trainSound.play(true);
}
var startedMoving:Bool = false;
function updateTrainPos():Void
{
if (trainSound.time >= 4700)
{
startedMoving = true;
}
if (startedMoving)
{
phillyTrain.x -= 400;
if (phillyTrain.x < -2000 && !trainFinishing)
{
phillyTrain.x = -1150;
trainCars -= 1;
if (trainCars <= 0)
trainFinishing = true;
}
if (phillyTrain.x < 0 && trainFinishing)
trainReset();
}
}
function trainReset():Void
{
phillyTrain.x = FlxG.width + 200;
trainMoving = false;
// trainSound.stop();
// trainSound.time = 0;
trainCars = 8;
startedMoving = false;
}
function lightningStrikeShit():Void function lightningStrikeShit():Void
{ {
FlxG.sound.play('assets/sounds/thunder_' + FlxG.random.int(1, 2) + TitleState.soundExt); FlxG.sound.play('assets/sounds/thunder_' + FlxG.random.int(1, 2) + TitleState.soundExt);
@@ -1396,9 +1510,33 @@ class PlayState extends MusicBeatState
} }
} }
switch (curStage)
{
case "philly":
if (totalBeats % 4 == 0)
{
phillyCityLights.forEach(function(light:FlxSprite)
{
light.visible = false;
});
curLight = FlxG.random.int(0, phillyCityLights.length - 1);
phillyCityLights.members[curLight].visible = true;
phillyCityLights.members[curLight].alpha = 1;
}
if (totalBeats % 8 == 4 && FlxG.random.bool(40) && !trainMoving)
{
trainStart();
}
}
if (isHalloween && FlxG.random.bool(10) && curBeat > lightningStrikeBeat + lightningOffset) if (isHalloween && FlxG.random.bool(10) && curBeat > lightningStrikeBeat + lightningOffset)
{ {
lightningStrikeShit(); lightningStrikeShit();
} }
} }
var curLight:Int = 0;
} }
+1 -1
View File
@@ -69,7 +69,7 @@ class TitleState extends MusicBeatState
} }
#if SKIP_TO_PLAYSTATE #if SKIP_TO_PLAYSTATE
FlxG.switchState(new ChartingState()); FlxG.switchState(new FreeplayState());
#else #else
startIntro(); startIntro();
#end #end