خرید بک لینک

Vote count: 0

Here's the code for something I was testing out to put in a game I'm creating. I made this code to try to make the music loop over and over again. Here:

from pygame import mixer

mixer.init()
mixer.music.load('C:\Users\owner-\Dropbox\Programming\Zelpha808\music.mp3')
def play():
    timer = 1 
    mixer.music.play()
    timer = 2
    if timer == 2:
        play()

and the result:

pygame.error: Couldn't open 'C:Usersowner-DropboxProgrammingZelpha808music.mp3'

I've seen previous posts about this, except they weren't using the 'music' and the answer ended up telling them to use 'music'. But in this case, I AM using 'music'. So what's wrong with it? And if you can, would this code work? As in would the music play in a loop nonstop? If not, how would I make it loop?

asked 13 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 8 مرداد 1395 ساعت: 5:58

صفحه بندی