If these rectangles are the same and are going to be constant, you
should use only one single pygame surface. You can wrap it in a sprite
class, esp. if you are going to be doing collisions, but that's not
necessary. Here's an example of using a surface to make a
tessellation, and then moving it, w
Paul Vincent Craven wrote:
If you are not using sprites, you can just iterate through a list
If you are using sprites, you can create an update() method
Or you can directly move them in a loop
Another approach is not to move the rectangles at all, but
leave them relative to some origin and tran
If you are not using sprites, you can just iterate through a list like this
example:
http://programarcadegames.com/index.php?chapter=introduction_to_animation&lang=en#section_8.2
If you are using sprites, you can create an update() method for that
sprite, and then call update() on a sprite group.
I've drawn a couple of 20x20 rectangles on my screen, kind of like this:
#
#
#
#
and I want to move them all at once. I guess I could loop through all of
them and move them individually, but I figured there must be a container of
some sort I could put all of the rectangles in and