summaryrefslogtreecommitdiffstats
path: root/Robofactor/Boite.pde
blob: c6fcfaa1bd687fdba26d1a8155dba52f5236ae12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class Boite extends Entite{
  
  //variables 
  
  //fct
  Boite(int startRangee, int xDepart, int startVitesse){
    rangee = startRangee;
    x = xDepart;
    xBloc = xDepart;
    vitesse = startVitesse;
  }
    
  void afficher(){
    image (avatar, x,(100+200*rangee)-(avatar.height/2));
  }
  
  void collision(Heros heros, Score score) {
    if (this.getx()-85 <= heros.getx() && this.getx()+avatar.width>=heros.getx() && this.getRangee() == heros.getRangee()){
      x = -200;
      score.augmenter(10);
    }
  }
}