/// <summary> /// Instantiates a gem and puts it in the level. /// </summary> private Tile LoadGemTile(int x, int y, TipoGem tipoGem) { Point position = GetBounds(x, y).Center; gems.Add(new Gem(this, new Vector2(position.X, position.Y), tipoGem)); return(new Tile(null, TileCollision.Passable)); }
/// <summary> /// Constructs a new gem. /// </summary> public Gem(Level level, Vector2 position, TipoGem tipoGem) { this.level = level; this.basePosition = position; this.tipoGem = tipoGem; switch (tipoGem) { case TipoGem.Normal: { PointValue = 30; Color = Color.Yellow; break; } case TipoGem.PowerUp: { PointValue = 100; Color = Color.White; break; } case TipoGem.Live: { PointValue = 0; Color = Color.Red; break; } case TipoGem.Dead: { PointValue = 0; Color = Color.Black; break; } case TipoGem.PowerDown: { PointValue = -50; Color = Color.Purple; break; } default: break; } LoadContent(); }