tip for people using processing.js
If you’re using ArrayList, don’t give it an initial value. Anotherwords don’t do this:
ArrayList enemies;
enemies = new ArrayList(20);
I wasted too much time trying to figure that out. It was working fine in processing, but in the webbrowser it wasn’t working. Just leave it blank:
ArrayList enemies;
enemies = new ArrayList();