answer (reprise)

new topic     » topic index » view thread      » older message » newer message

>
> for i=1  to 30 by 1 do--number of bitmap (+1 for indexing in sequence purposes
)
> for poop = 1 to (length(tank[i]))  do
>     for aloop = 1 to 29  do--length of bmp file
>
>         a=tank[i][poop][(aloop)]

ok, here's a more complete answer:
tank is a sequence of IMAGES, without palettes, tank[1]=frame 1
tank[2]=frame 2, etc.  "i" is the FRAME number 1-30.  Each frame is of
the tank facing a different angle, -OR- of different distances from you,
depending on which demo the code was ripped from

Length(tank[i]) is HOW HIGH frame i is in pixels
poop (don't ask!) is indexing down vertically scanline by scanline of
tank image i

aloop is indexing horizontally along scanline poop of image i

a=tank[i][poop][(aloop)]=tank[i][poop][aloop]=the pixel color aloop
pixels from the left side of scanline poop of tank image i.

When I draw into the virtual screen, I check to see if a > 0. 0 is my
masking color, anything color 0 in a "sprite" will be transparent. If a>0
then I replace the appropriate pixel in the Virtual Screen with a.

It's really VERY simple about the 5th time you do it.  Keep playing with it.

Now the asteroids thing will take longer to explain... =)  I've had 50+
asteroids animating on the screen without any trouble, aside from a
strange bug in my screen update procedure that draws something wierd in
one of the corners somethimes. Get out the raid can.

Michael Packard
A Crash Course in Game Design and Production
http://exo.com/~lgp/euphoria
lgp at exo.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu