def real_playsound(): sound = pyglet.media.load('mt.wav') player = Player() player.queue(sound) player.eos_action = player.EOS_LOOP player.play() pyglet.app.run()
def main(): director.init(**window) main_scene = Scene(StartLayer()) player = Player() player.queue(load("resources/audios/cave.wav")) player.eos_action = player.EOS_LOOP player.play() director.run(main_scene)
def play(audio): if audio != "silent": player1 = Player() player1.queue(load(join(DATA, "chronotank.ogg"))) player1.queue(load(join(DATA, "imagine_a_world.ogg"))) player1.play() player2 = Player() player2.eos_action = Player.EOS_LOOP player2.queue(load(join(DATA, "stupidsongimadenofarting.ogg"))) player2.play()
state = 'playing' pause_label = Label('PAUSED', font_size=36, x = window.width/2, y = window.height/2, anchor_x = 'center', anchor_y = 'center') bounce_sound = resource.media('sounds/bounce.wav', streaming=False) goal_sound = resource.media('sounds/goal.wav', streaming=False) music = resource.media('sounds/ride-the-storm.ogg') music_player = Player() music_player.queue(music) music_player.volume = 0.5 music_player.eos_action = music_player.EOS_LOOP music_player.play() @window.event def on_draw(): window.clear() if state == 'playing' or state == 'scored': ball.draw() paddle1.draw() paddle2.draw() score_label_1.draw() score_label_2.draw() if state == 'paused': pause_label.draw() @window.event