Set <
dirdir>
(
direction of diagonal, / or \)
Set <
dirfase>
(
phase of diagonal -zig or zag)
Get <
curdir> from <
stepcode>
table (flagcode-1, edgefase)
Convert <
curdir>
into directional increments for Space Object
Store current (
X,Y) position in
<tempos>
Set <
diractive>
flag to
<1> (
simulating a diagonal movement)
------------------------
Main Process
Set End of Scan flag to <0> (scan not yet ended)
Depending on <
zigsw> follow
Zig Process or
ZigZag Process
Increment
(
X,Y)
position
of Space Object
Zig Process
IF (X,Y) position at an
edge or corner (flagcode
!= 0) THEN
Make edge step Move
Set (X,Y) position to <tempos>
Increment
Space Object to new
edge position
Store current (
X,Y) position in
<tempos>
Prepare diagonal move
Get <
curdir> from <
dircode> table (dirdir,
dirfase)
Convert <
curdir>
into directional increments for Space Object
Set <
diractive>
flag to
<1> (
signaling a diagonal movement)
ZigZag
Process
IF (X,Y) position at an
edge or corner (flagcode
!= 0) THEN
IF just
made diagonal movement (
diractive
= 1)
THEN
Prepare Edge step
Get <
curdir>
from <
stepcode>
table (flagcode-1, edgefase)
Convert <
curdir>
into directional increments for Space Object
Reverse phase of <
edgefase > (
edgefase = 1 -edgefase)
Set <
diractive>
flag to
<0> (
signaling a step movement)
IF just made step movement (
diractive = 0) THEN
Prepare Diagonal movement
Get <
curdir>
from <
dircode>
table (dirdir, dirfase)
Convert <
curdir> into directional
increments for Space Object
Set <
diractive> flag to
<1> (
signaling a diagonal movement)
------------------------