Routines |
Prev: E852 | Up: Map | Next: E880 |
|
||||||||||
Maroc's speed is increased/decreased in steps of 8 when keys are pressed. If the value is negative (value is > 128), Maroc is moving right. If the value is 0, Maroc is not moving horizontally, though he may be moving vertically.
A max speed of 32/-32 equates to Maroc moving 8 pixels per game cycle.
|
||||||||||
E860 | CP $80 | If bit 7 is set (value is > 128), Maroc is moving right | ||||||||
E862 | JR NC,$E868 | |||||||||
E864 | LD D,$08 | Increase Maroc's left movement speed by 8 | ||||||||
E866 | JR $E86A | |||||||||
E868 | LD D,$F8 | Increase Maroc's right movement speed by 8 | ||||||||
E86A | LD A,C | |||||||||
E86B | ADD A,D | Add the above to Maroc's speed accordingly | ||||||||
Speed can't be greater than 32 (or less than 224 if Maroc is moving right), so limit speed to this value if it's gone over.
|
||||||||||
E86C | CP $80 | Is Maroc moving left or right? | ||||||||
E86E | JR C,$E878 | |||||||||
Maroc is moving right - max speed check
|
||||||||||
E870 | CP $E0 | Check if we've exceeded the maximum speed for this direction (< 224) | ||||||||
E872 | JR NC,$E87E | |||||||||
E874 | LD A,$E0 | ...If so, set speed to maximum (224) | ||||||||
E876 | JR $E87E | |||||||||
Maroc is moving left - max speed check
|
||||||||||
E878 | CP $20 | Check if we've exceeded the maximum speed for this direction (> 32) | ||||||||
E87A | JR C,$E87E | |||||||||
E87C | LD A,$20 | ...If so, set speed to maximum (32) | ||||||||
E87E | JR $E892 | Jump to the end of the next routine to store the increased speed |
Prev: E852 | Up: Map | Next: E880 |