public void Draw(Vector2 pos, SpriteBatch spriteBatch, TextureList textureList) { foreach (Explosion explosion in _spawnedExplosions) { spriteBatch.Draw(explosion.GetTextureFromList(textureList), (explosion.GetPos() + pos), null, Color.White, 0, explosion.GetOrigin(), 1f, SpriteEffects.None, 0f); } }
public void Draw(Vector2 pos, SpriteBatch spriteBatch, TextureList textureList) { foreach (Projectile projectile in _spawnedProjectiles) { spriteBatch.Draw(projectile.GetTextureFromList(textureList), (projectile.GetPos() + pos), null, Color.White, projectile.GetRotation(), projectile.GetOrigin(), 1f, SpriteEffects.None, 0f); } }
public void Draw(Vector2 pos, SpriteBatch spriteBatch, TextureList textureList) { Tile tileAtPos; Vector2 tilepos = new Vector2(0, 0); for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { tilepos.X = x * _tileWidth; tilepos.Y = y * _tileHeight; tileAtPos = GetTileAtPosition(x, y); if (tileAtPos != null) { if (tileAtPos.GetUntouched()) { spriteBatch.Draw(tileAtPos.GetTextureFromList(textureList), tilepos + pos, Color.White); } else { if (tileAtPos.GetTextureIndexDestroyed() > -1) { spriteBatch.Draw(tileAtPos.GetTextureDestroyedFromList(textureList), tilepos + pos, Color.White); } if (!tileAtPos.GetLeftUpDestroyed()) { spriteBatch.Draw(tileAtPos.GetTextureFromList(textureList), tilepos + pos, null, new Rectangle(0, 0, 4, 4)); } if (!tileAtPos.GetRightUpDestroyed()) { spriteBatch.Draw(tileAtPos.GetTextureFromList(textureList), tilepos + pos + new Vector2(4, 0), null, new Rectangle(4, 0, 4, 4)); } if (!tileAtPos.GetLeftDownDestroyed()) { spriteBatch.Draw(tileAtPos.GetTextureFromList(textureList), tilepos + pos + new Vector2(0, 4), null, new Rectangle(0, 4, 4, 4)); } if (!tileAtPos.GetRightDownDestroyed()) { spriteBatch.Draw(tileAtPos.GetTextureFromList(textureList), tilepos + pos + new Vector2(4, 4), null, new Rectangle(4, 4, 4, 4)); } } } } } }
public Texture2D GetTextureFromList(TextureList textureList) { return(GetSlide().GetTextureFromList(textureList)); }
public Texture2D GetTextureFromList(TextureList textureList) { return(textureList.GetTextureFromIndex(_textureIndex)); }
public Texture2D GetTextureDestroyedFromList(TextureList textureList) { return(textureList.GetTextureFromIndex(_textureIndexDestroyed)); }