Python - A quick look

Post your own tutorials, guides and demos.

Post » Wed Jan 13, 2010 10:44 pm

Yeah you can create a window with Python. Matter of fact the window doesn't have to be directx.
Useful for some things, but I don't think it can get the same speed as the Construct window.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Thu Jan 14, 2010 5:23 am

Is there any way to distribute PyGame to a player who an user who would like to play an exe that uses python with pygame?

I've been reading, and Python libraries in general seems to suffer from "dll hell", in the form of dependencies and mismatching incompatible versions.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Jan 14, 2010 9:29 am

[quote="Madster":2bft9iqm]Is there any way to distribute PyGame to a player who an user who would like to play an exe that uses python with pygame?

I've been reading, and Python libraries in general seems to suffer from "dll hell", in the form of dependencies and mismatching incompatible versions.[/quote:2bft9iqm]
or just automatically install python, when you select "Create Installer" when exporting?...or does it already do that?
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Thu Jan 14, 2010 5:57 pm

I really think installing python to play a game is overkill for any user.

I know I have ignored games that required me to do that before, it's almost like requiring to install visual studio.
I would not use python in my games if this was the case.
EDIT:
Also, they might have another version installed. Ick.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Jan 14, 2010 7:38 pm

Uh, I'm probably asking a really stupid question but can't you just drop the .dll you need into the folder that your game is in and zip it up?

I mean, MMF games need that CNC32.DLL or whatever it's called, if you don't have MMF installed.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 14, 2010 10:52 pm

[quote="deadeye":yb229e9e]Uh, I'm probably asking a really stupid question but can't you just drop the .dll you need into the folder that your game is in and zip it up?

I mean, MMF games need that CNC32.DLL or whatever it's called, if you don't have MMF installed.[/quote:yb229e9e]
Yes you can. I was going to write that you you can do this.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Fri Jan 15, 2010 3:13 am

[quote="deadeye":2i07hf1w]Uh, I'm probably asking a really stupid question but can't you just drop the .dll you need into the folder that your game is in and zip it up?[/quote:2i07hf1w]

Yeah but for PyGame (and other Python dependencies) it's not so easy, it would seem.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Jan 16, 2010 3:48 pm

[quote="toralord":3ewyknlv][quote="deadeye":3ewyknlv]Uh, I'm probably asking a really stupid question but can't you just drop the .dll you need into the folder that your game is in and zip it up?

I mean, MMF games need that CNC32.DLL or whatever it's called, if you don't have MMF installed.[/quote:3ewyknlv]
Yes you can. I was going to write that you you can do this.[/quote:3ewyknlv]

Unfortunately, it doesn't work like that. Not all Python external libraries have nicely packaged Dlls that you can include with your game. They are usually distributed with the assumption that Python is installed on the system. I'm not an expert on Py2exe but it does during compile/build time is cosntruct an exe with known library dependencies. It will include any external libraries as modules in a "dist" directory or bundle straight into the executable. I have made pygame games with Py2Exe with only the executable and it had lots of other external dependencies, so it is very much in the realm of possibility. However, this really needs to be done during compile/build time and not some kind of hack where we copy over dependencies after the fact.

I'd like to see Python working correctly though first without external libraries, like Pygame, before that support is added. I haven't been able to get even a simple Hello World example working without a hack (copying over .pyc files) and error messages. This is no slam on developers as Python would be insanely awesome with this support.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri Feb 19, 2010 12:20 pm

[quote="David":1y5tico9]And now a cool chain/snake example for python

Tomorrow I will explain how it works.[/quote:1y5tico9]

And you never did... :cry:

Seriously, though, thanks for the awesome example :wink: - just what I needed for a certain effect. I did a small test cap using this (and some extras):

[url:1y5tico9]http://dl.dropbox.com/u/1328856/Plasma%20Worm%20Saga%20-%20The%20Bull.cap[/url:1y5tico9]

Latest unstable version - so 99.82 and it does a not too necessary PS2.0 effect on the layer so in case your graphics card doesn't like it - that's the reason.

And the main question now is - how to make instances? Like several plasma worms? Give them unique Variables and do a For Each based on that or something? Can't figure it out...
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Feb 19, 2010 6:06 pm

[quote="Somebody":1sbr8u90]
And the main question now is - how to make instances? Like several plasma worms? Give them unique Variables and do a For Each based on that or something? Can't figure it out...[/quote:1sbr8u90]
theres more than one way to do it, especially if you dont mind destroying and recreating all the sprites each tick.
but one simple way without doing that would be to use the pyfix plugin and do exactly what you said
private variables indexing each snake
do a private variable compare and then use the pyfix plugin to loop thru the picked sprites
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

PreviousNext

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest