Hey! Working on some HW for Processing class. I've built an image array and programmed the images to display at random points each time the sketch is loaded.
I'm trying to make it so that whenever the cursor rolls over one of the images, it's moved off screen, but try as I might, I can't seem to make it work.
//Create the array of chinese food boxes = new Chinese[30]; //Create new object for (int i = 0; i <boxes.length; i++) { //create random x coordinate float x = random(50, 750); //create random y coordinate float y = random (50, 450); boxes [i] = new Chinese (chinesefood, x, y); } //initialize the game states gameStart = true; gamePlaying = false; gameEnd = false; gameRestart = false;
}//setup
void draw () { if (gameStart) { gameStartScreen (); } else if (gamePlaying) { gamePlayingScreen (); } else if (gameEnd) { gameEndScreen (); } else if (gameRestart) { gameRestartScreen (); }