Hi, I'm triying to make a simple game that user controls right, and left arrow keys to avoid randomly falling objects from the top of the screen. As for object's random falling, I tried both Arraylist and just simple array that has preseted size, but it's not working and totally have no idea what to do.
Here's my code below, and just need help..T-T
//algorithm: avoide falling germs controlling hand's move using left, right arrow keys
xPos = random(0,width-40);//initially located at random x within the boundary
yPos = -100; //hide germ before the game starts -100
gravity=0.07;
speed=random(-2,2);
img = loadImage("t5.gif");//136 *109