converted game to .js file