SFX overhaul

This commit is contained in:
theo@manjaro 2021-11-23 17:55:48 +01:00
parent 558c5a6ba4
commit 564a5a664c
7 changed files with 29 additions and 25 deletions

View File

@ -1246,7 +1246,7 @@
[-1],
[-1],
[-1],
[-1],
[2, 5],
[-1],
[-1],
[-1],
@ -1418,13 +1418,13 @@
[-1],
[-1],
[-1],
[-1],
[5, 4],
[6, 4],
[4, 4],
[2, 6],
[3, 6],
[-1],
[-1],
[-1],
[4, 6],
[-1],
[-1],
[0, 0],
[5, 2],
@ -1595,13 +1595,13 @@
[-1],
[-1],
[-1],
[-1],
[5, 5],
[6, 5],
[4, 5],
[0, 5],
[1, 5],
[-1],
[-1],
[-1],
[4, 6],
[-1],
[-1],
[0, 1],
[1, 1],
@ -1772,12 +1772,12 @@
[2, 0],
[-1],
[-1],
[-1],
[7, 4],
[8, 4],
[4, 5],
[0, 6],
[1, 6],
[-1],
[-1],
[2, 6],
[4, 6],
[-1],
[-1],
[0, 1],
@ -1949,12 +1949,12 @@
[2, 1],
[-1],
[-1],
[-1],
[7, 5],
[8, 5],
[4, 6],
[0, 5],
[1, 5],
[-1],
[-1],
[0, 5],
[1, 5],
[-1],
[-1],
[0, 1],
@ -2126,11 +2126,11 @@
[7, 0],
[8, 0],
[-1],
[0, 6],
[1, 6],
[-1],
[0, 5],
[1, 5],
[4, 6],
[-1],
[0, 6],
[6, 0],
[7, 0],
[7, 0],
@ -6114,8 +6114,7 @@
{"name": "Solid", "id": 50, "_eid": "17026310", "x": 2672, "y": 176, "width": 128, "height": 96, "originX": 0, "originY": 0},
{"name": "Solid", "id": 51, "_eid": "17026310", "x": 2720, "y": 112, "width": 80, "height": 64, "originX": 0, "originY": 0},
{"name": "Solid", "id": 52, "_eid": "17026310", "x": 2736, "y": 96, "width": 64, "height": 16, "originX": 0, "originY": 0},
{"name": "Solid", "id": 53, "_eid": "17026310", "x": 2784, "y": 16, "width": 16, "height": 80, "originX": 0, "originY": 0},
{"name": "SemiSolid", "id": 54, "_eid": "59763689", "x": 2608, "y": 112, "width": 48, "height": 16, "originX": 0, "originY": 0}
{"name": "Solid", "id": 53, "_eid": "17026310", "x": 2784, "y": 16, "width": 16, "height": 80, "originX": 0, "originY": 0}
]
},
{

View File

@ -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):

View File

@ -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)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
gamedata/sounds/sfx/win.wav Normal file

Binary file not shown.