summaryrefslogtreecommitdiffstats
path: root/Robofactor/Voiture.pde
blob: fb280e3685c5775ed9fa487a2f4ae83e023498c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
      }
    }
  }
}