From 85ac7c199d0e8c2cab3a36b8029a93e30e0d3787 Mon Sep 17 00:00:00 2001 From: TRS_MML Date: Sun, 15 Jun 2025 21:08:58 +0100 Subject: [PATCH] Added running total for shock level as more people get shot --- __main__.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/__main__.py b/__main__.py index 83ee4a6..32e1b21 100644 --- a/__main__.py +++ b/__main__.py @@ -2,13 +2,6 @@ import pygame from random import randint #Oh god here we go. I'm gonna screw up this entire thing - -def fire():#LETS GO GAMBLING - if randint(1,6) == 6: - PlaySound(GunShot) - #remember to add shock - else: - PlaySound(GunBlank) screenw = 730 screenh = 1080 @@ -30,12 +23,22 @@ MainSurface = pygame.Surface((screenw,screenh-yOffset)) clock = pygame.time.Clock() running = True #you better start running... +shockScale = 0 #controls shock level sent to PDO (on a scale of 0 to 1) #gun variables startSpin = False spinning = False spinInc = 0 +def fire(shockScale):#LETS GO GAMBLING + if randint(6,6) == 6: + PlaySound(GunShot) + return 0.04 + #remember to add shock + else: + PlaySound(GunBlank) + return 0 + while running: for event in pygame.event.get(): if event.type == pygame.QUIT: @@ -55,12 +58,13 @@ while running: spinning = True #keep the gun spinning if spinInc == 0: PlaySound(GunSpin) - spinInc += 1 #next gun frame - if spinInc == len(gun): #if we've reached the end - spinInc = 0 #reset frame count - spinning = False #stop spinning - startSpin = False #what did i say bitch? stop spinning - fire() #check if the user gets shot + spinInc += 1 #next gun frame + if spinInc == len(gun): #if we've reached the end + spinInc = 0 #reset frame count + spinning = False #stop spinning + startSpin = False #what did i say bitch? stop spinning + shockScale += fire(shockScale) #check if the user gets shot + if shockScale > 1: shockScale=1 #keeps shockScale in bounds #screen code screen.fill("black")