following the crafty.js tutorial at buildnewgames.