2015-07-04 18:57:51 (edited by Kyleman123 2015-07-04 22:15:00)

so i've posted on here about my monopoly game before. while its not 100% complete i think i'm at the point where i'm comfortable with the python i already know and working on it the same way i am now would only be more work for me in the long run. that being said, i'm looking to start turning this into a real game and not something in the command line. is pygame the best way to do that and yet still keeping it accessible? i've seen a bit of pyaudiogame. is that worth looking into? if i should still stick with pygame, what are some general practice things i could keep in mind? lastly, are their any pygame/pyaudiogame tutorials out there you'd recommend? happy forth to all.
edit: with a bit of hunting around here i turned up pyglet. thoughts on pyglet would be welcome as well.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2015-07-05 09:41:41

This is the first i've heard of Pyaudiogame, and there doesn't seem to be much out there so it may depend on whether you can get feedback from anyone else using it. From what i've heard Pygame is fairly stable and has a metric ton of tutorials all over the place, so seems like a good choice.

I mostly use pyglet, its 3D positional audio is nice and playing sounds is fairly straight forward, though at the moment you have to be abit careful to free up resources. Currently i've just encountered a bug i'm looking into where the audio isn't playing on certain systems, though you can try it out for yourself.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2015-07-05 20:38:45

yeah the main issue i'm finding whether it be pygame or pyglet is that i have to weed through all of the stuff they have there about graphics and how to manipulate them and try to extract something that i can use for an audio game. it kind of just goes all over my head when they start talking about sprites and all that stuff. i'm only a super newbee with pygame and all that stuff so maybe i'll understand it more as i go along. i don't really know whats relevant and what isn't. which is why i asked if anyone had any tutorials they'd recommend.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2015-07-09 16:24:47

Pygame has a flawed event handling system that one notices when they create the same thing in both pyglet and pygame.
I stopped making support for pygame in pyaudiogame and I am moving more to using a system like pyglet or panda3d, but I haven't made up my mind what one to really do yet. I have ported the major stuff to pyglet and I am porting to panda3d, then I will figure out what one is easier to distribute with the most power.
Currently for something like a basic board game pyaudiogame will be perfect. It just strips out all the junk out of pygame and gives you what you need. It does not have many helper functions and the documentation is rather slim, but if you already understand what a class is and how to use objects you should be fine using pyaudiogame in its current state. You can use pygame directly from pyaudiogame, so if there is functionality you want that isn't already in pyaudiogame, you can just type something like pyaudiogame.pygame or reimport pygame.

2015-07-11 01:40:15 (edited by Kyleman123 2015-07-11 01:44:09)

so for right now i'm using pygame. i'm not implementing graphics at the moment, but that is a plan in the future.
i found this topicand this topic  very helpful.
also, i need a bit more help understanding cue/stacks and how it works with the main game loop. i understand screens from that first link, but  what is a good way to append screens to the cue/stack and keep them there until they are popped off and it returns to the prior screen in the cue/stack.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2015-07-11 12:09:58

Well you make your own stack and just add or remove them.
Because pygame doesn't allow you to listen for different events you need to catch them in the for loop. So what the screen stack would look like is something like:
screens = []

for screen in reversed(screens):
    if screen(events):
        break

and a screen function would look something like:

def screen1(events):
    """I don't like doing pygame's event system, but that is what you would use here. I like pyaudiogame's event system because it is just a dict of events."""
    if events['key'] == 'space":
        spk("You are on the moon!")
        return True

def screen2(events):
    if events['key'] == "a":
        spk("you hit a")
    elif events['key'] == "escape":
        screens.pop()
    return True

If you have in screens:
[screen1, screen2]
Then what will happen is the for loop will run screens2 first, check if it returned True and if it did, stop. If it didn't return True, then it will move on to the next screen (screen1) and do the same.
So in the above setup if I hit a, it would give me a message. If I hit space, nothing would happen. If I hit escape I wouldn't see anything, but if I then hit a, nothing would happen. But if I now hit space, I would get a message.
Does this help?

2015-07-11 12:12:52

In pygame one needs to loop through the event system. In pyglet you add an event listener or a screen and it does all this for you. In pygame there is a small delay because the main loop is weighting for the listening loop to run again. Same thing goes in panda3d. This whole idea is done for you!

2015-07-15 20:17:09

I have put the different branches to pyaudiogame up for people to checkout.

For all branches you can get a screen by doing:

from pyaudiogame import App
my_app = App()

my_app.run()

Although note that panda's branch is built for the already built app object rather than the app class. So for hello world on panda's branch do:
from pyaudiogame import app
app.run()

Just make sure you have installed all the packages or binaries in the requires folder before running!

2015-07-15 20:54:53

Just be aware that to my knowledge, pygame isn't under active development-it was updated in 2011. I think it has all the features one would need, but just want you to know of that fact.

This is not a signature.

2015-07-15 21:18:40

Alot of people consider the successor to SDL to be SFML, which is still maintained.  You can find a python version here:
(http://www.python-sfml.org/)

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2015-07-16 20:48:32

wow, I've never seen that. Cool! But it still has the same event system as pygame.
I like panda3d because in order to do a hello world example you do something like:

from pyaudiogame import app
app.change_settings(title="my hello world app")

def hello():
    pyaudiogame.speak("Hello world!")

app.accept('space', hello)

app.run()

Or if you want something shorter do:
from pyaudiogame import app
app.accept('space', pyaudiogame.speak, extraArgs=['Hello world!',])
app.run()
So what you can do with your monopoly game is pretty much anything dealing with key input. In order to do something later just do:
app.doMethodLater(time_to_weight, function, extraArgs=['all your extra args',])