Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame Help
#3
On line 171 you reset dice to a new iteration of Dice each time the "roll dice' button is pressed. It might be best to do this only once, perhaps at the beginning of Gameloop like this:

def GameLoop():
    dice = Dice()
    while not game_over:
The problem that you're having is because dice.SetTableDice () only updates the dice when "roll dice" is clicked. I recommend that you move it down with pygame.display.update () like this:

        clock.tick(30)
        dice.SetTableDice () 
        pygame.display.update()
Reply


Messages In This Thread
Pygame Help - by piznac - Jun-30-2021, 09:58 PM
RE: Pygame Help - by piznac - Jul-01-2021, 09:54 PM
RE: Pygame Help - by BashBedlam - Jul-04-2021, 12:44 PM
RE: Pygame Help - by piznac - Jul-04-2021, 09:32 PM
RE: Pygame Help - by noahcentineo - Jul-12-2021, 02:28 AM
RE: Pygame Help - by stephanilope - Nov-19-2022, 03:28 AM
RE: Pygame Help - by Windspar - Nov-25-2022, 03:14 AM

Forum Jump:

User Panel Messages

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