Help code to port the Mojang Game Battle Frogs to Javascript