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: 1867

Author: andrewbroad

Date: 09/02/2001

Subject: Arrows in JSW: Getting them in phase

 

I had a devil of a job getting the arrows in
phase for "HOLY UNORTHODOX" (in Goodnite Luddite), but
in the end I did work out a useful
formula.

An arrow cycles from column 0 to column 255 (columns
0 to 31 are the on-screen columns) if it's a right
arrow, and from column 255 to 0 (step -1) if it's a left
arrow. (In Geoff Mode, only columns 0 to 127 are used
for arrows.)

So if you wanted to have four
left arrows or four right arrows coming at regular
intervals (i.e. an arrow comes four times as often as if
you had only one arrow), you would set their start
columns to {0, 64, 128, 192}, or {255, 63, 127, 191}, or
whatever.

But what if you wanted to mix left and right arrows,
and still have them come on at regular intervals?
It's much more difficult to get your head around,
because:
- Right arrows cycle forwards through the columns,
left arrows backwards, so it's a 256-n situation.
-
Right arrows first appear in column 0, left arrows in
column 31, so there is a displacement of 31. So L = R+31
(mod 256).

Combining these two points yields
the following formula to make a left arrow appear at
the same time as it would if it were a right
arrow:

L = 256-R+31 (mod 256)

=> L = 287-R (mod
256)

I must confess I'm not 100% convinced with my own
working (it's like one of those nasty `A' Level Physics
problems), but it did the trick for "HOLY UNORTHODOX"!
;-)

--
Andrew
Broad
http://www.cs.man.ac.uk/~broada/ target=new>http://www.cs.man.ac.uk/~broada/>
http://www.cs.man.ac.uk/~broada/spectrum/ target=new>http://www.cs.man.ac.uk/~broada/spectrum/>
http://www.cs.man.ac.uk/~broada/spectrum/willy/ target=new>http://www.cs.man.ac.uk/~broada/spectrum/willy/>

P.S. I've wrote a new room for Goodnite Luddite last
weekend, "PARTIAL CONFESSION", bringing the total up to
13.

 

 

arrowleft
arrowright