[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Some particle system insights



ShredWheat writes:

 > 
 > the other thing you might try is using the fill function to fill
 > a 1x1 rectangle. i'm curious how it compares in speed with the
 > other two.

As my friend Kodos from the Simpsons says, "Holy Flurking Schmit!"
That's even faster than set_at, and it will maintain its speed on
hardware video surfaces. I'd forgotten about fill. I'm sold.

 > also, what depth of surface is this? i'm curious if it is 8bit?
 > also, are the bullet colors constant or varied?
 > 

16 bits, all bullets are the same color. (although... nah. Too disco.)

 > yeah, i noticed when writing aliens that i could get a big speedup
 > by letting pygame loop over my rectangles instead of python. hence
 > the two Rect functions, Rect.collidelist() and Rect.collidelistall().
 > I've heard it mentioned before (and i mostly agree) that these are
 > some ugly function names. collidelist() is good for finding if
 > any rectangles overlap, collidelistall() is good for finding 'all'
 > the rectangles that overlap.

Yes, these are excellent functions. Actually, I don't have a problem
with the current names. The old names... well, colliderectall is funny
the first time, but the fiftieth time you type it...

 > perhaps the easiest road here would be to add some collide functions
 > for lists of points in the Rect. two questions then...
 >

What I was looking for was actually the opposite - collide a single
point vs. a list of rects. It looks like fill is the way to draw fast
1x1 squares while maintaining the rect advantages, so this isn't that
important to me anymore.
 

 > i never closed the door on this issue when writing pygame. it
 > definitely is in the category of 'tackle it when we get there'.
 > i suppose that now we are "there". :]

Well, that depends. I'd be interested in hearing how other people are
getting along with pygame's collision-related routines.

-- 
David "Futility [D!]" Clark  |        If I was beautiful like you        |
silenus@telus.net            |          I'd be quick to assume           |
-------------------------------------------------------------------------/

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org