tnakmen in progres lol

This commit is contained in:
Cameron Taylor 2021-03-16 01:51:23 -04:00
parent a55dcdc69c
commit eba2639638
3 changed files with 49 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View file

@ -113,6 +113,8 @@ class PlayState extends MusicBeatState
var bgGirls:BackgroundGirls;
var wiggleShit:WiggleEffect = new WiggleEffect();
var tankmanRun:FlxTypedGroup<TankmenBG>;
var talking:Bool = true;
var songScore:Int = 0;
var scoreTxt:FlxText;
@ -499,6 +501,9 @@ class PlayState extends MusicBeatState
var tankGround:BGSprite = new BGSprite('tankGround', -200, -20);
add(tankGround);
tankmanRun = new FlxTypedGroup<TankmenBG>();
add(tankmanRun);
var fgTank0:BGSprite = new BGSprite('tank0', -290, 400, 1.7, 1.5, ['fg']);
foregroundSprites.add(fgTank0);
@ -1538,6 +1543,10 @@ class PlayState extends MusicBeatState
if (generatedMusic)
{
notes.forEachAlive(function(daNote:Note)
{
if (daNote.y > FlxG.height)

40
source/TankmenBG.hx Normal file
View file

@ -0,0 +1,40 @@
package;
import flixel.FlxG;
import haxe.display.Display.Package;
import flixel.FlxSprite;
class TankmenBG extends FlxSprite
{
public var strumTime:Float = 0;
public var goingRight:Bool = false;
public function new(x:Float, y:Float)
{
super(x, y);
frames = Paths.getSparrowAtlas('tankmanKilled1');
antialiasing = true;
animation.addByPrefix('run', 'tankman running', 24, true);
animation.addByPrefix('shot', 'John', 24, false);
animation.play('run');
}
override function update(elapsed:Float) {
super.update(elapsed);
var endDirection:Float = FlxG.width * 0.3;
if (goingRight)
endDirection = FlxG.width * 0.6;
x = (endDirection - (Conductor.songPosition - strumTime) * 0.45);
if (animation.curAnim.name == 'run' && animation.curAnim.finished)
{
kill();
}
}
}