Re: [pygame] pygame-website under development?

2010-05-22 Thread Khono Hackland
That sounds like a good idea, Enrico.  Often it isn't explicit just
how complete a posted game (or program) is.

On 22 May 2010 03:11, Enrico Kochon ekoc...@uni-osnabrueck.de wrote:
 Hi,

 ist www.pygame.org still under active development? Does anybody know who
 is responsible? Is it Pete Shinners?
 http://www.pygame.org/wiki/todo mentions planned development tasks like
 a ranking system and so on.

 I would like to add one feature to the wishlist: a flag concerning the
 readiness of a game.
 There are so many games, thats great, but it is very complicated to find
 games which are developed far enough to be really playable.

 Best regards,
 Enrico



Re: [pygame] Working with maps

2010-05-18 Thread Khono Hackland
After reading all these posts, it seems to me the simplest way to do
it, assuming you have to draw out all the countries anyway, is to draw
a layer on the original image with each country being its own RGB
value.  So just draw solid colours of the countires, being as precise
or vague as you care to be, not worrying about keeping to specific
geometric shapes.  The differences could be on just one of the RGB
colour values, so (255,255,100), (255,255,95).  Easy to fit them all
on if you're not really worried about having high-contrast colours.
The layer could be invisible to the player, so, two surfaces.  One
that's blitted to screen and the other with the colours that isn't.
When checking for which country the mouse clicked on, as Henrique
Nakashima said, just check the colour value of the modified-colour
surface.  Based on what colour it is, the program will know which
country.  You could even assign the colours simply based on
alphabetical order of the countries.  So country 1 = (255,255,255), 2
= (255,255,250), etc.  Thus vastly simplifying the testing.  And if a
mouseclick is not on a country but on an ocean or something, the
modified-colour surface won't have a colour there so you don't need to
do any further processing on that click.

If you want to add coloured borders to the countries, you could write
a simple algorithm to create yet another surface from your
modified-colour countries.  So for example, you could write out that
any of the custom colours that is completely surrounded by the same
colour pixels is removed.  In this way, all thecoloured pixels that
aren't border pixels would be removed.  You could then blit the
resulting surface over the display surface.  You could further refine
that to create a more complicated border if you wish, perhaps with
fade.  And all these surfaces could be computed and saved as
individual images before run-time, saving on resources.

But I'm just a newb. so maybe this has huge pitfalls I don't see.

On 18 May 2010 12:54, Bill Coderre b...@mac.com wrote:
 On May 17, 2010, at 9:47 PM, Miguel Bejar wrote:

 I have the same problem as the OP, I need to find a way to have a map with
 irregular shapes and have the exhibit different behaviors depending on user
 input. I don't know what the term for that is so I haven't been able to
 start doing any research as to how to go about it.

 In general, the problem is to decide WHICH graphical region (the outlines of
 the various countries) encloses a point (the cursor). This is sometimes
 called Point in Region (Polygon) testing, but the more common term is hit
 testing.

 This looks long and somewhat
 promising: http://stackoverflow.com/questions/217578/point-in-polygon-aka-hit-test

 PyGame has a Sprite system, as others have mentioned. There's a tutorial
 document here: http://www.pygame.org/docs/tut/SpriteIntro.html

 Hint: Do not optimize until
 1) You have something that actually works, and
 2) It definitely is not fast enough.
 I suggest this because:
 1) It is very easy to get distracted by optimizing
 2) Hit testing is one of the more fascinating places to reinvent
 optimizations
 3) Optimizations often introduce subtle bugs
 4) PyGame sprites have many of these optimizations already
 5) http://en.wikipedia.org/wiki/The_Elements_of_Programming_Style




Re: [pygame] Running Python 2.5 alongside 2.6

2010-04-28 Thread Khono Hackland
I believe this is the link to page creation:
http://www.pygame.org/wiki/CreatePage

I don't see any fields for entering the title though.

On 28 April 2010 11:39, James Paige b...@hamsterrepublic.com wrote:
 On Tue, Apr 27, 2010 at 10:18:34PM -0300, claudio canepa wrote:
    On Tue, Apr 27, 2010 at 10:13 PM, Julian Marchant onp...@gmail.com
    wrote:

      The pygame download page's message that python 2.5 is the best for
      Windows probably made him think that Pygame was for Python 2.5.

    That was a very old sugestion.
    I run pygame with python 2.6, and a lot of people in the pyweek event,
    with diferent operating systems the same.
    There are no problems.
    In the download select the the file for your operating system marked with
    the py2.6

 Yeah, a lot of people have been confused by that. Can someone who has
 access permissions to edit http://www.pygame.org/download.shtml please
 remove it?

 I suggest adding a link on that page like How do I decide which python
 version to use with pygame? which could point to a wiki page which
 could outline the pros and cons of each python version as it applies to
 pygame.

 ... I just tried to create a wiki page for that purpose, but I can't
 figure out how to create new pages, only edit existing ones :(

 ---
 James Paige



Re: [pygame] problems getting python 3.1 to work with pygame 1.9

2010-04-17 Thread Khono Hackland
It is indeed for python 3.1.  The book tells the user, on page 5,
specifically to get 3.1 and gives this link:
http://www.delmarlearning.com/companions/index.asp?isbn=1435455002

Presumeably the downloads link there allows the reader to get a
working set of programs but the link's not working for me.

On 17 April 2010 23:29, Luke Paireepinart rabidpoob...@gmail.com wrote:
 Hence why I asked for the names of the books... He says they are for
 py3.1 and pygame which I thought was quite odd. I'm on my phone so I
 can't check. Not many people use py3 yet.

 On 4/17/10, Greg Ewing greg.ew...@canterbury.ac.nz wrote:
 Luke Paireepinart wrote:
 Pygame 1.9 was written for 2.x.  python 3.x is not backwards
 compatible.

 On 4/17/10, Pierces pier...@midcoast.com wrote:

I'm trying to set up an Ubuntu 10.04 machine so my son can follow a book
 on
learning Python programming with pygame 1.9 and python 3.1.

 If the book talks about PyGame, it's probably also
 talking about Python 2.x, in which case giving him
 a 3.x Python will only lead to confusion.

 --
 Greg


 --
 Sent from my mobile device