I've written a small game that makes 50 rain drops fall from the top of the screen, and the objective is to move a bucket along the bottom of the screen to as many rain drops as possible.
There are two classes, one for the bucket, and another for the rain drops. The rain drop class' setup looks like this:
class RainDrop{
int locationX;
int locationY;
//Determines whether the drop should be falling or not
boolean falling;
//When to make the rain drop begin to display(and therefore fall)
int timeToDisplay;
int fallingSpeed;
RainDrop(){
locationY = 5;
locationX = (int)random(5,400);
falling = false;
//When created, a random number is assigned to this variable to determine when the drop appears
//Essentially, all rain drops should begin to fall within a minute, using millis()/1000 to determine what second it is.
timeToDisplay = (int)random(2,60);
fallingSpeed = (int)random(2,5);
}
With more code underneath...
The rain drops are created in an array of 50 drops.
It works fine when exported as an applet from Processing 1.5.1, but when I try to run it in JavaScript Mode, the rain drops don't appear to fall in the time that it's supposed to.
So my question is: what is it about JavaScript that is preventing the rain drops from falling correctly?
If you would like more information, the program can be found in its applet version at
www.users.muohio.edu/blasedd/raingame