GUI SFXs
This commit is contained in:
parent
9fcefe7030
commit
03b22cc3af
@ -13,6 +13,10 @@ class Pause(BaseObject):
|
||||
self.fill.fill([62,33,55])
|
||||
self.fill.set_alpha(100)
|
||||
|
||||
self.sfx = self.game.sound_lib["sfx/mapmove.wav"]
|
||||
self.resumesfx = self.game.sound_lib["sfx/select.wav"]
|
||||
self.backsfx = self.game.sound_lib["sfx/return.wav"]
|
||||
|
||||
self.trash = game.sprite_lib["trash.png"]
|
||||
txt = "Cleared : "+str(self.game.globals["trashes"])+" / "+str(self.game.globals["totaltrashes"])
|
||||
self.trashcounter = self.game.getchars(txt)
|
||||
@ -39,10 +43,12 @@ class Pause(BaseObject):
|
||||
def resume(self):
|
||||
self.game.globals["pause"] = False
|
||||
self.game.gameloop.delid(self.id)
|
||||
self.resumesfx.play()
|
||||
|
||||
def quit(self):
|
||||
tileset = self.game.gameloop.findname("TilesetRenderer")[0]
|
||||
tileset.bgm.stop()
|
||||
self.backsfx.play()
|
||||
t = Transition(self.game,time=0.5)
|
||||
self.game.gameloop.summon(t)
|
||||
self.ispaused = True
|
||||
@ -50,8 +56,10 @@ class Pause(BaseObject):
|
||||
def step(self):
|
||||
if self.game.inputs["keys"]["right"]["timer"]==1:
|
||||
self.cursor+=1
|
||||
self.sfx.play()
|
||||
if self.game.inputs["keys"]["left"]["timer"]==1:
|
||||
self.cursor-=1
|
||||
self.sfx.play()
|
||||
self.cursor = self.cursor%len(self.optionsorder)
|
||||
if self.game.inputs["keys"]["up"]["timer"]==1:
|
||||
self.game.inputs["keys"]["up"]["timer"]=10
|
||||
|
@ -14,6 +14,9 @@ class Levels(BaseObject):
|
||||
self.bgm = self.game.sound_lib["bgm/overworld.mp3"]
|
||||
self.bgm.play(-1)
|
||||
|
||||
self.sfx = self.game.sound_lib["sfx/mapmove.wav"]
|
||||
self.launchsfx = self.game.sound_lib["sfx/select.wav"]
|
||||
|
||||
self.launched = False
|
||||
|
||||
self.blueflags = self.game.getSpriteDir("flags/blue/")
|
||||
@ -69,14 +72,17 @@ class Levels(BaseObject):
|
||||
if self.game.inputs["keys"]["right"]["timer"]>0:
|
||||
if "Level "+str(self.cursor+1) in self.game.globals["finishedlevels"] or self.game.globals["allunlocked"]:
|
||||
self.cursor+=1
|
||||
self.sfx.play()
|
||||
self.flip = False
|
||||
if self.game.inputs["keys"]["left"]["timer"]>0:
|
||||
self.cursor-=1
|
||||
self.flip = True
|
||||
self.sfx.play()
|
||||
if self.game.inputs["keys"]["up"]["timer"]==1:
|
||||
# Launch the level
|
||||
t = Transition(self.game,level = "Level "+str(self.cursor+1))
|
||||
self.launched = True
|
||||
self.launchsfx.play()
|
||||
self.game.globals["levelname"] = self.cursor
|
||||
if str(self.cursor) in self.customvalues.keys():
|
||||
props = self.customvalues[str(self.cursor)].split(";")
|
||||
|
@ -16,6 +16,8 @@ class Results(BaseObject):
|
||||
self.time = min(99,self.game.globals["timer"])
|
||||
|
||||
self.sparkles = game.getSpriteDir("particles/dust/")
|
||||
self.medalsfx = self.game.sound_lib["sfx/select.wav"]
|
||||
self.backsfx = self.game.sound_lib["sfx/return.wav"]
|
||||
|
||||
self.text = self.game.getchars("Cleared : 0 / "+str(self.maxcount))
|
||||
self.levelname = self.game.getchars("Level "+str(self.game.globals["levelname"]+1))
|
||||
@ -58,6 +60,7 @@ class Results(BaseObject):
|
||||
self.text = self.game.getchars("Cleared : "+str(int(self.currentcount))+" / "+str(self.maxcount))
|
||||
if self.currentcount == self.maxcount: # Spawn sparkles
|
||||
self.game.addParticle(self.sparkles,self.centerx+150+self.game.globals["camerax"],self.centery+self.game.globals["cameray"],fps=6,depth=4)
|
||||
self.medalsfx.play()
|
||||
|
||||
past = int(self.currenttime)
|
||||
self.currenttime-=self.game.dt
|
||||
@ -71,6 +74,7 @@ class Results(BaseObject):
|
||||
self.seconds = self.game.getchars(txt)
|
||||
if int(self.time)==int(self.currenttime) and int(self.game.globals["timetobeat"]) >= int(self.currenttime): # Spawn sparkles
|
||||
self.game.addParticle(self.sparkles,self.centerx+150+self.game.globals["camerax"],self.centery+20+self.game.globals["cameray"],fps=6,depth = 4)
|
||||
self.medalsfx.play()
|
||||
|
||||
if not self.transition:
|
||||
keys = ["up","down","left","right"]
|
||||
@ -79,6 +83,7 @@ class Results(BaseObject):
|
||||
if self.transition:
|
||||
t = Transition(self.game)
|
||||
self.game.gameloop.summon(t)
|
||||
self.backsfx.play()
|
||||
|
||||
if not self.faded:
|
||||
self.alpha = (1-self.fadetimer.getratio())*self.alphamax
|
||||
|
BIN
gamedata/sounds/sfx/mapmove.wav
Normal file
BIN
gamedata/sounds/sfx/mapmove.wav
Normal file
Binary file not shown.
BIN
gamedata/sounds/sfx/return.wav
Normal file
BIN
gamedata/sounds/sfx/return.wav
Normal file
Binary file not shown.
BIN
gamedata/sounds/sfx/select.wav
Normal file
BIN
gamedata/sounds/sfx/select.wav
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user