예제 #1
0
 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);
 }
예제 #2
0
 public override void Update()
 {
     Statemachine.Update();
     if (!isDead)
     {
         updateExtension();
     }
 }
예제 #3
0
 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);
     }
 }