Here we had to create multiple "pacmen" bouncing around the active window. Fully in Javascript! With a timer we were able to achieve this result, and also getting the current window size, so the location and the velocity of every pacmen changes.
Check here!