Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Having been turned on to Pygame in this thread and elsewhere, I've decided I really want to make a version of the board game Acquire.

Before I even start, I'm wondering what I can do with my game if I make it using Pygame. Ideally I'd like to wrap it up into an installer/app for Windows/Mac/*nix/whatever that comes with its own copies of everything needed, so average Joe can download my game, set it up and then just run it. But everything I can find online tells me that for someone to play my game, they'd need to download Python (if they don't have it), Pygame and various other libraries. I don't know about you, but if I had to install that much crap to play a game, I'd never play anything.

So does anyone know about distributing games made in Pygame in completely standalone packages? Can I do it?

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Oh, OK, I thought I read that even after py2exe/py2app there were still some unresolved dependencies. Glad I'm wrong!

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

darknife posted:

How do I reference and use a object( an integer) in a function that is defined outside of it?

code:
guesses = 0

def guesses(x):
   global guesses # Add this line.
   if x == True:
      guesses += 1
   else:
      guesses -= 1
Might want to have different names for your variable and function, but it's up to you. :)

Haha owned son! Though you added the cautionary tale.
vvvv

pokeyman fucked around with this message at 07:46 on Mar 28, 2009

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

darknife posted:

Well, I know that using the same name is not good practice. I don't do that. It was just an example where I messed up on the names.

And hlfrk; it doesn't work. The script won't run.

Don't rewrite your code and ask us to debug that. Put your code in (or use pastebin or something if it's too long) so we can help you out. No point introducing yet another layer of abstraction.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I feel like I should've seen something on the subject before, but I can't seem to find anything.

Why is it that when you want to join a list of elements with a separator string, you call separator.join(a_sequence)? It never made any sense to me, and I always get it wrong because I think it makes more sense to call join on the sequence (i.e. seq.join(',')). I don't mean to start a holy war, I really don't care; I just think that maybe I'd remember it better if I knew why it's done this way.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
That makes sense. I always got tripped up, as I thought of it as "why should the string handle putting itself between items of a sequence". I should've considered the implementation. Thanks!

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Thermopyle posted:

Right, but I mean why create the Error class at all? Why not just have the InputError and TransitionError inherit directly from Exception?

So you can catch all of your exceptions at once, but let others' exceptions move up the call stack.

  • Locked thread