joing game logic