write scripts for game.php