Completed basic game logic