summaryrefslogtreecommitdiffstats
path: root/Robofactor/Voiture.pde
diff options
context:
space:
mode:
Diffstat (limited to 'Robofactor/Voiture.pde')
-rw-r--r--Robofactor/Voiture.pde20
1 files changed, 20 insertions, 0 deletions
diff --git a/Robofactor/Voiture.pde b/Robofactor/Voiture.pde
new file mode 100644
index 0000000..fb280e3
--- /dev/null
+++ b/Robofactor/Voiture.pde
@@ -0,0 +1,20 @@
+public class Voiture extends Ennemi{
+ //variables
+ Voiture(int startRangee, int xDepart, int vitesseDepart){
+ super(startRangee, xDepart);
+ avatar = loadImage("Carf.png");
+ vitesse = vitesseDepart;
+ y = (100+200*rangee)-(avatar.height/2);
+ }
+ //fonctions
+
+ void collision(Heros heros){
+
+ if(x <= heros.getx()+heros.getAvatar().width && x>=0){
+ if(y >= heros.gety() && y <= heros.gety()+heros.getAvatar().height){
+ heros.setIsDead(true);
+ heros.deplacerY(3);
+ }
+ }
+ }
+}