Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Pygame Help

Reply
Thread Tools

Pygame Help

 
 
Blaze Bresko
Guest
Posts: n/a
 
      07-29-2006
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

 
Reply With Quote
 
 
 
 
Marc 'BlackJack' Rintsch
Guest
Posts: n/a
 
      07-29-2006
In < .com>, Blaze Bresko
wrote:

> [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
 
Reply With Quote
 
 
 
 
Lee Harr
Guest
Posts: n/a
 
      07-29-2006
> 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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[newbie] help with pygame-tutorial aapeetnootjes Python 2 04-10-2012 10:58 AM
[pygame-bug] Pygame.cdrom bug rantingrick Python 1 01-30-2011 04:40 AM
Pygame 1.6 Released Pete Shinners Python 0 10-23-2003 06:39 PM
Tkinter and Pygame Kathleen Kudzma Python 0 09-16-2003 11:41 AM
mpeg problem with pygame AnsNum Python 2 08-27-2003 02:50 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57