Compare commits

...

3 Commits

Author SHA1 Message Date
e5b8316409 Removed TODO 2025-06-25 12:19:37 +01:00
45123c39b6 Implemented extra animations 2025-06-25 12:15:55 +01:00
e932c88cc3 Added / modified (maybe) gun animations 2025-06-25 12:12:29 +01:00
4 changed files with 4 additions and 1 deletions

BIN
assets/gun-blank.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

BIN
assets/gun-fire.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 MiB

After

Width:  |  Height:  |  Size: 259 KiB

View File

@ -20,7 +20,6 @@ class Game(gameUtils.Game):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
# TODO: Utilise self.pm (the player manager) # TODO: Utilise self.pm (the player manager)
# TODO: Add animations for blank firing and real firing
# TODO: Utilise the following new sounds: # TODO: Utilise the following new sounds:
# gun-load: Should be played at the beginning of the game, # gun-load: Should be played at the beginning of the game,
# and should have an animation accompanying it. # and should have an animation accompanying it.
@ -48,6 +47,8 @@ class Game(gameUtils.Game):
self.gun = self.createAnimObj('gun', './assets/gun-base.png') self.gun = self.createAnimObj('gun', './assets/gun-base.png')
self.gun.addAnimation(gameUtils.AnimationHandler('spin', './assets/gun-spin.webp', 60)) self.gun.addAnimation(gameUtils.AnimationHandler('spin', './assets/gun-spin.webp', 60))
self.gun.addAnimation(gameUtils.AnimationHandler('blank', './assets/gun-blank.webp', 60))
self.gun.addAnimation(gameUtils.AnimationHandler('fire', './assets/gun-fire.webp', 60))
self.shockScale = 0 #controls shock level sent to PDO (on a scale of 0 to 1) self.shockScale = 0 #controls shock level sent to PDO (on a scale of 0 to 1)
@ -92,12 +93,14 @@ class Game(gameUtils.Game):
def fire(self):#LETS GO GAMBLING def fire(self):#LETS GO GAMBLING
if random.randint(1,6) == 6: if random.randint(1,6) == 6:
self.playSound(self.gunShot) self.playSound(self.gunShot)
self.gun.playAnim('fire')
self.currentlyPlaying.punish(self.shockScale) self.currentlyPlaying.punish(self.shockScale)
print(f'{self.currentlyPlaying.name} is fucking dead.') print(f'{self.currentlyPlaying.name} is fucking dead.')
return 0.04 return 0.04
#remember to add shock #remember to add shock
else: else:
self.playSound(self.gunBlank) self.playSound(self.gunBlank)
self.gun.playAnim('blank')
return 0 return 0
def onEvent(self, event): def onEvent(self, event):