From bf359cf55f492a997b44ac689b26b16f75768372 Mon Sep 17 00:00:00 2001 From: Sticmac Date: Tue, 5 May 2015 21:51:40 +0200 Subject: Original commit --- Robofactor/Boite.pde | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Robofactor/Boite.pde (limited to 'Robofactor/Boite.pde') diff --git a/Robofactor/Boite.pde b/Robofactor/Boite.pde new file mode 100644 index 0000000..c6fcfaa --- /dev/null +++ b/Robofactor/Boite.pde @@ -0,0 +1,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); + } + } +} -- cgit v1.2.3-54-g00ecf