Modif bonus vitesse pour qu'il suive la taille
bonus a mm vitesse que ligne, baisser le randomness de la position du bonus
This commit is contained in:
@@ -40,7 +40,8 @@ public class Bonus extends ObjetGraphique {
|
|||||||
compteurFrames++;
|
compteurFrames++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compteurFrames >= 300 && !actif) {
|
|
||||||
|
if (compteurFrames >= 220 && !actif) {
|
||||||
|
|
||||||
actif = true;
|
actif = true;
|
||||||
dejaCapture = false;
|
dejaCapture = false;
|
||||||
@@ -53,9 +54,9 @@ public class Bonus extends ObjetGraphique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Math.random() > 0.5) {
|
if (Math.random() > 0.5) {
|
||||||
y = hauteurLigne - 80 - (Math.random() * 50);
|
y = hauteurLigne - 10 - (Math.random() * 50);
|
||||||
} else {
|
} else {
|
||||||
y = hauteurLigne + 30 + (Math.random() * 20);
|
y = hauteurLigne + 10 + (Math.random() * 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y < 20) y = 20;
|
if (y < 20) y = 20;
|
||||||
@@ -65,13 +66,12 @@ public class Bonus extends ObjetGraphique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (actif) {
|
if (actif) {
|
||||||
x -= 10;
|
double vitesseLigne = monJeu.gestionnaireNiveau.getVitesseScroll();
|
||||||
|
x -= vitesseLigne;
|
||||||
|
|
||||||
|
|
||||||
double centreX = x + (taille / 2.0);
|
double centreX = x + (taille / 2.0);
|
||||||
|
|
||||||
if (centreX <= monCercle.x && centreX > monCercle.x - 10) {
|
if (centreX <= monCercle.x && centreX > monCercle.x - vitesseLigne) {
|
||||||
|
|
||||||
double hautCercle = monCercle.y - monCercle.getRayon();
|
double hautCercle = monCercle.y - monCercle.getRayon();
|
||||||
double basCercle = monCercle.y + monCercle.getRayon();
|
double basCercle = monCercle.y + monCercle.getRayon();
|
||||||
@@ -85,6 +85,7 @@ public class Bonus extends ObjetGraphique {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. Quand il sort de l'écran, on le désactive pour relancer le chrono !
|
||||||
if (x + taille < 0) {
|
if (x + taille < 0) {
|
||||||
actif = false;
|
actif = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user