Added: 2 years ago
From: metalx1000
Views: 3,174
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (34)

Sign In or Sign Up now to post a comment!
  • Comment removed

  • what operating system are u using?

  • @TheHundefor: Video was made a while ago. But it looks like Linux Mint. Although the Python Script should work the same on all Operating Systems.

  • Comment removed

  • You make everything so easy. Thank you!!!!

  • @tekroundup: I try to.  I'm glad you found it helpful.

  • if these videos dont deserve thumbs up ...then which does...dude dese r awesome

  • @elninogauje: Thanks, I'm glad you like them. There are plenty more coming too.

  • are you using ubuntu

  • @maradona640: Most likely I'm using Linux Mint.  That is what I use in most my videos.

  • I always get "there is no soundcard" as error message and it doesnt play my wav file...

    any idea what could be wrong here?? :)

    btw...awesome tutorials!!

  • @BENCHMARK1989: I have not experienced this myself, but it seems to be a common problem. I haven't seen a real fix for it, but more of a work around. I've seen on 2 sites to run pygame.mixer.init() twice. So:

    pygame.mixer.init()

    pygame.mixer.init()

    and the second time it works.

  • @metalx1000 @BENCHMARK1989 Did either of you find a better solution for this? I'm having the same "there is no soundcard" issue with pygame 1.9.1 in Mint Katya but calling pygame.init() twice didn't work for me (and my soundcard works fine). I think it might have to do with my graphics card. I had to switch my soundcard to the motherboard using alsamixer because mint defaulted it to my graphics card which isn't a soundcard. Also, this was the most useful Youtube comment thread ever.

  • @rblakem: Hard to say, my desktop doesn't get that error message, but I feel like I saw it on my laptop a week or 2 ago. I'm not at my laptop right now, but I feel like even though I go that message the sound still worked. Can you confirm that there is no sound after that message is displayed?

  • @metalx1000 there is sound even after the error message displays. The game runs (as long as I don't launch it from eclipse).

  • @BENCHMARK1989:This is good to know because if that is the case, maybe we should all be doing that. If I make a game that runs fine on my computer, it may not run on yours because of this, so I guess I should do this in all my script just to be sure.

  • @metalx1000 I googled that error message and also found some mailing lists with that fix but it wont work for me =/...never the less if it fixes that error on some other computers maybe its good to do the init twice in all scripts...

    I wondered if it could be a problem with the hdmi output because python has now 2 output devices and cant detect the right one....but thats just some thoughts I had!

    Thx for answering....search is going on! :)

    (Maybe helpful: Ubuntu 10.10 with Python 2.6.6)

  • Awesome tutorials! Couple of questions though, I noticed when adding sound it will only play if you use a .wav file. How do I make it play a .midi? Also how do I make the sound loop(play continuously).

  • @LOOK4B: those are good questions. I've never played a midi through PyGame, although I believe it is possible. Looping a sound is something I've done, but it's been a while. I've been meaning to do more PyGame tutorials. I'll put both of these on my list of things todo.

  • Very nice tutorials, Chris!

    A couple of suggestions...

    1. For compatibility with python3, add parenthesis after the 'play' message: sound.play()

    2. Instead of exiting with just sys.exit(), it is better to first do pygame.quit() then do sys.exit(). Otherwise when it closes you'll get an abnormal termination program error ("pythonw.exe is not responding") when run from IDLE under Windows Vista.

    3. Also, I think that pygame.display.update() might be a better choice than pygame.display.flip()

  • 4. Also, you needn't import pygame.mixer. Since you've already imported pygame, referencing pygame.mixer.whatever works without explicitly importing pygame.mixer.

  • @ncdave4life: Thanks for the info. I have recently started using  pygame.display.update() instead of pygame.display.flip().

    I'll look into your other suggestions.

  • Lulz snotty boy

  • @XAutomatedOwnerX: Not sure what that mean.

    You Straight Edge?

  • @metalx1000 The guys name was snotty boy the guy you downloaded the sound from

  • @XAutomatedOwnerX: Oh :)

  • OPENSOURCE AUDIO LOL

  • does this work with .avi files?

  • @thrasher729: I have not tried, but I think there is a python module called PyMedia for that sort of thing.

  • Does the program continue tracking Tux, when he is off screen? Could you remove him when he passes the screens edge?

  • Yes, at this point it keeps tracking him.

    You can stop it once it goes off the screen.

    But, I'm are going to change things up here in a few more videos with him.

  • cool tutorials :D

    but my speakers and the volume on the video have 2 B turned up 2 the max. and i still have 2 go 2 "Master Volume" 2 turn that up a little 2 hear U'r tutorial.

    i'm not knocking U'r tutorial but i cant here it

    ;-)

  • Yes, People have informed me that my volume is low. Unfortunetly I recorded a lot of these videos all in one day.

    So, there are still going to be some with low volume to come.

    Sorry :(

  • I would re-record them, but I can hear them find when I turn the volume up. So, there not that bad.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more