diff --git a/__main__.py b/__main__.py index 1ecf31f..a4db13e 100644 --- a/__main__.py +++ b/__main__.py @@ -7,7 +7,7 @@ def fire():#LETS GO GAMBLING #remember to add shock else: PlaySound(GunBlank) - + screenw = 1280 screenh = 1080 yOffset = 0 @@ -17,6 +17,8 @@ pygame.init() gun = pygame.image.load_animation("gun.webp") print(gun[0]) +GunFlash = pygame.image.load("images/muzzleflash.png") + #Sounds for the gun :3 PlaySound = pygame.mixer.Sound.play GunBlank = pygame.mixer.Sound("sfx/gun-blank.mp3") @@ -29,6 +31,8 @@ MainSurface = pygame.Surface((screenw,screenh-yOffset)) clock = pygame.time.Clock() running = True #you better start running... + +#gun variables startSpin = False spinning = False spinInc = 0 @@ -55,16 +59,18 @@ while running: screen.blit(MainSurface,(0,yOffset)) #gun code WOO - if startSpin == True or spinning == True: - spinning = True - spinInc += 1 - if spinInc == 61: - spinInc = 0 - spinning = False - startSpin = False - fire() + if startSpin == True or spinning == True:#check if space was pressed or if the gun is already spinning + spinning = True #keep the gun spinning + spinInc += 1 #next gun frame + if spinInc == 61: #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 - screen.blit(gun[spinInc][0],(0,0)) + screen.blit(gun[spinInc][0],(0,0))#draw the gun + + pygame.display.flip() diff --git a/images/muzzleflash.png b/images/muzzleflash.png new file mode 100644 index 0000000..84050c7 Binary files /dev/null and b/images/muzzleflash.png differ