Re: [pygame] Question about .bmp files and transparency
by Pete Shinners other posts by this author
Sep 10 2003 2:39PM messages near this date
RE: [pygame] Question about .bmp files and transparency
|
Mailing list vs. forum - WAS: Re: [pygame] Question about .bmp files and transparency
Erlend Strømsvik wrote:
> Next goal will be the terrain. -One must have some terrain which one
> can blow sky high! :)
> Most likely I will have to use pixel comparison here (with 'Numeric
> wizardry' ;) and the fastest thing might be to test on the terrains
> alpha layer? I'm not sure but it doesn't seem too stupid... :-|
> When a bullet is fired, I could calculate the trajectory at once, so
> I'll know where the bullet -should- explode and not having to do pixel
> tests inside the bullet update loop.
not sure how your terrain is going to work. another option is creating
a second hidden surface with just a few colors and using that to
determine which pixels are passable, plus with the colors you can
control other effects, like which pixels are unexplodable, etc.
use an 8bit image for this and its easy to work on with Numeric.
remember to apply changes to either image to both.
i remember someone recently in the #pygame irc chatroom was doing a
driving game with this technique. the collision test code is out there.
Thread:
Pete Shinners
Ricardo Quesada
caffeine@tuxfamily.org
=?ISO-8859-1?Q?Nicol=E1s_Ech=E1niz?=
=?iso-8859-1?Q?Erlend_Str=F8msvik?=
SB
=?iso-8859-1?Q?Erlend_Str=F8msvik?=
Pete Shinners
=?iso-8859-1?Q?Erlend_Str=F8msvik?=
Pete Shinners
R. Alan Monroe
Fredrik Johansson
bob@threeoh.com
Pete Shinners
bob@threeoh.com
Caffeine@Tuxfamily.Org
|