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

[pygame] renderupdates + groupcollide question



I've got a question about using RenderUpdates groups with groupcollide(). 
 
What I've got are a bunch of stationary sprites one "layer" above the background, 
and then some fast moving sprites that are one "layer" above those. I'm using
groupcollide( stationary, moving, 0, 0) to add to another RenderUpdates group
the stationary sprites that need to be redrawn for the current frame.  I then clear()
everything in the dirty stationary group + the moving group, and then draw()
both.  
 
It works very nicely provided that my moving sprites are slow, but consider this:
 
frame1:  movingsprite_1 intersects stationarysprite_m
frame2:  movingsprite_1 intersects stationarysprite_n
        the clear on the moving group will clear movingsprite_1's rect from it's previous position
        leaving a hole on stationarysprite_m.
 
I guess my question is whether RenderUpdates and groupcollide should even be used for this,
or whether I should roll my own groupintersect that looks at both the previous and current rects?
 
BTW, I also want to say how fun it's been using pygame. I've had a real blast tinkering around with it
for the last couple weeks, writing my first game (pyopyo.sourceforge.net if anyone's interested). Thanks Pete! :-) 
 
 
§(™éšŠX§‚X¬¶œ jg®±êì±ë¥¢¸!¶Úþœ jg¬zéh®