public void Draw(SpriteBatch spritebatch) { if (LocalPlayer.Hitbox.X <= 400) { spritebatch.Draw(background, new Rectangle(0, 0, 800, 480), Color.White); } else if (LocalPlayer.Hitbox.X >= 4200) { spritebatch.Draw(background, new Rectangle(3800, 0, 800, 480), Color.White); } else { spritebatch.Draw(background, new Rectangle(LocalPlayer.Hitbox.X + LocalPlayer.Hitbox.Width / 2 - 400, 0, 800, 480), Color.White); } for (int i = 0; i <= 2; i++) { spritebatch.Draw(foreground, new Rectangle(1600 * i, 0, 1600, 480), Color.White); } LocalPlayer.Draw(spritebatch); foreach (Enemy enemy in enemies) { enemy.Draw(spritebatch); } foreach (Enemy2 enemy2 in enemies2) { enemy2.Draw(spritebatch); } foreach (Boss dragon in boss) { if (!dragon.isDead) { dragon.Draw(spritebatch); } } foreach (Wall wall in Walls) { wall.Draw(spritebatch); } foreach (Bonus b in bonus) { b.Draw(spritebatch); } foreach (Piques p in piques) { p.Draw(spritebatch); spritebatch.Draw(Resources.Lave, p.Hitbox, new Rectangle((framecolumn - 1) * 64, 0, p.Hitbox.Width, p.Hitbox.Height), Color.White, 0f, new Vector2(0, 0), SpriteEffects.None, 0f); } foreach (HealthBonus hb in healthbonus) { hb.Draw(spritebatch); } foreach (VitesseBonus sb in speedbonus) { sb.Draw(spritebatch); } if (golave) { foreach (Flames flame in flames) { flame.Draw(spritebatch); } } }
public void Draw(SpriteBatch spritebatch) { if (LocalPlayer.Hitbox.X <= 400) { spritebatch.Draw(background, new Rectangle(0, 0, 800, 480), Color.White); } else if (LocalPlayer.Hitbox.X >= 4200) { spritebatch.Draw(background, new Rectangle(3800, 0, 800, 480), Color.White); } else { spritebatch.Draw(background, new Rectangle(LocalPlayer.Hitbox.X + LocalPlayer.Hitbox.Width / 2 - 400, 0, 800, 480), Color.White); } for (int i = 0; i <= 2; i++) { spritebatch.Draw(foreground, new Rectangle(1600 * i, 0, 1600, 480), Color.White); } LocalPlayer.Draw(spritebatch); foreach (Enemy enemy in enemies) { enemy.Draw(spritebatch); } foreach (Enemy2 enemy2 in enemies2) { enemy2.Draw(spritebatch); } foreach (Wall wall in Walls) { wall.Draw(spritebatch); } //draw zone ralentie foreach (LowSpeedArea lsa in lowspeedarea) { lsa.Draw(spritebatch); } foreach (Bonus b in bonus) { b.Draw(spritebatch); } foreach (MovingHorizontallyWall mhw in movinghorizontallywalls) { mhw.Draw(spritebatch); } foreach (HealthBonus hb in healthbonus) { hb.Draw(spritebatch); } foreach (VitesseBonus sb in speedbonus) { sb.Draw(spritebatch); } }