Resource centre for ZX Spectrum games
      using Manic Miner and Jet Set Willy game engines

 

Archive of the

Manic Miner & Jet Set Willy Yahoo! Group

messages

 

 

 

Message: 6898

Author: ian.rushforth

Date: 18/07/2016

Subject: Re: Laterally inverting a diagonal guardian

 

Andrew wrote:

> The explanation is that a JSW horizontal guardian that goes right
initially (as the left-hand skier does) always starts on its leftmost
sprite-frame, but so does a horizontal guardian that goes left
initially! (A DG is best thought of as a HG with a vertical speed.)

> This means that (without patching the game-engine), it is impossible
to laterally invert a HG or DG exactly: if you map its start-column
from x to 30-x, it'll be 3 steps forward (when mapping the initial
direction from right to left) or 3 steps behind (when mapping the
initial direction from left to right).

>>>


When mirroring a Horizontal Guardian, if you set Bits 5 and 6 of the 0th Byte of the Guardian Definition, then you can achieve true symmetry.


e.g. If the Guardian in original JSW sets off rightwards, it starts with right-facing Animation Frame 0 (but that is incremented to Animation Frame 1 before it is first drawn on the screen).  So when inverting, if you set Bits 5 and 6 of the 0th Definition Byte then it will start off moving leftwards using Animation Frame 3 (but that is decremented to Animation Frame 2 - which is the 'old' Animation Frame 1 mirrored - before it is first drawn).


You then don't have to offset the starting position by one cell to (almost) compensate for an asymmetry.


Presumably the same thing is true of Diagonal Guardians?

 

 

arrowleft
arrowright