public void initAnimations(String jsonname, Texture texture) { PlayerTexture = texture; PlayerSprite = new Sprite(PlayerTexture); PlayerSprite.Origin += new Vector2f(16, 16); Statemachine = new Statemachine(this, jsonname, texture); }
public override void Update() { Statemachine.Update(); if (!isDead) { updateExtension(); } }
public void Follow() { if (Path.Count >= 4) { MoveAndRotateTo(Path[1]); if (Math.Abs(Path[1].XSim - this.body.Position.X) < 0.1 && Math.Abs(Path[1].YSim - this.body.Position.Y) < 0.1) { Path.Remove(Path.First()); } } else { // body.LinearVelocity = new Vector2(0, 0); attackMove(); Statemachine.triggerAttack(0); } }