Python Forum
Adding a single player mode to my wxOthello game
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding a single player mode to my wxOthello game
#24
I made the PlayerBot.makeMove method run on a separate thread but this introduced another problem: The player can make a move while the minimax is still running. I tried adding this code to my gameboardButtonClicked method but it didn't fix the problem. The string "Not Your Turn" just appears on random buttons for reasons I don't understand and it makes the players move when it's supposed to be returning out of the method before it calls makeMove.
        # In single player mode, detect attempts by the player to make a move during the
        # bots turn and yell at them. This code needs to be fixed.
        if self.robot and not self.firstPlayersMove:
            self.gameboard[row][col].SetLabel("Not Your\nTurn!")
            wx.MilliSleep(1000)
            self.gameboard[row][col].SetLabel("")
            return

(Apr-27-2019, 02:15 AM)SheeppOSU Wrote: I was wondering if you could post all yuor code so it can be tested. you can post it in github or you can post it here - probably easier to post it on github - either way getting all the code is really helpful in assisting you

There are many versions of my program in this thread; some are the whole source code and others are the specific areas of the code I've been working on. Right now the goal is to make the bot not unsmart and prevent the user from making a move while the bot is diving into a massive recursion tree.
Reply


Messages In This Thread
RE: Adding a single player mode to my wxOthello game - by keames - Apr-27-2019, 11:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] adding mouse control to game flash77 7 614 May-21-2024, 01:05 AM
Last Post: XavierPlatinum
  get a game to run in full screen mode agencyclearly 1 441 May-12-2024, 11:23 AM
Last Post: menator01
  Creating a “Player” class, and then importing it into game onizuka 4 3,183 Sep-01-2020, 06:06 PM
Last Post: onizuka
  Adding an inventory and a combat system to a text based adventure game detkitten 2 7,042 Dec-17-2019, 03:40 AM
Last Post: detkitten
  Adding persistent multiple levels to game michael1789 2 2,497 Nov-16-2019, 01:15 AM
Last Post: michael1789
  Can a player play game created with Python without installing Python? hsunteik 3 5,438 Feb-23-2017, 10:44 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020