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: 7089
Author: ian.rushforth
Date: 10/03/2017
Subject: Re: Arrows in JSW: Getting them in phase
Andrew wrote:
> L = 287-R (mod 256)
Or in hex, L = #11F - R
And it works the other way around: R = #11F - L
I find that easier to get my head around, because if you end up with a value greater than #FF (255), the 'modulus' can be simply taken account of by just disregarding the 'hundreds' digit.
e.g. L to R arrow in original JSW: start position = #D0
To calculate the start position of a laterally-inverted arrow:
11F
- D0
= 4F
e.g. R to L arrow in original JSW: start position = #1C
To calculate the start position of a laterally-inverted arrow:
11F
- 1C
= 103
= 03 (drop the 'hundreds' digit)
P.S. Don't forget that the position where the arrow first appears, when Willy first enters a room, has been incremented or decremented along by one column before it is actually drawn to the screen!
