Pygame Help

B

Blaze Bresko

Hi,

I am trying to make a game using either livewires or pygame. The game
is tetris. Right now I have gotten the program to a point where
everything works (as in user input, score, lines, etc), except I can't
get more than one block to work. Right now I have the user playing a
game where a single block falls at a time instead of one of the seven
different patterns. I was curious how you would program the seperate
images to fall together and not break apart, because pygame and
livewires uses images as collision detection, so therefore you can't
make most of the shapes a single image because they will have
transparent spaces as part of the image, which will make floating
shapes and such.

--Thanks
--Andrew
 
M

Marc 'BlackJack' Rintsch

Blaze Bresko said:
[Tetris] I was curious how you would program the seperate images to
fall together and not break apart, because pygame and livewires uses
images as collision detection, so therefore you can't make most of the
shapes a single image because they will have transparent spaces as part
of the image, which will make floating shapes and such.

I wouldn't rely on the graphics library at all but create a "model" of the
game that's completely independent from the graphics. I think a two
dimensional structure with lists of lists is the simplest solution.

Ciao,
Marc 'BlackJack' Rintsch
 
L

Lee Harr

I was curious how you would program the seperate
images to fall together and not break apart, because pygame and
livewires uses images as collision detection, so therefore you can't
make most of the shapes a single image because they will have
transparent spaces as part of the image, which will make floating
shapes and such.

The way I did it was to compose the shapes out of squares.
The implementation is available in the pygsear-games
distribution. You'd need pygsear also, to play the game.

http://www.nongnu.org/pygsear/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top