scripts/games: refactor