[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Surface Sprite Rect -> HELP



Inside....


Am 21.11.2006 um 04:14 schrieb Nicolas Bischof:

thanks, but when clearing a row i will need to have the moving methods
of my piece class.
Sure, thats no problem, even if all fallen tiles are in one surface. Just cut the full row out and put then the upper blocks on top of the lower blocks.

My piece class has a group of sprites and methods to spin and move the
piece, also i built a collision detection system in the piece.
Seems you made it working. So you're on a good way...

But you say when the piece hits the ground i just blit it. I´m not
sure what do you mean...
What I ment is that all fallen (and no more moveable tiles) can be blitted to the "fallen tiles surface". I dont see any reason why to keep fallen tiles separate (sprites).

now y have a class witch contains all the fallen pieces in a list and
handles the clearing of the row, to draw the fallen pieces i iterate
over the list and use the draw method for each sprite group of the
piece, ¿how would you do it?
Was thinking of a logical list in background too to control/ manipulate. Why painting the fallen list again and again? I think its enough to paint the fallen one.



On 11/20/06, Farai Aschwanden <fash@xxxxxxxxxx> wrote:
Hello

Spotter already explained very well and short the differencies. Imho
I suggest you dont use the sprite module that glows up on handling
many sprites (sprite groups). The only active sprite you might have
in Tetris is the falling tile that you can easily handle as a
surface. If one falling tile touches the ground you can blit it into
the surface where all fallen tiles already are in.
Just an idea how you could do it. Im sure there are many more and you
probably know how to do it.

Good luck
Farai


Am 20.11.2006 um 21:36 schrieb Nicolas Bischof:

> Greetings!
> i´m making my first game, it will be a Tetris.
> But i sill don´t understand when to use Surfaces, Sprites and Rects,
> and their intended propose and their best utilization scenario.
> could someone explain the relation of Surface, Sprite and Rect, their
> ideal intended propose?