Prev: 47459 Up: Map Next: 47515
47481: Apply Gravity And Move
Applies gravity to an object, then moves it by its speeds, limited to where it is able to go by BlockMovement, which changes the speeds. ApplyGravityAndMove_AddSpeeds only moves the object.
Input
IX The address of the object
Speed the fall, then stay clear of walls and other objects.
ApplyGravityAndMove 47481 DEC (IX+11) Reduce the speed along z by one, which is gravity.
ApplyGravityAndMove_Move 47484 CALL BlockMovement Call BlockMovement to move the object.
This entry point is used by the routine at MovePlayer.
Add the speeds to the position.
ApplyGravityAndMove_AddSpeeds 47487 LD A,(IX+1) Fetch the x position of the object.
47490 ADD A,(IX+9) Add the speed along the x axis.
47493 LD (IX+1),A Set the new x position.
47496 LD A,(IX+2) Fetch the y position of the object.
47499 ADD A,(IX+10) Add the speed along the y axis.
47502 LD (IX+2),A Set the new y position.
47505 LD A,(IX+3) Fetch the z position of the object.
47508 ADD A,(IX+11) Add the speed along the z axis.
47511 LD (IX+3),A Set the new z position.
47514 RET Return.
View the equivalent code in;
Prev: 47459 Up: Map Next: 47515