Hi, I am making a game where balls are being projected (with gravity) and the user has to make the balls bounce and land in a basket. If a ball drops, it should be game over.
There are so many problems with my code (this is just a part of it) and i am unsure what exactly is the cause of them. Ive created balls using arrays like this and i feel like this may be part of the problem:
Ball[] bballs = new Ball[5];
void setup(){
size(640,480);
// create balls
for(int i = 0; i<bballs.length; i++) {
bballs[i] = new Ball();
}
}
For example:
When 1 ball falls on floor, game over screen shows WITH game still playing till the other balls drop
When all balls fall, it works fine
Score will only update with +1 when all balls go in basket instead of +5
If 1 ball were to enter basket, ahead of the other balls, no change to score
Because i used an array, are the balls counted as 1 entity/object? Would really appreciate help
Its just going up by 1 when all the balls enter the basket instead of going up by 1 for EACH ball that enters.
The only part of my code that tracks the how many of the balls go in is the above code
yea… thanks for the help but it tried it and it just complicated the rest of my code.
I feel like maybe there might be another way that is simpler.
I see what you were trying to do though.