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

Re: [pygame] Pixel Spaceships



Kris Schnee:
> Fun little exercise. Here's my version of the ship generator,
> attached.  Screenshot:
> <http://kschnee.xepher.net/pics/080305pixel_spaceships.jpg> I didn't
> get the cockpit designs "right" in the way Bollinger did, but tried
> superimposing a smaller ship design atop a larger one to get a
> two-tone effect (not seen in that shot).

Neat!  The cool thing about the Bollinger pixel-based technique is that
your bit pattern actually describes a *volume*, so what you're really
doing is drawing a border on any empty pixels NSEW of the one specified.
You then paint the interior with whatever gradient or pattern you're
using separately.

Bollinger did everything on a white background (I blame his desktop
publishing background, which treats screens as paper (even though black
text on a white background is like trying to read the label on a lit
fluorescent bulb to me)).  

For the black background ships I just defined the border as "same HSV
pattern, but with the value cranked way up and the saturation down a
touch" or similar.  This tended to make a more "textured" look, which I
was quite happy with.

> I tried rotating a ship to build a list of rotated images, but the
> rotated versions are often larger than the original, making it hard to
> figure out where to place them. How can that problem be addressed?

As others have said here, it's easier to make a rect of the appropriate
size and then just set its center to the center point you want to anchor
on.  I still get wiggly artifacts with the rotation methods though
(haven't tried rotozoom yet).

-- 
"N'aimez pas votre voiture?                           Nick Moffitt
Alor, l'heure est arrive pour la brulé!"             nick@xxxxxxxx
        -- Mark Jaroski