Re: [pygame] Is PyGame dying?

2010-01-27 Thread Michael George
Actually, despite the slightly lower activity recently, I've found this forum to be active and helpful and was quite surprised at the initial complaint in the thread. I think the pygame developers and community do a great job given that it's a completely volunteer effort. Thanks guys! --Mike

Re: [pygame] "Paths"

2010-01-23 Thread Michael George
You might consider cairo. --Mike Bill Coderre wrote: So I've been hacking Mac OS X's "Core Graphics" as a way of learning iPhone coding (gotta sharpen those job skills), and I was wondering if there's an extension to pygame or python somewhere that implements "path" based graphics. In this m

Re: [pygame] Trolls Outta Luckland - 0.0.4

2010-01-02 Thread Michael George
On Sat, Jan 2, 2010 at 8:27 AM, Michael George mailto:mdgeo...@cs.cornell.edu>> wrote: In 0.0.4: ImportError: Bad magic number in lib/game_globals.pyc $ cd /home/mdgeorge/tmp/trolls_outta_luckland $ ./Trolls_Outta_Luckland.py Gumm Forget that. Loo

Re: [pygame] Trolls Outta Luckland - 0.0.4

2010-01-02 Thread Michael George
nd.py", line 989, in main jukebox = gumm_sound.Jukebox() NameError: global name 'gumm_sound' is not defined --Mike B W wrote: For those of you who yawned at v0.0.3... :) http://www.pygame.org/project-Trolls+Outta+Luckland-1358-2419.html# Many thanks to Michael George and Bryce Schro

Re: [pygame] File Hosting

2010-01-02 Thread Michael George
No. They support cvs and svn if you want to use them, but you can also upload any kind of file to the files section. -M Yanom Mobis wrote: I know about SourceForge, but don't they make you use that SVN thing? I just distribute my games as source code in .zip files. --- On *Fri, 1/1/10, Alex

Re: [pygame] Trolls Outta Luckland - new release

2009-12-22 Thread Michael George
B W wrote: I'm not sure what you mean. If I move the mouse east, the cursor moves east. If I then start moving the mouse west, the cursor immediately jumps to the west of the ship, even if it's currently on the east. --Mike

Re: [pygame] Trolls Outta Luckland - new release

2009-12-22 Thread Michael George
B W wrote: On Mon, Dec 21, 2009 at 9:33 AM, Michael George wrote: Nevertheless, because there's a lot of hand-eye involved in wielding an invisible mouse there probably needs to be a visual cue. But I think I get what you're saying. Correct me if I'm wrong. Picturing it this way

Re: [pygame] Trolls Outta Luckland - new release

2009-12-21 Thread Michael George
B W wrote: wrote: Control scheme interesting and somewhat novel but a little difficult (probably to at least in part to unfamiliarity); there is potential there but it needs refinement. I think I would like mouse to aim, keys to move the ship, personally. Sadly for keyboard and joysti

Re: [pygame] Masks?

2009-12-15 Thread Michael George
I would create separate surfaces and masks for each frame. If you want to keep all the frames in one surface, you can use subsurfaces for each frame: http://www.pygame.org/docs/ref/surface.html#Surface.subsurface. Then create the masks out of the subsurfaces and use Mask.overlap to do the int

Re: [pygame] which python and pygame versions?

2009-12-14 Thread Michael George
My approach is to choose a development platform and then use whatever comes with. For example, I use ubuntu, and then apt-get install python python-pygame. That way things will be painless for me and anyone using the same platform as me. If I later decide I want to make it available then I w

Re: [pygame] how to "think rotation" on a longitude-latitude reference system ?

2009-12-11 Thread Michael George
Massimo Di Stefano wrote: to learn more maybe i need numerical examples, so now i'm creating 2 first function to : transform lon-lat-heading to quaternion representation and viceversa from quaternion to euler angles. something like : euler2quat(lon,lat,heading) quat2euler(q) # where q = a

Re: [pygame] how to "think rotation" on a longitude-latitude reference system ?

2009-12-11 Thread Michael George
Greg Ewing wrote: Michael George wrote: I'm not sure, but I think using that terminology, if you have a quaternion representing your position/orientation on the surface of the sphere, then converting it to euler angles gives your (longitude, latitude, heading) = their (heading, att

Re: [pygame] how to "think rotation" on a longitude-latitude reference system ?

2009-12-10 Thread Michael George
Michael George wrote: Hi Massimo, You may find the quaternions in pyeuler useful: And of course it's euclid, not euler. --Mike

Re: [pygame] how to "think rotation" on a longitude-latitude reference system ?

2009-12-10 Thread Michael George
Hi Massimo, You may find the quaternions in pyeuler useful: http://code.google.com/p/pyeuclid/ I'm not sure, but I think using that terminology, if you have a quaternion representing your position/orientation on the surface of the sphere, then converting it to euler angles gives your (longitu

Re: [pygame] exact algebraic numbers?

2009-11-29 Thread Michael George
Michael George wrote: Greg Ewing wrote: But the back of my envelope is not wide enough to accommodate any more of this. A little bit further and you would have seen the fail: sqrt(3) * sqrt(6) = 3 * sqrt(2) and we're back where we started. However my algebra book assures me

Re: [pygame] exact algebraic numbers?

2009-11-29 Thread Michael George
Greg Ewing wrote: But the back of my envelope is not wide enough to accommodate any more of this. A little bit further and you would have seen the fail: sqrt(3) * sqrt(6) = 3 * sqrt(2) and we're back where we started. However my algebra book assures me (non-constructively) that {1, sqrt(2), s

Re: [pygame] exact algebraic numbers?

2009-11-29 Thread Michael George
DR0ID wrote: Michael George schrieb: Hello, For my game I need to represent right isosceles triangles, and do operations including translation and rotation in 15 degree increments. Unfortunately, I cannot tolerate rounding error, because it will cause bad visual and gameplay artifacts

[pygame] exact algebraic numbers?

2009-11-28 Thread Michael George
Hello, For my game I need to represent right isosceles triangles, and do operations including translation and rotation in 15 degree increments. Unfortunately, I cannot tolerate rounding error, because it will cause bad visual and gameplay artifacts. I'm thinking of representing points as ve

Re: [pygame] Need names and nationalities for AI playes in new sport-game

2009-11-13 Thread Michael George
Michael George, NY USA John Eriksson wrote: I started to search the net to find inspiration for names and nationalities to the AI-players. But then I thought it would be much nicer to use the names and nationalities of pygame developers instead of just using fictive names. [snip] If you

Re: [pygame] Limited Range?

2009-11-03 Thread Michael George
If you find this is too slow, you'll get much better performance by removing the **'s, they're quite slow compared to other arithmetic. Use x*x instead of x**2 and square both sides of the inequality to remove the **0.5. P.F.C. wrote: I'm not getting the attachment but this might help. If y

Re: [pygame] sprite 'weird' rotation

2009-07-19 Thread Michael George
Note that you would need rotate_point or something similar if you want to rotate around a point that's not the center. Michael George wrote: Oops, I made a type. See attached Michael George wrote: Actually, after looking more closely, rotate_point wasn't what you needed. The p

Re: [pygame] sprite 'weird' rotation

2009-07-19 Thread Michael George
Oops, I made a type. See attached Michael George wrote: Actually, after looking more closely, rotate_point wasn't what you needed. The problem was because when you rotate the image, the output is still an upright rectangle, and you were placing (the upper left corner of) that rectang

Re: [pygame] sprite 'weird' rotation

2009-07-19 Thread Michael George
still newbie on Pygame, and i still struggle a lot about how Python deals with variables, arrays, lists, and methods ) if someone know how to fix it, be welcome on editing that, and sharing us the resulting pastebin url - thanks a lot in advance! :) On 7/19/09, Michael George wrote: You can

Re: [pygame] sprite 'weird' rotation

2009-07-19 Thread Michael George
You can use a function from my game: http://pen.svn.sourceforge.net/viewvc/pen/data/parts/cannon.py?revision=31&view=markup see the rotate_point function --Mike Paulo Silva wrote: hi, i confess it seems a bad handle from me about sprite rotation on Pygame - do someone know better how we can

Re: [pygame] main game object using singleton/global/static?

2009-07-18 Thread Michael George
Daniel Jo wrote: Either singletons or globals would work fine. Singletons are more useful when you see a need to enforce a rule that the class must be instanced only once, but if you are the only developer and can trust yourself not to do something silly, globals work just as well. I tend to

Re: [pygame] main game object using singleton/global/static?

2009-07-17 Thread Michael George
Because python modules are just like classes, I tend to avoid the singleton pattern in python and simply use module-level variables. For example, in my game I have: ---globals.py--- import pygame pygame.display.init() screen = pygame.display.set_size(...) # a handful other commonly used vari

Re: [pygame] Bitmask Collision Response

2009-06-06 Thread Michael George
One option I've been investigating is the use of convolutions for bitmask collision response. I've been using it for drag-and-drop collision response, but you might find it useful for other kinds of response as well. The way it works is as follows: if I have an object that's moving through a

Re: [pygame] Re: Implementing save feature

2009-05-22 Thread Michael George
My game pen (http://sf.net/projects/pen) uses XML to save levels and solutions. It's possibly a little fancier than you need because the game itself is extensible, so it uses some python dynamic dispatching. Anyway, you can take a look at the save and load methods of level.py at http://pen.sv

Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread Michael George
Bill Coderre wrote: Is there some unix magic cookie format to explicate this exchange rate? If so, then the battle is mostly won, and we "merely" have to convince the myriad text editors to publish, honor, and obey the cookies, silently sorting out the indentations and replacing whichever with

Re: [pygame] Re: a gsoc idea: networking

2009-03-21 Thread Michael George
. How else would you find even one host? On Thu, Mar 19, 2009 at 7:27 PM, Michael George wrote: Tyler Laing wrote: Haha, point taken. Sorry about that. As a student, I think that one or the other would make a good project, as both would be too much work. -Tyler I totally agree

Re: [pygame] Re: a gsoc idea: networking

2009-03-19 Thread Michael George
Tyler Laing wrote: Haha, point taken. Sorry about that. As a student, I think that one or the other would make a good project, as both would be too much work. -Tyler I totally agree. --Mike

Re: [pygame] Re: a gsoc idea: networking

2009-03-19 Thread Michael George
Tyler Laing wrote: Hi, That sounds remarkably like Bittorrent. If you check the internet archive or other sites, you should be able to find the Python code for Bittorrent before it was closed. I agree - it's very like bittorrent, but with different properties. With BitTorrent every client w

[pygame] a gsoc idea: networking

2009-03-19 Thread Michael George
I'm making a game similar to fantastic contraption ( http://fantasticcontraption.com/ ). One of the cool features of that game is that users can create their own levels and solutions, and they can be shared, ranked and played by other players. I'd love to have that functionality, but like man

Re: [pygame] move problems

2009-02-18 Thread Michael George
pymike wrote: if keys[LEFT]: print True This works, because you're checking to see if the 3rd numeral in the list is positive/true. Just a minor point - it's actually checking if the 3rd numeral is non-zero/true. --Mike

Re: [pygame] Pathfinding

2009-01-28 Thread Michael George
Yanom Mobis wrote: ok, i didn't get any of that There's a mask module in pygame with a Mask class that contains one bit per pixel. It's not in the online docs yet, but in svn head there's a method called convolve that takes in another Mask. If you start with a Mask (lets call it map) which

Re: [pygame] Pathfinding

2009-01-27 Thread Michael George
Yanom Mobis wrote: is it easier to make the game tile-based? if I make every pixel a node, and there are 2 obstacles really close together, how will I make sure something 20 pixels wide doesn't try to go into a 2 pixel wide opening? One possibility is to use the new convolution code in t

Re: [pygame] Pathfinding

2009-01-26 Thread Michael George
Brian Fisher wrote: On Mon, Jan 26, 2009 at 9:01 AM, Michael George mailto:mdgeo...@cs.cornell.edu>> wrote: > One possibility to solving this is to have the npc move as it's performing the algorithm. > i.e. as your search explores a path, the character walks along that

Re: [pygame] Pathfinding

2009-01-26 Thread Michael George
Marius Gedminas wrote: My personal snag with A* is that the NPCs seem to know too much about the map and directly walk the most optimal path without exploration. One possibility to solving this is to have the npc move as it's performing the algorithm. i.e. as your search explores a path, th

Re: [pygame] fast sqrt? and profiling

2009-01-21 Thread Michael George
Marius Gedminas wrote: On Wed, Jan 21, 2009 at 07:45:08AM -0800, Ian Mallett wrote: math.hypot() is good for distance calculation. I did some microbenchmarks a while ago, and math.hypot() was faster than x**2 + y**2. I was surprised. Still, avoiding O(n**2) algorithms would be best.

Re: [pygame] GMArcade Contest, PyGame Users Invited

2009-01-20 Thread Michael George
Wayne Koorts wrote: I'm not personally interested in this, but I don't think it's off-topic for the list. Ditto. +1 -M

Re: [pygame] Re: Working on Retro 80s Game SDK, Looking for general support

2009-01-09 Thread Michael George
The Music Guy wrote: Good point. I was sort of thinking the same thing, actually. I don't think I'll be able to start testing anything, though, until I have a basic world editor ready, otherwise it will be very difficult to create any test levels. Don't know if this is useful, but the game I'm

Re: [pygame] extending pygame masks

2009-01-05 Thread Michael George
Nirav Patel wrote: Sorry about the very long delay on this, but I finally committed Mike's convolve function and tests as revision 1796. Nirav Thanks! --Mike

Re: [pygame] @

2008-12-31 Thread Michael George
Michael Phipps wrote: Yanom - A decorator is a method that takes another method as a parameter so that it can do something. It is usually used for aspect oriented programming. For example: def logThisMethodCall(methodCall) # Do some logging here @logThisMethodCall def myMethod(a,b,c)

Re: [pygame] mouse.set_pos(mouse.get_pos())?

2008-12-19 Thread Michael George
ected in the state. --Mike Michael George wrote: Hello, I'm trying to make a animation which may involve moving the window around, but I want to keep the mouse in the same "virtual" place. I've got the following snippet: xoff = (xres - xpos) / 2 yoff = (

[pygame] mouse.set_pos(mouse.get_pos())?

2008-12-19 Thread Michael George
Hello, I'm trying to make a animation which may involve moving the window around, but I want to keep the mouse in the same "virtual" place. I've got the following snippet: xoff = (xres - xpos) / 2 yoff = (yres - ypos) / 2 x, y = pygame.mouse.get_pos() x+= xoff

Re: [pygame] Blitting to alpha channel or using another image's alpha channel

2008-12-18 Thread Michael George
I've had good luck using colorkey blitting, if the mask is just binary, and if you have a color you know isn't in the image you want to blit. For example, if you know the image doesn't have any magenta, blit the mask in magenta over black, set the color key to black, then blit the mask onto th

Re: [pygame] Rect() not imported

2008-12-14 Thread Michael George
If you import a module, it introduces the name of that module (pygame in this case) into the local scope. That means you can access things inside that module using that name (e.g. pygame.Rect). On the other hand, the from module import name construct imports the name itself. For example, if

Re: [pygame] patch to export mask api

2008-12-05 Thread Michael George
t all. --Mike René Dudfield wrote: Committed revision 1736. I think it looks ok. Did you want to add anything else to it? On Thu, Dec 4, 2008 at 3:26 PM, Michael George <[EMAIL PROTECTED]> wrote: I've attached a patch that exposes the mask api in a separate header file. R

Re: [pygame] extending mask module?

2008-12-04 Thread Michael George
Lenard Lindstrom wrote: I see that the distutils package has an option for exporting names from an extension module on Windows. So if only the init function is non-static why provide a way to export other non-static names? I would like to know where in the Python documentation is says that only

[pygame] patch to export mask api

2008-12-03 Thread Michael George
I've attached a patch that exposes the mask api in a separate header file. Right now it only provides the type object. It follows the same convention as the other exported apis. --Mike /* Copyright (C) 2002-2007 Ulf Ekstrom except for the bitcount function. This wrapper code was originall

Re: [pygame] extending mask module?

2008-12-02 Thread Michael George
Yep :) I heeded your advice. --Mike René Dudfield wrote: ps. are there tests and docs for the new function too? On Wed, Dec 3, 2008 at 2:51 PM, Michael George <[EMAIL PROTECTED]> wrote: Nirav Patel wrote: I've still got checking in convolution on my to do list. I&#

Re: [pygame] extending mask module?

2008-12-02 Thread Michael George
Nirav Patel wrote: The mask module is kind of strange because the Python additions were all after the fact. bitmask.c and bitmask.h were/are a separate C library that is just included in Pygame. That explains the exported functions in bitmask. I'm not clear on exactly what you wanted to do, b

Re: [pygame] extending mask module?

2008-12-02 Thread Michael George
Nirav Patel wrote: I've still got checking in convolution on my to do list. I've been busy with school, but winter break is coming up soon. Sorry, I didn't mean to be a pest. I thought it had been lost in the shuffle :) --Mike

Re: [pygame] extending mask module?

2008-12-02 Thread Michael George
to run config.py afterward to build the Setup file used by setup.py. Lenard Michael George wrote: Greetings, [snip] I'd be happy to spend some time and submit a patch, but I'm not quite sure how it should work. Should mask.c access the bitmask.c functions through the exported

Re: [pygame] extending mask module?

2008-12-02 Thread Michael George
functions static is that then they can have issues being multi threaded if they release the python GIL. ... so I think it'd be best to submit your extensions into pygame I think. Since there's no real C API at the moment. Then we can make sure your extensions are in pyreloaded too. cheer

[pygame] extending mask module?

2008-12-02 Thread Michael George
Greetings, I have some extensions to the mask module for my game, and I'm trying to figure out how to build/package them. For the sake of getting it working I've just hacked them into the pygame source and been building a custom pygame, but obviously that's not a good solution. However as I

Re: [pygame] Getting input from command line

2008-12-01 Thread Michael George
Michael George wrote: Perhaps overkill, and not portable, but you could use the curses module. --Mike Fiona Burrows wrote: I tried using Curses, but it didn't work out too well. I got the input great, but I came across problems when adding strings that went off screen (lol). Rather

Re: [pygame] Getting input from command line

2008-12-01 Thread Michael George
Perhaps overkill, and not portable, but you could use the curses module. --Mike Fiona Burrows wrote: I know this isn't directly related to PyGame but I figured there were worse places to ask a question like this. Does anybody know the best way to get input from the command line? Specifically

Re: [pygame] "Crazy Machine" type game?

2008-11-29 Thread Michael George
I'm working on something along these lines - http://sf.net/projects/pen/ Any interest in joining me? --Mike Joe Strout wrote: Hi all, I'm new to pygame, and only recently returned to Python after nearly a decade in the REALbasic world. So I hope you'll speak slowly and use small words.

Re: [pygame] Recording sound

2008-10-29 Thread Michael George
or python bindings for gstreamer (no link, too lazy) -M Brad Montgomery wrote: Just another though, you might be OK just using the python interface to ALSA http://pypi.python.org/pypi/pyalsaaudio/0.3 On Wed, Oct 29, 2008 at 12:44 PM, Luke Paireepinart <[EMAIL PROTECTED]> wrote: pymedia may

Re: [pygame] Can't install pygame 1.8.1

2008-10-28 Thread Michael George
Install the python-dev packages for your distro. On ubuntu: sudo apt-get install python-dev (or sudo apt-get build-dep pygame) --Mike yanom @linuxmail.org wrote: how do i get the Python header files? - Original Message - From: "Charlie Nolan" <[EMAIL PROTECTED]> To: pygame-users@s

[pygame] pixel-perfect physics?

2008-10-24 Thread Michael George
Has anyone had experience using pixel-perfect collision detection with a 2d physics engine? I've looked into pymunk, but that seems to have baked-in collision detection so I don't see how to do it. ODE has rudimentary python bindings and has separate collision detection, but it's intended for

Re: [pygame] placing a running program's output on a surface

2008-10-19 Thread Michael George
You might be able to do it using the composite extension. With compositing, windows are rendered into textures in video memory, and then you can use these textures with opengl to actually build the display. You might be able to hack it up so that you can use these textures from pyopengl. I s

Re: [pygame] BUG?: clip and Rect anomalies when width or height negative

2008-10-18 Thread Michael George
I think pygame could do much better with degenerate/empty rects. This also comes up in the union and unionall methods - it would be nice to be able to have an empty rect that when unioned into another rect yields that other rect. Then you could write something like u = Rect((0,0),(0,0)) for

Re: [pygame] extending pygame masks

2008-10-17 Thread Michael George
Here are the files. It turns out the actual convolution is much simpler than the one I sent out before, since I learned about the bitmask_draw method and just use that internally. It might be slightly slower, but it's more likely to be correct. As I was coding it up, I realized I'm still not

Re: [pygame] extending pygame masks

2008-10-17 Thread Michael George
! On Thu, Oct 16, 2008 at 5:40 AM, Michael George <[EMAIL PROTECTED]> wrote: Nirav Patel wrote: It's not necessarily a good idea to have stuff that specific to an app in a library. I think it would be good to have the convolution function built into mask, and leave the

Re: [pygame] extending pygame masks

2008-10-15 Thread Michael George
Nirav Patel wrote: It's not necessarily a good idea to have stuff that specific to an app in a library. I think it would be good to have the convolution function built into mask, and leave the rest of the implementation up to the user. As for how to deal with the interface for convolving, perha

Re: [pygame] extending pygame masks

2008-10-15 Thread Michael George
Would it make sense for me to build this right into the Mask module and send you a patch then, or would it be better for me to develop it separately as I have been and share the source with you when it's finished so that you can put it together? I'm still not entirely sure about the interface

Re: [pygame] extending pygame masks

2008-10-14 Thread Michael George
Tue, Oct 14, 2008 at 10:44 AM, Michael George <[EMAIL PROTECTED]> wrote: Thanks, what I need is different - I need to compute overlap_mask for each possible offset, so that I can search for an optimal placement. Of course I could write a loop and call overlap_mask for each offset, but I

Re: [pygame] extending pygame masks

2008-10-14 Thread Michael George
Attached. It's not integrated w/ python yet, but the tricky part is mostly done. --Mike Nirav Patel wrote: Mike Ah, very interesting. Can I see the source on that? I would love to see that included in the Mask module. Nirav On Tue, Oct 14, 2008 at 10:44 AM, Michael George &l

Re: [pygame] extending pygame masks

2008-10-14 Thread Michael George
just import bitmask.h and copy the typedef and defines into your file. Nirav On Tue, Oct 14, 2008 at 9:11 AM, Michael George <[EMAIL PROTECTED]> wrote: hello, I've been working on some code that generates what I've been calling a "hitmask", namely a mask with th

[pygame] extending pygame masks

2008-10-14 Thread Michael George
hello, I've been working on some code that generates what I've been calling a "hitmask", namely a mask with the (x,y) bit set if placing one mask on another offset by (x,y) would cause a collision. It's part of a slick algorithm I'm working on for drag-and-drop collision response. I've impl

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-09 Thread Michael George
r that, there isn't yet a function in Pygame, plus it could get difficult when the object isn't a circle), and then finding the point closest to the mouse that isn't in the mask. It reminds me of robotics stuff I've had to do to create a configuration space. Nirav On Sat, Aug 9, 2008

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-09 Thread Michael George
Nirav Patel wrote: Mike, I'm imagining something like making a mask the size of the window, drawing masks of all the objects you aren't dragging onto it, padding that mask by the radius of the object being dragged (for that, there isn't yet a function in Pygame, plus it could get difficult when

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-09 Thread Michael George
Knapp wrote: Easy fix, more than one sprite. I don't see how to generalize this though.  In general the box isn't a box, but maybe a collection of four objects making up the walls, that the user placed there.  And the objects that they might want to drag into the box could be different

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-09 Thread Michael George
yway, it is the collision response that has to handle this. How would you handle this case? Slide it along one of the colliding objects until it 'fits'? ~DR0ID Michael George schrieb: I don't think that works. Consider an object smooshed between two others. The collisi

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-09 Thread Michael George
n Murmel I did this, IIRC). But probably you know that already. ~DR0ID Michael George schrieb: Thanks for the pointer. That looks like good stuff and I haven't come across it before. I don't think it will apply to my game because of the common case where there's a cluster of obj

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-09 Thread Michael George
Thanks for the pointer. That looks like good stuff and I haven't come across it before. I don't think it will apply to my game because of the common case where there's a cluster of objects that you need to respond to, but I will definitely read it through in more detail. --Mike DR0ID wrote:

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-09 Thread Michael George
Knapp wrote: Yes, I thought that perhaps I did not get it also. So now that I think I do get it. What about using to sprites and pixel perfect collision? One would be the shape and the other would be the hole. If sprites with holes don't work then use a bunch of sprites to create the hole's edge

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-08 Thread Michael George
Knapp wrote: On Fri, Aug 8, 2008 at 5:58 PM, Michael George <[EMAIL PROTECTED]> wrote: It's still somewhat on the back burner, but I've been working on a library to allow you to drag and drop irregularly shaped objects (esp. circles and polygons) while preventing interpene

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-08 Thread Michael George
It's still somewhat on the back burner, but I've been working on a library to allow you to drag and drop irregularly shaped objects (esp. circles and polygons) while preventing interpenetration. It's a surprisingly hard problem and I'm reading a lot of computational geometry papers to find an

Re: [pygame] immediate mode not working?

2008-07-08 Thread Michael George
perhaps it is double buffering? Did you try pygame.display.flip()? --Mike Gabriel Hasbun wrote: Hello there, I open python 2.5.2 and pygame 1.7.1 is being used on the MSDOS command prompt, I initialize python and create a display, and the window opens normally. The problem arises when I try

Re: [pygame] Framerate Normalizer

2008-05-10 Thread Michael George
I usually either use time directly in my calculations (rather than fps), because I find it more natural. Does the velocity depend linearly on thrust, or is thrust an acceleration? If the units on thrust are something like meters per tick squared, then I think you will need to compensate twice

Re: [pygame] Python and Speed

2008-04-18 Thread Michael George
True, although that constant is often on the order of 20, and 40 FPS is a lot different than 2FPS. --Mike Casey Duncan wrote: On Apr 18, 2008, at 9:23 AM, Ian Mallett wrote: OK, my point here is that if C languages can do it, Python should be able to too. I think all of this answers my quest

Re: [pygame] full keyboard control

2008-04-13 Thread Michael George
I know my dad wrote programs for and with me when I was little. Probably not when I was one though :) --Mike Ian Mallett wrote: On Sun, Apr 13, 2008 at 6:08 PM, Brad Montgomery <[EMAIL PROTECTED] > wrote: PS: Do all Father/Mother programmers try to write a game

Re: [pygame] Re: Rotating an Image about another Point

2008-03-16 Thread Michael George
You may also find this function useful, which I've pulled out of one of my games-in-progress (take a look at http://pen.svn.sourceforge.net/viewvc/pen/data/parts/cannon.py?revision=31&view=markup for an example): def rotate_point( pt, rect, angle ): """Maps coordinates from a given rec

Re: is != == (Re: [pygame] Sticky Variables: Terrain Loading)

2008-03-13 Thread Michael George
Heh, so much for "there's only one way to do it in python". We have: y = [x[1], x[2], ..., x[n]] y = list(x) y = x[:] y = deepcopy(x) # slightly different and I would have said y = [z for z in x] I think of these, y = list(x) is probably the "right" way. --Mike Kevin wrote: I remember havin

Re: [pygame] Per Pixel Alpha

2008-02-08 Thread Michael George
Not sure if this is the best way, but surface.set_at takes an rgba color, so you could read the pixel with get_at, change the alpha, and then call set_at. --Mike Ian Mallett wrote: How do I set the alpha value for a single pixel?

Re: [pygame] CD Audio

2008-01-08 Thread Michael George
You might look into gstreamer python bindings if they exist. That's the first place I'd look, although I don't know if that would be portable to windows. --Mike Josh Smith wrote: Does anyone know of a workaround for piping the sound to the sound card? On Windows and even Linux with VLC/Tote

Re: [pygame] CD Audio

2008-01-08 Thread Michael George
Some don't ship with that anymore. I know it took me a while to figure that out when we installed linux on my sister's new computer. windows media players seem to read the audio and pipe it to the sound card, probably so they can do visualizations and stuff, whereas by default the players we

Re: [pygame] Why does my ball vibrate?

2007-12-03 Thread Michael George
At those speeds you need to use relativity to get the right answer anyway. A 1kg mass needs to be moving at roughly the speed of light to accelerate the earth to 1m/s. Ian Mallett wrote: So, if our object masses 1kg., to move the Earth 1m/s., the object must move 199,120,000,000,000,000,000,

Re: [pygame] Why does my ball vibrate?

2007-12-03 Thread Michael George
Lenard Lindstrom wrote: This is less than the Planck length of 1.6 * 10 ** -35 meters so becomes moot. The Planck length would make a natural cutoff for any game physics. :-) I've thought of writing a game with physics operating at the quantum scale, but I couldn't think of anything inter

Re: [pygame] A bunch of newbie questions

2007-11-28 Thread Michael George
I'm not sure exactly what you want, but for x in object: deadStar.grav(x) will call deadStar.grav on each sprite in the sprite group "object". --Mike Miguel Sicart wrote: hi all, thanks a bunch for the answers - I have learnt much, and everything seems to work. I have an extra question, t

Re: [pygame] puzzle piece problem.

2007-11-07 Thread Michael George
If you're doing using a predefined image, I think the easiest way is to blit the mask over the image using the foreground as a colorkey, and then set the background of the mask as the color key on the result. This will leave holes in the puzzle piece if the picture contains the background col

Re: [pygame] Re: manually cutting a picture

2007-11-06 Thread Michael George
Do you want to cut them into curvy non-recangular pieces or are rectangular pieces good enough? I'm not sure how to do non-rectangular pieces although it's an interesting puzzle :) I think you'd need to use the surfarray module. --Mike Marcus von Appen wrote: On, Tue Nov 06, 2007, Joseph k

Re: [pygame] Quick question from newbie

2007-11-01 Thread Michael George
Like has been said here before, use something like: if i <= 9 and i >= 1: ...and python is cool enough that you can just write if 1 <= i <= 9: and it does the right thing. --Mike

Re: [pygame] Quick question from newbie

2007-10-31 Thread Michael George
Michael George wrote: Yes you are. "if i == range(1,9)" compares i against the iterator returned by the range function. Assuming i is a number, it will never be equal (since a number is not an iterator). Your function would print "It worked!" if you called print_i(rang

Re: [pygame] Quick question from newbie

2007-10-31 Thread Michael George
Yes you are. "if i == range(1,9)" compares i against the iterator returned by the range function. Assuming i is a number, it will never be equal (since a number is not an iterator). Your function would print "It worked!" if you called print_i(range(1,9)). I think what you probably want is "

Re: [pygame] Help with the 3rd Lecture, first tutorial

2007-10-31 Thread Michael George
Everything after the > is what you type at the dos prompt. Everything after the >>> is what you type at the python prompt. Everything else is what you should expect the system to respond --Mike kevin hayes wrote: I don't understand the format of your email. Can you perhaps write it in a dif

Re: [pygame] image.load() -->> array?

2007-10-28 Thread Michael George
Just to be pedantic: FSAA is different from motion blur. FSAA renders each frame at a high resolution and then scales it down, which can help remove jaggy pixellated edges. Motion blur renders the scene at a few different points in time and averages them together, which makes the framerate ap

  1   2   >