Compare commits

..

2 Commits

Author SHA1 Message Date
0a2305f4cc Added basic popup code 2025-06-24 14:36:57 +01:00
2e59e718e6 Added timeout ID check 2025-06-24 10:16:13 +01:00

View File

@ -84,14 +84,10 @@ class Game(gameUtils.Game):
self.playSound(self.gunShot)
self.turnHandler.playing[0].punish(self.shockScale)
print(f'{self.turnHandler.playing[0].name} is fucking dead.')
self.turnHandler.next()
print(f'{self.turnHandler.playing[0].name} is up')
return 0.04
#remember to add shock
else:
self.playSound(self.gunBlank)
self.turnHandler.next()
print(f'{self.turnHandler.playing[0].name} is up')
return 0
def onEvent(self, event):
@ -119,9 +115,11 @@ class Game(gameUtils.Game):
self.timeout("FireDelay",randint(750,2000)/1000)
self.playSound(self.gunCyclinderStop)
elif event.type == gameUtils.Timeout:
elif event.type == gameUtils.Timeout and event.timeoutID == 'FireDelay':
self.shockScale += self.fire() #check if the user gets shot
self.shockScale = min(self.shockScale, 1) #keeps shockScale in bounds
self.turnHandler.next()
self.popup('Next player', f'Pass shocker to {self.turnHandler.playing[0].name},\nthen press R-CTRL+ENTER to continue.')
def update(self):
"""