def step(self): if self.collides: if self.snd_play:# and not jngl.isPlaying(SOUND+"trampoline.ogg"): self.snd_play = False jngl.play(SOUND+"trampoline.ogg") self.collides = False if self.scalefactor < 1: self.scalefactor += 0.1
def playSounds(self): self.somyeol_count = len(self.game.level.somyeols) self.updateSoundsPlaying() #Sounds that are used by alot of Somyeols get a special treatment (walking and jumping) if jngl.keyDown(jngl.key.Up): #Stop other sounds if jumping for sound in Somyeol.Somyeol.sound_walk: jngl.stop(sound) for sound in Somyeol.Somyeol.sound_walk_crowd: jngl.stop(sound) #play other sounds... for sound in self.sound_queue: if sound in Somyeol.Somyeol.sound_walk: if self.walk_sounds_playing >= self.somyeol_count: continue else: if self.sounds_playing >= self.somyeol_count: continue if not sound in self.playing_sounds: jngl.play(sound) else: #use the crowd sounds if sound in Somyeol.Somyeol.sound_jump: sound = Somyeol.Somyeol.sound_jump_crowd[random.randint(0,len(Somyeol.Somyeol.sound_jump_crowd)-1)] if not jngl.isPlaying(sound): jngl.play(sound) elif sound in Somyeol.Somyeol.sound_walk: sound = Somyeol.Somyeol.sound_walk_crowd[random.randint(0,len(Somyeol.Somyeol.sound_walk_crowd)-1)] if not jngl.isPlaying(sound): jngl.play(sound) self.sound_queue.clear()
def step(self): for animation in self.animations: animation.step(self.animations) for somyeol in self.somyeols: somyeol.breath() somyeol.move(self.game) for object in self.objects: object.step() if len(self.somyeols) <= 0: if self.points >= self.needed_points: if self.points >= self.needed_points_perfect:jngl.play(self.game.sound.getSound(self.sound_perfect)) else: jngl.play(self.game.sound.getSound(self.sound_win)) else: jngl.play(self.game.sound.getSound(self.sound_loose)) self.game.finish = True
def checkMusic(self): if not jngl.isPlaying(self.music[self.currentTrack]): self.currentTrack = (self.currentTrack + 1) % len(self.music) jngl.play(self.music[self.currentTrack])
def explode(self): jngl.play("collect.ogg") self.exploding = True