Modification du samedi 20/03/21 (Ani d'Arthaud)
This commit is contained in:
parent
c414c8c96c
commit
457ae004c4
|
|
@ -44,7 +44,7 @@ class Misile {
|
|||
}
|
||||
|
||||
void tomber() {
|
||||
y += 14; //ont peut changer cette variable(le nombre de la variable)pour changer la vitesse des missiles enemis.
|
||||
y += 4; //ont peut changer cette variable(le nombre de la variable)pour changer la vitesse des missiles enemis.
|
||||
}
|
||||
|
||||
void affiche_et_mets_a_jour_le_missile() {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ class Alien2 {
|
|||
|
||||
int blob, blob2;
|
||||
int x,y;
|
||||
int enemypv = 2;
|
||||
int enemypv;
|
||||
boolean show;
|
||||
double random;
|
||||
int randomy,randomx;
|
||||
int NUMEROXEPLO = 0;
|
||||
PImage enemy_explo;
|
||||
|
||||
|
|
@ -21,16 +21,18 @@ class Alien2 {
|
|||
|
||||
void alea_bouge(){
|
||||
|
||||
random = Math.random()*(0-20)-10;
|
||||
frameRate(500);
|
||||
if (frameCount % 500 == 0) {
|
||||
x = blob;
|
||||
y = blob;
|
||||
println ("blob = "+blob);
|
||||
randomy = (int) random(0,900);
|
||||
randomx = (int) random(0,1600);
|
||||
frameRate(600);
|
||||
if (frameCount % 600 == 0) {
|
||||
x = randomx;
|
||||
y = randomy;
|
||||
println ("random = "+randomy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void apparaitre() {
|
||||
|
||||
//affiche l'anime de explosion :
|
||||
|
|
@ -58,7 +60,7 @@ class Alien2 {
|
|||
|
||||
// on luis enleve un point de vie
|
||||
enemypv = enemypv - 1;
|
||||
y = y - 20;
|
||||
y = y - 50;
|
||||
|
||||
//suprime le missile
|
||||
lancermisile = false;
|
||||
|
|
@ -76,18 +78,22 @@ class Alien2 {
|
|||
y = y - 20;
|
||||
}
|
||||
|
||||
if ( nombreEnemiReste == 0 && boss_pv == 0) {
|
||||
|
||||
}
|
||||
|
||||
//le mechant disparait si il a plus de vie :
|
||||
if ( enemypv == 0 ) {
|
||||
show = false;
|
||||
}
|
||||
}
|
||||
|
||||
public double random(){
|
||||
random = Math.random()*(10-4);
|
||||
return random;
|
||||
}
|
||||
//public int random(){
|
||||
// random = (int) Math.random()*(10-4);
|
||||
// return random;
|
||||
//}
|
||||
|
||||
double cooldown_fonce = random();
|
||||
int cooldown_fonce = (int)random(10);
|
||||
|
||||
/*
|
||||
//le if doit etre dans une fonction ou une class ou void ...
|
||||
|
|
@ -103,6 +109,7 @@ class Alien2 {
|
|||
void affiche_et_mets_a_jour_les_mechants() {
|
||||
verifiercollisions();
|
||||
apparaitre();
|
||||
alea_bouge();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ int nombreEnemik = 20;
|
|||
int nombreEnemiReste = nombreEnemi;
|
||||
Alien [] a = new Alien[nombreEnemi];
|
||||
Misile [] b = new Misile[nombreEnemi];
|
||||
Alien2 [] c = new Alien2[1];
|
||||
Alien2 [] c = new Alien2[3];
|
||||
|
||||
//Etat de deplacement: 0 = aucun deplacement en cours
|
||||
int moveXp = 0; // 1 si deplacement vers le bas
|
||||
|
|
@ -90,7 +90,9 @@ void setup() {
|
|||
//a[i] = new Alien (100+(j*150), k*100, 3, "mechant_tres_mechant150x150.png");
|
||||
}
|
||||
|
||||
c[0] = new Alien2(800,350,10,"mechant_tres_mechant150x150.png");
|
||||
c[0] = new Alien2(800,350,20,"mechant_tres_mechant150x150.png");
|
||||
c[1] = new Alien2(1200,350,20,"mechant_tres_mechant150x150.png");
|
||||
c[2] = new Alien2(400,350,20,"mechant_tres_mechant150x150.png");
|
||||
|
||||
//on crée des misiles
|
||||
for (int i = 0; i<nombreEnemi; i++) {
|
||||
|
|
@ -168,6 +170,8 @@ void setup() {
|
|||
|
||||
// met a jour les méchants très méchants
|
||||
c[0].affiche_et_mets_a_jour_les_mechants();
|
||||
c[1].affiche_et_mets_a_jour_les_mechants();
|
||||
c[2].affiche_et_mets_a_jour_les_mechants();
|
||||
|
||||
|
||||
// Affiche l'image du vaiseau
|
||||
|
|
|
|||
Loading…
Reference in New Issue