Object Oriented Programming in Processing.js
This example uses object arrays in Processing.js to create what might be the basis of a simple web or mobile game.
Classes are defined for the player, enemies, food, graphical user interface or gui, and a timer. The example code and game can be found here, and a similar example using animated sprites can be found here on OpenProcessing.org. Click behind the game window to view the code.