commentaires

This commit is contained in:
2026-03-28 16:37:07 +01:00
parent 5660a6c5c6
commit 4ed39dd92a
5 changed files with 19 additions and 11 deletions

View File

@@ -14,18 +14,19 @@ public class Bonus extends ObjetCollectible {
@Override protected int getSeuilActivation() { return 220; }
@Override protected Color getCouleurCapture() { return Color.BLUE; }
@Override protected Color getCouleurCapture() { return Color.BLUE; } // couleur après avoir été ramasssé
@Override
protected double calculerY(double hauteurLigne) {
if (Math.random() > 0.5) return hauteurLigne - 10 - (Math.random() * 50);
if (Math.random() > 0.5) return hauteurLigne - 10 - (Math.random() * 50); // position du bonus
else return hauteurLigne + 10 + (Math.random() * 50);
}
@Override
protected void appliquerEffet(Joueur joueur) {
if (!monJeu.cheatMode) joueur.ajouterVie();
}
} // En cheat mode, le bonus ne sert à rien (on a déjà l'invincibilité)
@Override
protected void dessiner(Graphics g) {