"alienWave"
-----------
Each atack wave (alienWave) (as pointed to in alienLevel) is a string of 32 words that each point to the alien to initialise.
The first bank (0) is a 32 word blank area so that 0 can be used to denote no-attack in alienLevel.
AlienWave is just 32 words and each is the number of an alien (singular) that is defined as described later. A 0 in the wave denotes "no more aliens".
BUT... (another addendum)
ok, in the alienwave... the high word (top 16 bits) of the "alienDescript" to be initialised, are used as an X offset.. This way you can set an alien to init at 0,0 and offset it across the screen. this does not modify any tracking points, but i may add that..?
Ok, now the tricky bit!!!!!
"alienDescript"
---------------
This is used to describe a singular sprite in the game and uses hi/low split words to keep the data down to just 8 words for the main description and 22 words for the movement data.
The first 8 words are as follows...
Word 1
------
Low 16 = Initial X coord of the alien
High 16 = FIRE - Amount of bullets to fire in BURST mode (0=normal fire)
High 16 = OR, for random fire set to 32768 (and rate in word 2)
word 2
------
Low 16 = Initial Y coord
High 16 = FIRE - Delay between BURST shots
High 16 = OR, random rate (0-65535 = higher=more frequent)
word 3
------
whole 32 = Initial X speed in CURVED mode
OR overal speed when in LINEAR mode
word 4
------
whole 32 = initial Y speed in CURVED mode
OR, set to 1024 to signal this alien is LINEAR mode
word 5
------
Low 16 = Max speed, this is an overal speed that governs both
X and Y speeds
High 16 = Friction! the time it takes for a CURVED alien to turn
the higher the slower (4-8 is a good base)
leaving at 0 will set the default of 5
word 6
------
whole 32 = Sprite object. This is the image to use for the alien.
word 8
------
low 16 = Hits to kill... (0= one shot)
high 16 = Shot speed, the speed in pixels the bullets move
word 8 (i may make this a 16/16 split)
------
Low 16 = Fire type (0=none)
high 16 = Fire delay, how long till next shot or next BURST shot(s)
(set to 0 if using random shots)
So, that describes a single alien, the next 24 words tell it what to do..
These are paired
part1, part2, part1, part2, part1, part2, and so on....
The use of these changes depending on the alien type...
CURVED ALIEN
------------
part1, part2 = Track x,y
A curved alien starts at the initial x,y coord and uses intertia/friction to move to the next track point based on the settings in alienDescript. When the alien reaches the track x,y point, it will then head to the next and so on, unless:-
if part1=1024 it will track YOU on the X axis
if part2=1024 it will track you on the Y axis
or, make both 1024 and it will hunt you down,
(this ends the tracking as a pattern based alien)
set part1 and part2 to 2048 and this will instantly kill the alien.
this does not explode but is handy if you tuck an alien off the screen
and want rid of it.
if part1 and part2 are 0, or it is the last part of the 24 words, then
the attack motion will loop.
LINEAR ALIEN
------------
part1, part2 = Direction, Distance
A linear alien starts at the set init coords and moves in the direction (1-9) and moves in that direction the set number of pixels set in part2
unless:-
set part1 and part2 to 2048 and this will instantly kill the alien.
this does not explode but is handy if you tuck an alien off the screen
and want rid of it.
if part1 and part2 are 0, or it is the last part of the 24 words, then
the attack motion will loop.
ADDENDUM:
---------
further to part1, part2 as described above... if the high 16 bytes of part one are anything other than 0, it has this effect:-
1 = set speed of alien to 0
2 = set speed of alien to 1
etc.
for a linear alien, this is a direct change.
for a non-linear alien, this changes the maximum speed the alien can travel.
--------------
OK,
Well, i hope that makes some sense...