Beispiel #1
0
 private void setAction(EnemyData.Behavior behavior)
 {
     if (behavior == EnemyData.Behavior.DoNothing)
         currentAction = doNothing;
     else if (behavior == EnemyData.Behavior.Follow)
         currentAction = follow;
     else if (behavior == EnemyData.Behavior.RunAway)
         currentAction = runAway;
     else if (behavior == EnemyData.Behavior.Die)
         currentAction = die;
 }
Beispiel #2
0
 public override void Restore(Vector2 tilePosition, SpriteSheet spriteSheet, ObjectDataBase enemyData)
 {
     isCreated = true;
     isDead = false;
     lastFrameReached = false;
     destinationReached = true;
     this.tilePosition = tilePosition;
     currentDestination = tilePosition;
     this.enemyData = enemyData as EnemyData;
     shadowTexture = Board.Instance.EffectsFactory.GetTexture(this.enemyData.ShadowId);
     setAction(EnemyData.Behavior.DoNothing);
     base.Restore(tilePosition * Board.TILE_SIZE, spriteSheet, enemyData);
     random = new Random();
 }
 private EnemyProcessor()
 {
     enemyData = new EnemyData();
 }