示例#1
0
 public Enemy(int x, int y, int type, Level l, bool forceSandToSpawn = false)
     : base(new Vector2(Level.TEX_SIZE * l.xPos + (x * Level.TILE_SIZE) + Level.TILE_SIZE / 2, Level.TEX_SIZE * l.yPos + (y * Level.TILE_SIZE) + Level.TILE_SIZE / 2), new Hitbox(32, 32))
 {
     level = l;
     tileX = x;
     tileY = y;
     this.forceSandToSpawn = forceSandToSpawn;
     this.type             = type;
     this.setTexture("enemy" + (type + 1));
     id           = idCounter++;
     health       = STARTING_HEALTH;
     scale        = 0.5f;
     deathEmitter = Emitter.getPrebuiltEmitter(PrebuiltEmitter.EnemyDeathExplosion);
     idleAI       = new TurnInPlaceAI((float)RetroGame.rand.NextDouble() * 2, RetroGame.rand.Next(5));
     targetedAI   = new HeroChaseAI(true);
 }
示例#2
0
 public Enemy(int x, int y, int type, Level l, bool forceSandToSpawn = false)
     : base(new Vector2(Level.TEX_SIZE * l.xPos + (x * Level.TILE_SIZE) + Level.TILE_SIZE / 2, Level.TEX_SIZE * l.yPos + (y * Level.TILE_SIZE) + Level.TILE_SIZE / 2), new Hitbox(32, 32))
 {
     level = l;
     tileX = x;
     tileY = y;
     this.forceSandToSpawn = forceSandToSpawn;
     this.type = type;
     this.setTexture("enemy" + (type + 1));
     id = idCounter++;
     health = STARTING_HEALTH;
     scale = 0.5f;
     deathEmitter = Emitter.getPrebuiltEmitter(PrebuiltEmitter.EnemyDeathExplosion);
     idleAI = new TurnInPlaceAI((float)RetroGame.rand.NextDouble() * 2, RetroGame.rand.Next(5));
     targetedAI = new HeroChaseAI(true);
 }