private Tile LoadSparkyTile(int x, int y) { GameObjectList enemies = this.Find("enemies") as GameObjectList; TileField tiles = this.Find("tiles") as TileField; Sparky enemy = new Sparky((y + 1) * tiles.CellHeight - 100f); enemy.Position = new Vector2(((float)x + 0.5f) * tiles.CellWidth, (y + 1) * tiles.CellHeight - 100f); enemies.Add(enemy); return(new Tile()); }
private Tile LoadSparkyTile(int x, int y) { GameObjectList enemies = this.Find("enemies") as GameObjectList; TileField tiles = this.Find("tiles") as TileField; Sparky enemy = new Sparky((y + 1) * tiles.CellHeight - 100f); enemy.Position = new Vector2(((float)x + 0.5f) * tiles.CellWidth, (y + 1) * tiles.CellHeight - 100f); enemies.Add(enemy); return new Tile(); }
void LoadSparkyEnemy(int x, int y) { Sparky s = new Sparky(this, GetCellBottomCenter(x, y)); AddChild(s); }