class Bille { float vx, vy, tempo, amorti, r, m,_x,_y,_xscale,_yscale,alfa,rouge,vert,bleu,lar2,lon2,vibra; int numero,nb; boolean presse; Systeme lesysteme; public Bille(int nb,Systeme ss,int numero) { this.nb=nb; this.lesysteme = ss; this.numero = numero; init(); } void init() { vibra=random(2,5); lar2=lesysteme.lar2; lon2=lesysteme.lon2; this._x = random(-400,400); this._y = random(-400,400); if(numero==0) { this._yscale=100; this.vx = 4000; this.vy = 3500; } else { this._yscale = 50+random(50); this.vx = random(2000,3000); this.vy = random(-3000,-2000); } this._xscale = this._yscale; this.alfa=0; this.r = _yscale/2; this.m = r*r*r; this.presse = false; this.tempo = 0.01; this.amorti = 1; this.rouge=55; this.vert=101; this.bleu=254; } void comportement() { limite(); choc(); vx *= amorti; vy *= amorti; _x += tempo*vx; _y += tempo*vy; } void limite() { if (_x>lar2-r) { jaune(vx,vy); _x = lar2-r; vx *= -1; } if (_x<-lar2+r) { jaune(vx,vy); _x = -lar2+r; vx *= -1; } if (_y>lon2-r) { jaune(vx,vy); _y = lon2-r; vy *= -1; } if (_y<-lon2+r) { jaune(vx,vy); _y = -lon2+r; vy *= -1; } } void jaune(float a,float b){ rouge=255; vert=255; bleu=0; lesysteme.chocx+=a/50; lesysteme.chocy+=b; } void choc() { for (int i = 0; i