learning to make an game with javascript. all the warts, bumps and wrongdoings