Added running total for shock level as more people get shot
This commit is contained in:
20
__main__.py
20
__main__.py
@ -3,13 +3,6 @@ from random import randint
|
|||||||
|
|
||||||
#Oh god here we go. I'm gonna screw up this entire thing
|
#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
|
screenw = 730
|
||||||
screenh = 1080
|
screenh = 1080
|
||||||
yOffset = 0
|
yOffset = 0
|
||||||
@ -30,12 +23,22 @@ MainSurface = pygame.Surface((screenw,screenh-yOffset))
|
|||||||
clock = pygame.time.Clock()
|
clock = pygame.time.Clock()
|
||||||
|
|
||||||
running = True #you better start running...
|
running = True #you better start running...
|
||||||
|
shockScale = 0 #controls shock level sent to PDO (on a scale of 0 to 1)
|
||||||
|
|
||||||
#gun variables
|
#gun variables
|
||||||
startSpin = False
|
startSpin = False
|
||||||
spinning = False
|
spinning = False
|
||||||
spinInc = 0
|
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:
|
while running:
|
||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
if event.type == pygame.QUIT:
|
if event.type == pygame.QUIT:
|
||||||
@ -60,7 +63,8 @@ while running:
|
|||||||
spinInc = 0 #reset frame count
|
spinInc = 0 #reset frame count
|
||||||
spinning = False #stop spinning
|
spinning = False #stop spinning
|
||||||
startSpin = False #what did i say bitch? stop spinning
|
startSpin = False #what did i say bitch? stop spinning
|
||||||
fire() #check if the user gets shot
|
shockScale += fire(shockScale) #check if the user gets shot
|
||||||
|
if shockScale > 1: shockScale=1 #keeps shockScale in bounds
|
||||||
|
|
||||||
#screen code
|
#screen code
|
||||||
screen.fill("black")
|
screen.fill("black")
|
||||||
|
|||||||
Reference in New Issue
Block a user