public override void Draw(SpriteBatch spriteBatch) { var transformMatrix = camera.GetViewMatrix(); spriteBatch.Begin(transformMatrix: transformMatrix); map.Draw(spriteBatch); player.Draw(spriteBatch); goal.Draw(spriteBatch); foreach (Enemy e in enemies) { e.Draw(spriteBatch); } foreach (LockedWall lw in lockedWalls) { lw.Draw(spriteBatch); } if (showKey == true) { key.Draw(spriteBatch); } if (show1up == true) { extralife.Draw(spriteBatch); } spriteBatch.End(); spriteBatch.Begin(); spriteBatch.DrawString(ventureFont, "Score : " + score.ToString("f0"), new Vector2(20, 10), Color.White); spriteBatch.DrawString(ventureFont, timer.ToString("f0"), new Vector2((ScreenWidth / 2), 10), Color.White); for (int i = 0; i < lives; i++) { spriteBatch.Draw(heart, new Vector2(ScreenWidth - 30 - i * 20, 10), Color.White); } spriteBatch.End(); }
public void DrawMap(SpriteBatch sb, Camera camera) { foreach (Wall wall in m_ListWalls) { wall.Draw(sb, camera); } foreach (Spike spik in m_ListSpikes) { spik.Draw(sb, camera); } m_Goal.Draw(sb, camera); }