Re: [pygame] Physics, collision detection etc?

2008-10-07 Thread Peter Gebauer
Hey Nirav!

Yep, but as I said, I need to find colliding polygons, not pixels.

/Peter

On 2008-10-06 (Mon) 12:05, Nirav Patel wrote:
 Peter,
 
 There are some new functions in SVN in the mask module.  New ones
 since 1.8.1 that could be useful for collision are:
 
 Mask.overlap_mask - Returns a mask of the overlapping pixels
 Mask.draw - Draws a mask onto another
 Mask.erase - Erases a mask from another
 Mask.count - Returns the number of set pixels
 Mask.centroid - Returns the centroid of the pixels in a Mask
 Mask.angle - Returns the orientation of the pixels
 Mask.connected_component - Returns a mask of a connected region of pixels.
 
 The mask module does pixel collisions pretty quickly.  I think on
 modern systems it shouldn't be a significant difference (compared to
 say, blitting) between using pixel perfect detection and something
 like the seperating axis theorem.
 
 Nirav
 
 On Mon, Oct 6, 2008 at 11:27 AM, Peter Gebauer
 [EMAIL PROTECTED] wrote:
  Hey guys!
 
  I've been looking around for various libraries that handle
  intersection/colliding polygons/line segments, I'm just wondering if/when
  there will be polygon shapes and additional collision testing functions
  that can be used seemlessly with the old rect and mask libraries that
  already exist in PyGame?
 
  /Peter
 
 


Re: [pygame] nintendo ds and pygame

2008-10-07 Thread Luke Paireepinart
It's not going to run well.

On Mon, Oct 6, 2008 at 11:44 AM, diego diaz [EMAIL PROTECTED] wrote:
 ok. thanks for your answer

 On Mon, Oct 6, 2008 at 6:30 PM, James Paige [EMAIL PROTECTED] wrote:

 On Mon, Oct 06, 2008 at 09:23:49AM -0700, diego diaz wrote:
  hi
  I would like to know what it the state of porting pygame into nintendo
  ds.
  Does anybody working on that?
  thanks
  diego

 My dear friend google informs me that most of the groundwork has been
 layed already, but that nodoby has done it yet. See
 http://disinterest.org/NDS/Python25.html for a screenshot of
 stackless python running on a ds, and a link to a DS port of SDL.

 ---
 James Paige




Re: [pygame] recommendation for a good n00b IDE

2008-10-07 Thread kschnee
On Mon, 6 Oct 2008 08:37:52 -0500, pymike [EMAIL PROTECTED] wrote:
 You said C++ on a python list! You must die!*
 *just kidding ;)

Not at all! There's no need in Python to use destructors. 8)

I just use IDLE, which has automatic tab-formatting, color-coding, a class
browser, and a Run key. It's buried in Python##\lib\idle or someplace
like that, though, so you have to dig for it on a Windows installation.
(The Windows installer should create a link to IDLE.) I've heard good
things about a program called Notepad++, but haven't tried it.



Re: [pygame] my application give fatal error

2008-10-07 Thread Lenard Lindstrom

gopal mishra wrote:


Hi,

My application(GUI) is using pygame.

In single execution of my application there can be more then one session.

In first session, I run the application, it initialize the pygame and 
on closing the application session it call the pygame’s quit() to 
unintialize the pygame modules.


But it doesn’t reduce the virtual memory size.

And in the next session it increases the virutal memory size and gives 
the following error,


Fatal Python error: (pygame parachute) Segmentation Fault

This application has requested the Runtime to terminate it in an 
unusual way.


Please contact the application's support team for more information.

Any Suggestions?

Thanks and regards,

Gopal

What operating system? What version of Pygame and Python? Do your 
program play any sound files?


--
Lenard Lindstrom
[EMAIL PROTECTED]



Re: [pygame] recommendation for a good n00b IDE

2008-10-07 Thread Lenard Lindstrom

kschnee wrote:

On Mon, 6 Oct 2008 08:37:52 -0500, pymike [EMAIL PROTECTED] wrote:
  

You said C++ on a python list! You must die!*
*just kidding ;)



Not at all! There's no need in Python to use destructors. 8)

I just use IDLE, which has automatic tab-formatting, color-coding, a class
browser, and a Run key. It's buried in Python##\lib\idle or someplace
like that, though, so you have to dig for it on a Windows installation.
(The Windows installer should create a link to IDLE.) I've heard good
things about a program called Notepad++, but haven't tried it.

  
I just installed Notepad++ and am having a look at it now. It is 
Scintilla based. It has a Python mode, among may others. There is syntax 
highlighting, block commenting and indenting, regular expression find 
and replace, and a spell checker. As far as I can tell automatic 
indenting is rather simplistic: indent to the same level as the previous 
line. Overall, though, it looks quite interesting. And the web site and 
Windows installer contain images of a green iguana, so one can't go too 
far wrong with it.


http://notepad-plus.sourceforge.net/uk/site.htm

--
Lenard Lindstrom
[EMAIL PROTECTED]



Re: [pygame] Physics, collision detection etc?

2008-10-07 Thread Nirav Patel
Peter,

If the polygons are Surfaces or can be turned into Surfaces, they can
be turned into Masks to do pixel collision.  Though, I may be
misunderstanding what you are trying to do.

Nirav

On Tue, Oct 7, 2008 at 11:21 AM, Peter Gebauer
[EMAIL PROTECTED] wrote:
 Hey Nirav!

 Yep, but as I said, I need to find colliding polygons, not pixels.

 /Peter

 On 2008-10-06 (Mon) 12:05, Nirav Patel wrote:
 Peter,

 There are some new functions in SVN in the mask module.  New ones
 since 1.8.1 that could be useful for collision are:

 Mask.overlap_mask - Returns a mask of the overlapping pixels
 Mask.draw - Draws a mask onto another
 Mask.erase - Erases a mask from another
 Mask.count - Returns the number of set pixels
 Mask.centroid - Returns the centroid of the pixels in a Mask
 Mask.angle - Returns the orientation of the pixels
 Mask.connected_component - Returns a mask of a connected region of pixels.

 The mask module does pixel collisions pretty quickly.  I think on
 modern systems it shouldn't be a significant difference (compared to
 say, blitting) between using pixel perfect detection and something
 like the seperating axis theorem.

 Nirav

 On Mon, Oct 6, 2008 at 11:27 AM, Peter Gebauer
 [EMAIL PROTECTED] wrote:
  Hey guys!
 
  I've been looking around for various libraries that handle
  intersection/colliding polygons/line segments, I'm just wondering if/when
  there will be polygon shapes and additional collision testing functions
  that can be used seemlessly with the old rect and mask libraries that
  already exist in PyGame?
 
  /Peter
 




Re: [pygame] Physics, collision detection etc?

2008-10-07 Thread Ian Mallett
I once wrote a program which collides a point and a convex polygon,
returning a boolean result.  http://pygame.org/project/649/ This project
uses it, for instance.  It may be of help.Ian


Re: [pygame] recommendation for a good n00b IDE

2008-10-07 Thread Brad Montgomery
When given a choice, I use vim on Linux or OS X.  When on Windows,
though, I also use Notepad++.  I've been pleased with it...

Another option for any OS X users is Smultron.  http://smultron.sourceforge.net/

None of these are technically IDEs, but in general, I prefer a good
[source code] text editor over an IDE.


Re: [pygame] recommendation for a good n00b IDE

2008-10-07 Thread Wayne Koorts

 When given a choice, I use vim on Linux or OS X.  When on Windows,
 though, I also use Notepad++.  I've been pleased with it...


Since the discussion has changed to text editors, I'll throw in a
recommendation for jEdit(.org).  It's Java-based and runs nicely on both
Windows and (Ubuntu on which I've tried it) Linux.  It's definitely a
heavy-weight editor and has all the bells and whistles you could want in a
decent editor.  I install it as a standard on any GUI-based system where
there's any chance at all I might be opening a script.

--
Regards,
Wayne Koorts
Registered Linux User #330079
http://www.wkoorts.com


Re: [pygame] Linux distribution(s) of a finished product

2008-10-07 Thread James Paige
On Tue, Oct 07, 2008 at 02:06:27PM -0700, Keith Nemitz wrote:
 
 I'm currently investigating how to port my pygame game, 'Dangerous High 
 School Girls in Trouble!' to Linux. I tried to search the archives at ASPN, 
 but failed to find anything relevant.
 
 I should be able to setup and get the game running, pretty quickly, but it 
 looks like the big barrier will be making distributions for enough flavors of 
 Linux to be worthwhile. Which distros should I target? I read one series of 
 articles on gamedev.net, but it wasn't pygamey enough for my needs.
 
 My current plan is to run one or more distros under VMWare Fusion on my Mac 
 Pro. Then collect everything in to one folder and use an alias to point to 
 the executable. So when you unzip the download, you get a folder and an alias 
 file. Exe the alias file to run the game. Is that too naive?
 
 What advice or links can you offer?

http://www.autopackage.org/ is probably a good place to start.

---
James Paige


Re: [pygame] Linux distribution(s) of a finished product

2008-10-07 Thread James Paige
On Tue, Oct 07, 2008 at 02:27:56PM -0700, James Paige wrote:
 On Tue, Oct 07, 2008 at 02:06:27PM -0700, Keith Nemitz wrote:
  
  I'm currently investigating how to port my pygame game, 'Dangerous High 
  School Girls in Trouble!' to Linux. I tried to search the archives at ASPN, 
  but failed to find anything relevant.
  
  I should be able to setup and get the game running, pretty quickly, but it 
  looks like the big barrier will be making distributions for enough flavors 
  of Linux to be worthwhile. Which distros should I target? I read one series 
  of articles on gamedev.net, but it wasn't pygamey enough for my needs.
  
  My current plan is to run one or more distros under VMWare Fusion on my Mac 
  Pro. Then collect everything in to one folder and use an alias to point to 
  the executable. So when you unzip the download, you get a folder and an 
  alias file. Exe the alias file to run the game. Is that too naive?
  
  What advice or links can you offer?
 
 http://www.autopackage.org/ is probably a good place to start.
 

Hmmm. Sorry to double-post, but I thought you deserved a longer answer. 
Also, it would help to know whether or not your game is open source.

Your plan is actually pretty good, except I wouldn't bother with the 
alias (symlink in linux termanology). Just make a folder, put your game 
in it, and bundle it up as a .tar.gz file.

But if you want to go with a package manager:

Autopackage is designed top be distribution agnostic. It is not the 
preferred packaging method on any distribution that I am aware of, but 
it is a good choice if you are approaching Linux software installation 
from a Windows Installer mentality.

.deb files are for Debian and Ubuntu and all related distributions. 
Generally speaking, if you make a .deb that works for Debian, it is 
likely to work fine on all other deb-capable distributions.

.rpm is for Fedora core and Redhat and all related derivatives. Ditto 
what I said above about .deb

.emerge is for Gentoo, and if your project is not open source 
and doesn't ahve a publicly available version control server, it 
probably won't work out well for you.

There are lots of other packaging formats for the smaller distributions, 
but since most of those other distros espouse an even stronger do it 
yourself philosophy than the rest of the Linux world, users of other 
distros are far less likely to need your packages.

---
James Paige


Re: [pygame] Linux distribution(s) of a finished product

2008-10-07 Thread Knapp
Distrowatch has a ranking of distros based on which ones people look
at the most on their site. It is a good but not perfect indication of
what people are using the most. The last 2 or 3 editions of their news
letter had a comparison of the different package managers.
http://distrowatch.com/
-- 
Douglas E Knapp

http://sf-journey-creations.wikispot.org/Front_Page


Re: [pygame] Linux distribution(s) of a finished product

2008-10-07 Thread Keith Nemitz
Thanks James,


 Autopackage is designed top be distribution agnostic. It is
 not the 
 preferred packaging method on any distribution that I am
 aware of, but 
 it is a good choice if you are approaching Linux software
 installation 
 from a Windows Installer mentality.
 

Actually, I'm coming from a Macintosh 'unzip the app and launch it mentality'. 
I dislike installers immensely. If an application has to touch anyplace outside 
where the user puts it, it had better have a damn good reason!

Linux gamers are probably the smartest people in the world. If they're okay 
with finding the exe inside a folder, then that just saves me a step. 

This results in a better formed question: Can I get all the pygame parts 
(including things like numpy/numeric) into one location and rely on a distro's 
Python to just work? I'm pretty sure my python code is compliant back to 2.3.

From casual searching, it seems like I may have to build some of pygame's 
parts for specific distros. A pain, but only once per distro. 

Thanks for the list of the distros most important.

Keith


Re: [pygame] Linux distribution(s) of a finished product

2008-10-07 Thread Wayne Koorts
Hi Keith,

I would suggest starting on Ubuntu Linux.  This will cover a huge number of
Linux users and you will also be able to more easily adapt the package to
any other Debian based distribution, of which there are many.

This results in a better formed question: Can I get all the pygame parts
 (including things like numpy/numeric) into one location and rely on a
 distro's Python to just work? I'm pretty sure my python code is compliant
 back to 2.3.


The standard way of working this scenario is to create a package, with just
your components in it, which then contains metadata for its dependencies so
that the package manager (apt in the case of Ubuntu or other Debian based
distros) will then handle the dependencies.  You can specify which version
of a particular application or library is required and as long as you test
it on the system you are aiming for you should be fine.

Have a look at the following document for details on packaging for Ubuntu:
https://wiki.ubuntu.com/PackagingGuide/Complete

Look at the Solarwolf package for Ubuntu for a current example of a pygame
application to base your package on:
http://packages.ubuntu.com/hardy/games/solarwolf

--
Regards,
Wayne Koorts
Registered Linux User #330079
http://www.wkoorts.com


[pygame] Unexpected behavior from BLEND_RGBA_SUB

2008-10-07 Thread Yumiko Shirasagi
Hello,

When I blit an image such as this (generated dynamically with PIL, and
saved here by pygame.image.save)-
http://xs432.xs.to/xs432/08412/mask808.png
to this screen, using the line screen.blit(mask, (0, 0), None,
BLEND_RGBA_SUB)-
http://xs432.xs.to/xs432/08412/screen136.png
it results in this-
http://xs432.xs.to/xs432/08411/tsukiyo3634.jpg

Is this what is supposed to happen? It seems to me that BLEND_RGBA_SUB
should respect the the alpha of the surface being blitted and avoid
subtracting the fully transparent gray pixels. Of course an alternate
solution is to get rid of those gray pixels, but I'm wondering whether
it is a bug in pygame, or if there is a solution that doesn't require
altering the way the surface is generated.


Re: [pygame] Linux distribution(s) of a finished product

2008-10-07 Thread Charlie Nolan
Actually, in many respects, the best thing to do is just get your
program files out there (in some usable form) as soon as possible.  If
you get people interested in what you have, the community will provide
distribution methods for you.  I work on Endgame: Singularity, and we
just provide a tarball of the program files.  The distros handle
packaging it for their users.

-FM

On Tue, Oct 7, 2008 at 5:13 PM, Wayne Koorts [EMAIL PROTECTED] wrote:
 Hi Keith,

 I would suggest starting on Ubuntu Linux.  This will cover a huge number of
 Linux users and you will also be able to more easily adapt the package to
 any other Debian based distribution, of which there are many.

 This results in a better formed question: Can I get all the pygame parts
 (including things like numpy/numeric) into one location and rely on a
 distro's Python to just work? I'm pretty sure my python code is compliant
 back to 2.3.

 The standard way of working this scenario is to create a package, with just
 your components in it, which then contains metadata for its dependencies so
 that the package manager (apt in the case of Ubuntu or other Debian based
 distros) will then handle the dependencies.  You can specify which version
 of a particular application or library is required and as long as you test
 it on the system you are aiming for you should be fine.

 Have a look at the following document for details on packaging for Ubuntu:
 https://wiki.ubuntu.com/PackagingGuide/Complete

 Look at the Solarwolf package for Ubuntu for a current example of a pygame
 application to base your package on:
 http://packages.ubuntu.com/hardy/games/solarwolf

 --
 Regards,
 Wayne Koorts
 Registered Linux User #330079
 http://www.wkoorts.com



Re: [pygame] Linux distribution(s) of a finished product

2008-10-07 Thread bhaaluu
Hi Keith,
Thanks for considering GNU/Linux to release your game to.
The main thing is the Python/PyGame source code.
The source code shouldn't call any MS-Windows or Mac OSX specifics.
In the past, I've had problems with the following:
MS-Windows developers putting the wrong slash in pathnames.
Mac OSX developers using Mac-only fonts, etc.
Otherwise, GNU/Linux, no matter which distro, pretty much fishes
from the same free software pool.
This is what I expect when I untar a tarball:
a directory is created with everything in that directory.
the top directory has a main.py or nameOfYourGame.py file
which, when run at the command-line, starts everything.
That's it!
GNU/Linux don't need no steenkin' EXE's, etc. 8^D
Since I run Python/PyGame on GNU/Linux, I expect to have to
go in and modify the source code (at least a little bit) to get the
game running. That's okay! Really.
Just make a tarball of the source, and make it available.
If it's a hit, put it up on SourceForge!

Sounds GOOD!
Dangerous HS Grrls in Trouble!
Need a tester? Send me a tarball.
I run Debian 4.0r3 'Etch' (Stable) GNU/Linux.
Python 2.4.4 and PyGame 1.7.1.
-- 
b h a a l u u at g m a i l dot c o m
Kid on Bus: What are you gonna do today, Napoleon?
Napoleon Dynamite: Whatever I feel like I wanna do. Gosh!


On Tue, Oct 7, 2008 at 5:06 PM, Keith Nemitz [EMAIL PROTECTED] wrote:

 I'm currently investigating how to port my pygame game, 'Dangerous High 
 School Girls in Trouble!' to Linux. I tried to search the archives at ASPN, 
 but failed to find anything relevant.

 I should be able to setup and get the game running, pretty quickly, but it 
 looks like the big barrier will be making distributions for enough flavors of 
 Linux to be worthwhile. Which distros should I target? I read one series of 
 articles on gamedev.net, but it wasn't pygamey enough for my needs.

 My current plan is to run one or more distros under VMWare Fusion on my Mac 
 Pro. Then collect everything in to one folder and use an alias to point to 
 the executable. So when you unzip the download, you get a folder and an alias 
 file. Exe the alias file to run the game. Is that too naive?

 What advice or links can you offer?

 Keith Nemitz
 Mousechief Co.
 www.mousechief.com
 We put mischief in your mouse!





Re: [pygame] Unexpected behavior from BLEND_RGBA_SUB

2008-10-07 Thread claudio canepa
On Tue, Oct 7, 2008 at 7:18 PM, Yumiko Shirasagi [EMAIL PROTECTED]wrote:

 Hello,

 When I blit an image such as this (generated dynamically with PIL, and
 saved here by pygame.image.save)-
 http://xs432.xs.to/xs432/08412/mask808.png
 to this screen, using the line screen.blit(mask, (0, 0), None,
 BLEND_RGBA_SUB)-
 http://xs432.xs.to/xs432/08412/screen136.png
 it results in this-
 http://xs432.xs.to/xs432/08411/tsukiyo3634.jpg

 Is this what is supposed to happen? It seems to me that BLEND_RGBA_SUB
 should respect the the alpha of the surface being blitted and avoid
 subtracting the fully transparent gray pixels. Of course an alternate
 solution is to get rid of those gray pixels, but I'm wondering whether
 it is a bug in pygame, or if there is a solution that doesn't require
 altering the way the surface is generated.

a quick test tells that , at pixel level, pygame 1.8.1release:

sf1 sf2sf1.blit(sf2,None,'BLEND_RGBA_SUB')

(r1,g1,b1,a1)  (r2,g2,b2,a2)   (clamp(r1-r2),clamp(g1-g2), clamp(b1-b2),
255)

Looks wrong to me, but there are not specs for the oper.

--

claxo


Re: [pygame] Unexpected behavior from BLEND_RGBA_SUB

2008-10-07 Thread claudio canepa
...

a quick test tells that , at pixel level, pygame 1.8.1release:

 sf1 sf2sf1.blit(sf2,None,'BLEND_RGBA_SUB')

 (r1,g1,b1,a1)  (r2,g2,b2,a2)   (clamp(r1-r2),clamp(g1-g2), clamp(b1-b2),
 255)

 Looks wrong to me, but there are not specs for the oper.

 --

 claxo

sorry, the prev aplies if both surfaces has no alpha channel.

When both surfaces have alpha channel ,the current behavoir is

sf1 sf2sf1.blit(sf2,None,'BLEND_RGBA_SUB')

(r1,g1,b1,a1)  (r2,g2,b2,a2)   (clamp(r1-r2),clamp(g1-g2), clamp(b1-b2),
clamp(a1-a2))

Seems to follow the pattern of the BLEND_RGB , meaning an oper aplied per
channel ion a separable fashion.

Not so usefull ?