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

Author: mark wills

Date: 29/03/2009

Subject: Re: The height of Willy's jump

 

That would mean Willy jumps 5 whole characters? That sounds too high... Does he really jump that high? 40 pixels?

Regards

Mark




________________________________
From: andrewbroad
To: manicminerandjetsetwilly@yahoogroups.com
Sent: Sunday, 29 March, 2009 19:30:57
Subject: [Manic Miner and Jet Set Willy] The height of Willy's jump


Jet Set Willy contains the following code:

#8DE3: LD A,(#85D5) ; A:= jump-phase counter
#8DE6: AND #FE ;;;;;; reset the least significant bit of A to 0
#8DE8: SUB 8 ;;;;;;;; A:= A - 8
#8DEA: LD HL,#85CF ;; HL:= address of Willy's vertical position
#8DED: ADD A,(HL) ;;; A:= A + Willy's vertical position
#8DEE: LD (HL),A ;;;; set Willy's vertical position to A

The jump-phase counter is the number of time-frames into a jump Willy is (0 when not jumping, #12 (18) after a full jump has been completed).

Willy's vertical position is specified as 2*y, where y is the number of pixel-rows the top of his head is from the top of the screen.

What the above code is saying is that the number of pixel-rows by which Willy's vertical position is altered changes every two time-frames (AND #FE makes the jump-phase counter appear as an even number that changes every two time-frames) . The SUB 8 instruction makes the offset negative for the first 8 time-frames (so that Willy goes up), 0 for the 9th and 10th time-frames (Willy stays still), and positive for subsequent time-frames (Willy goes down).

The amount that Willy's height varies each time-frame into the jump can be summarised by the following table:

Jump-phase counter | 00 01 02 03 04 05 06 07 08
Height-increment. . | -8 -8 -6 -6 -4 -4 -2 -2 00

Jump-phase counter | 09 0A 0B 0C 0D 0E 0F 10 11
Height-increment. . | 00 +2 +2 +4 +4 +6 +6 +8 +8

It's interesting to see how the behaviour of Willy's jump is affected by altering the value at #8DE9 (36329), which is 8 by default. Most values result in Willy falling through the floor, but #0C (12) seems quite useful for high jumps!

--
Dr. Andrew Broad
http://tinyurl. com/andrewbroad- mmjsw

P.S. I'm 16 unread MM/JSW emails away from updating my List of MM/JSW Games, so it will have to wait until next weekend...







[Non-text portions of this message have been removed]

 

 

arrowleft
arrowright