Compare commits
2 Commits
bec50e6453
...
564a5a664c
Author | SHA1 | Date | |
---|---|---|---|
564a5a664c | |||
558c5a6ba4 |
@ -138,12 +138,11 @@ class Game():
|
||||
if self.gameloop: # Si j'ai une boucle de jeu, la lancer
|
||||
self.gameloop.step(self) # La logique de la boucle
|
||||
self.gameloop.draw(self) # L'affichage de la boucle
|
||||
self.clock.tick(self.fps)
|
||||
if self.scene :
|
||||
self.scene(self)
|
||||
self.scene = False
|
||||
pygame.display.update() # Mettre à jour l'affichage
|
||||
|
||||
self.clock.tick(self.fps)
|
||||
|
||||
def init_inputs(self):
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,8 @@ class EndFlag(Ennemy):
|
||||
self.endtimer = self.game.lib.Timer(0.5)
|
||||
self.ended = False
|
||||
|
||||
self.sfx = self.game.sound_lib["sfx/win.wav"]
|
||||
|
||||
def step(self):
|
||||
|
||||
super().step()
|
||||
@ -50,6 +52,7 @@ class EndFlag(Ennemy):
|
||||
offsetx = self.game.lib.randint(-10*steps,10*steps)/(steps)
|
||||
offsety = self.game.lib.randint(-5,5)
|
||||
self.game.addParticle(sprites,self.rect.center[0]+offsetx,self.rect.center[1]+offsety,velx=velx,vely=vely,modvely=0.05,fps=2)
|
||||
self.sfx.play()
|
||||
|
||||
if self.ended:
|
||||
if self.endtimer.tick(self.game.dt):
|
||||
|
@ -88,6 +88,7 @@ class Player(Movable):
|
||||
self.landsfx = self.game.sound_lib["sfx/land.wav"]
|
||||
self.slamsfx = self.game.sound_lib["sfx/slam.wav"]
|
||||
self.jumpsfx = self.game.sound_lib["sfx/jump.wav"]
|
||||
self.hurtsfx = self.game.sound_lib["sfx/hurt.wav"]
|
||||
|
||||
def step(self):
|
||||
|
||||
@ -204,8 +205,8 @@ class Player(Movable):
|
||||
self.verspd= self.jump*self.gravityway
|
||||
if self.leaptimer<0 and not self.onground:
|
||||
self.verspd = -abs(self.verspd) # Small leap
|
||||
else:
|
||||
self.jumpsfx.play()
|
||||
self.leaptimer = 1
|
||||
self.jumpsfx.play()
|
||||
self.jumped = True
|
||||
super().step() # Actually move
|
||||
# Updated hitrect
|
||||
@ -244,7 +245,7 @@ class Player(Movable):
|
||||
if self.leaptimer>0:
|
||||
self.verspd*=self.gravityway
|
||||
else:
|
||||
self.leaptimer = 0
|
||||
self.leaptimer = 1
|
||||
self.canfastfall = False
|
||||
self.fastfall = self.gravityway
|
||||
else:
|
||||
@ -283,6 +284,7 @@ class Player(Movable):
|
||||
self.canfastfall = True
|
||||
if resetcombo:
|
||||
self.combo = 0
|
||||
self.hurtsfx.play()
|
||||
|
||||
def draw(self):
|
||||
flipy = (self.gravityway<0 and not self.leaptimer<0)
|
||||
|
BIN
gamedata/sounds/sfx/hurt.wav
Normal file
BIN
gamedata/sounds/sfx/hurt.wav
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
gamedata/sounds/sfx/win.wav
Normal file
BIN
gamedata/sounds/sfx/win.wav
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user