Hello, I'm makinga game fora class projectin which arabbit jumpsover a row offood andasthefood you eat(beer,burger orcarrots)will passcertain things.The problem is thatI haveto doa collision betweenthe rabbitand the food whenthe rabbitjumpand puta scorebut I don't know how to do it. I would greatly appreciatethe help.
This is the code. The code is in spanish. Comida means food, conejo means rabbit, zanahoria means carrot, hamburguesa means burger and cerveza means beer.
import ddf.minim.*; Minim conker; AudioPlayer BGMusic;// música
int segundos = 50; int frames = 10; int cuadro = 0; boolean terminado = false;// para el contador de tiempo boolean empezado = false; // pulsar enter para empezar
noStroke (); frameRate(frames); conker = new Minim(this); BGMusic = conker.loadFile("Conker2.wav"); BGMusic.play(); BGMusic.loop(); //he borrado el void azar para probar el aleatorio en cada comida
if(!terminado){ fill(255); noStroke(); textSize(80); text(segundos,455,80); }else{ image(gameover,250,200); } }// cuando acaba el contador: game over }// void draw
//parar música void stop(){ BGMusic.close(); //cerrar el sonido conker.stop(); // para el objeto super.stop(); }// parar música