public bool MoveTo(ITile tile) { if (tile == null) return false; if (this.tile == tile) return false; if (tile.IsBlocked == false || this.IsFlying) { if (this.isTileMovement) { this.destinationRectangle.Location = tile.Rectangle.Location; this.rectangle.Location = tile.Rectangle.Location; this.position = tile.Position; } this.Tile.RemoveEntity(this); tile.AddEntity(this); return true; } return false; }
void SpawnZombie(ITile tile) { if (!tile.IsBlocked) { ZombieEntity entity = new ZombieEntity(tile, zombieTexture, Color.White, true); tile.AddEntity(entity); } }