create game state checking code