bg dancers coded

This commit is contained in:
Cameron Taylor 2020-12-27 03:13:51 -05:00
parent b07372aa8e
commit 05fcb4fb74
5 changed files with 52 additions and 8 deletions

View File

@ -48,7 +48,6 @@ class Alphabet extends FlxSpriteGroup
this.text = text;
isBold = bold;
if (text != "")
{
if (typed)
@ -73,13 +72,13 @@ class Alphabet extends FlxSpriteGroup
// {
// }
if (character == " ")
if (character == " " || character == "-")
{
lastWasSpace = true;
}
if (AlphaCharacter.alphabet.indexOf(character.toLowerCase()) != -1)
//if (AlphaCharacter.alphabet.contains(character.toLowerCase()))
// if (AlphaCharacter.alphabet.contains(character.toLowerCase()))
{
if (lastSprite != null)
{
@ -123,7 +122,6 @@ class Alphabet extends FlxSpriteGroup
_finalText = text;
doSplitWords();
// trace(arrayShit);
var loopNum:Int = 0;
@ -140,7 +138,6 @@ class Alphabet extends FlxSpriteGroup
xPosResetted = true;
xPos = 0;
curRow += 1;
}
if (splitWords[loopNum] == " ")
@ -157,7 +154,7 @@ class Alphabet extends FlxSpriteGroup
#end
if (AlphaCharacter.alphabet.indexOf(splitWords[loopNum].toLowerCase()) != -1 || isNumber || isSymbol)
//if (AlphaCharacter.alphabet.contains(splitWords[loopNum].toLowerCase()) || isNumber || isSymbol)
// if (AlphaCharacter.alphabet.contains(splitWords[loopNum].toLowerCase()) || isNumber || isSymbol)
{
if (lastSprite != null && !xPosResetted)

View File

@ -0,0 +1,30 @@
package;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
class BackgroundDancer extends FlxSprite
{
public function new(x:Float, y:Float)
{
super(x, y);
frames = FlxAtlasFrames.fromSparrow(AssetPaths.limoDancer__png, AssetPaths.limoDancer__xml);
animation.addByIndices('danceLeft', 'bg dancer sketch PINK', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
animation.addByIndices('danceRight', 'bg dancer sketch PINK', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
animation.play('danceLeft');
antialiasing = true;
}
var danceDir:Bool = false;
public function dance():Void
{
danceDir = !danceDir;
if (danceDir)
animation.play('danceRight', true);
else
animation.play('danceLeft', true);
}
}

View File

@ -12,7 +12,7 @@ import lime.utils.Assets;
class FreeplayState extends MusicBeatState
{
var songs:Array<String> = ["High", "Milf", "Bopeebo", "Dadbattle", "Fresh", "Tutorial"];
var songs:Array<String> = ["Satin-Panties", "High", "Milf", "Bopeebo", "Dadbattle", "Fresh", "Tutorial"];
var selector:FlxText;
var curSelected:Int = 0;

View File

@ -19,6 +19,7 @@ class HealthIcon extends FlxSprite
animation.add('face', [10, 11], 0, false, isPlayer);
animation.add('dad', [12, 13], 0, false, isPlayer);
animation.add('bf-old', [14, 15], 0, false, isPlayer);
animation.add('gf', [16], 0, false, isPlayer);
animation.play(char);
scrollFactor.set();
}

View File

@ -90,6 +90,7 @@ class PlayState extends MusicBeatState
var trainSound:FlxSound;
var limo:FlxSprite;
var grpLimoDancers:FlxTypedGroup<BackgroundDancer>;
var talking:Bool = true;
var songScore:Int = 0;
@ -209,11 +210,21 @@ class PlayState extends MusicBeatState
var bgLimo:FlxSprite = new FlxSprite(-200, 400);
bgLimo.frames = FlxAtlasFrames.fromSparrow(AssetPaths.bgLimo__png, AssetPaths.bgLimo__xml);
bgLimo.animation.addByPrefix('drive', "BG limo", 24);
bgLimo.animation.addByPrefix('drive', "background limo pink", 24);
bgLimo.animation.play('drive');
bgLimo.scrollFactor.set(0.4, 0.4);
add(bgLimo);
grpLimoDancers = new FlxTypedGroup<BackgroundDancer>();
add(grpLimoDancers);
for (i in 0...5)
{
var dancer:BackgroundDancer = new BackgroundDancer((370 * i) + 130, 20);
dancer.scrollFactor.set(0.4, 0.4);
grpLimoDancers.add(dancer);
}
var overlayShit:FlxSprite = new FlxSprite(-500, -600).loadGraphic(AssetPaths.limoOverlay__png);
overlayShit.alpha = 0.5;
// add(overlayShit);
@ -1621,6 +1632,11 @@ class PlayState extends MusicBeatState
switch (curStage)
{
case 'limo':
grpLimoDancers.forEach(function(dancer:BackgroundDancer)
{
dancer.dance();
});
case "philly":
if (!trainMoving)
trainCooldown += 1;