making my first video game
Alex Tweedly
alex at tweedly.net
Mon Jul 4 13:17:38 EDT 2005
Nicolas Cueto wrote:
>Hello All,
>
>I hope I'm not asking for too much hand-
>holding on this one.
>
>The shooting effect in the old space invaders
>game is what I'm after. I'm studying Tuviah
>Snyder's "Bouncy" stack to learn about
>multiple objects moving at the same time
>(the invaders) and the moving paddle
>(the space gun), BUT what has got me
>stumped is how to create the stream of
>"bullets" that shoot out from the gun and,
>upon contact with a targer, set off a reaction.
>
>
>
If I remember correctly (which is doubtful after all these years), the
original Space Invaders only allowed one shot at a time. That was a
significant feature, because it dictated part of the technique needed to
play - it was very expensive to shoot and miss, because you then
couldn't fire again until that missile had dragged its way slowly to the
top of the screen. (Of course, it was really moving quickly, but it felt
like it was going soooo slowly :-)
However, multiple missiles should be quite feasible if you want that.
>Does that make sense?
>
>
That sounds fairly "do-able". I'd be tempted to try button-with-image
for the aliens (and player, and mother ships), but use Geoff Canyon's
"polygon with marker and invisible edge" trick to do the missiles.
Create a polygon graphic, with the "marker edges" set to represent a
missile (e.g.
0,0
2,0
2,-8
0,-10
-2,-8
-2,0
0,0)
and check the 'filled' checkbox. Then place missiles by setting the
points of the polygon, e.g.
100,100
100,60
100,40
100,100
Note the blank lines so the edges aren't drawn, and the last line = the
first line.
Then a simple timer for each 'alien' button (or one timer for all
buttons, but move the aliens one at a time ....) and off you go.
The timer handler for the missile(s) can include the collision detection
with the aliens (I haven't looked at the site Derek gave you - but
beware of using too general a function - for one stream of missiles
matching against a set of same-sized aliens, this should be easy).
--
Alex Tweedly http://www.tweedly.net
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.8/37 - Release Date: 01/07/2005
More information about the use-livecode
mailing list