.AddPointToObject LDA xObjectLo,Y \ Set object Y's x-coordinate to the following: CLC \ ADC xPointLo,X \ (xObjectHi+Y xObjectLo+Y) + (xPointHi+X xPointLo+X) STA xObjectLo,Y \ LDA xObjectHi,Y \ i.e. we add object Y's x-coordinate and point X's ADC xPointHi,X \ x-coordinate STA xObjectHi,Y LDA yObjectLo,Y \ Set object Y's y-coordinate to the following: CLC \ ADC yPointLo,X \ (yObjectHi+Y yObjectLo+Y) + (yPointHi+X yPointLo+X) STA yObjectLo,Y \ LDA yObjectHi,Y \ i.e. we add object Y's y-coordinate and point X's ADC yPointHi,X \ y-coordinate STA yObjectHi,Y LDA zObjectLo,Y \ Set object Y's z-coordinate to the following: CLC \ ADC zPointLo,X \ (zObjectHi+Y zObjectLo+Y) + (zPointHi+X zPointLo+X) STA zObjectLo,Y \ LDA zObjectHi,Y \ i.e. we add object Y's z-coordinate and point X's ADC zPointHi,X \ z-coordinate STA zObjectHi,Y RTS \ Return from the subroutineName: AddPointToObject [Show more] Type: Subroutine Category: 3D geometry Summary: Add a point vector to an object's coordinatesContext: See this subroutine in context in the source code References: This subroutine is called as follows: * CheckIfAlienIsHit (Part 2 of 2) calls AddPointToObject * FireGuns calls AddPointToObject * UpdateBullets calls AddPointToObject
This routine adds a point vector in (xPoint, yPoint, zPoint) to the object coordinates in (xObject, yObject, zObject), storing the result in the object coordinates. In other words, this moves an object by the xPoint vector. This is called MOBJ or UOBJ in the original source code.
Arguments: X The ID of the point vector to add to the object Y The ID of the object to update
[X]
Variable xObjectHi (category: 3D geometry)
High byte of the x-coordinate for an object
[X]
Variable xObjectLo (category: 3D geometry)
Low byte of the x-coordinate for an object
[X]
Variable xPointHi (category: 3D geometry)
High byte of the x-coordinate for a point
[X]
Variable xPointLo in workspace Main variable workspace
The low byte of the x-coordinate for the point with ID X is at xPointLo,X
[X]
Variable yObjectHi (category: 3D geometry)
High byte of the y-coordinate for an object
[X]
Variable yObjectLo (category: 3D geometry)
Low byte of the y-coordinate for an object
[X]
Variable yPointHi in workspace Main variable workspace
The high byte of the y-coordinate for the point with ID X is at yPointHi,X
[X]
Variable yPointLo in workspace Main variable workspace
The low byte of the y-coordinate for the point with ID X is at yPointLo,X
[X]
Variable zObjectHi (category: 3D geometry)
High byte of the z-coordinate for an object
[X]
Variable zObjectLo (category: 3D geometry)
Low byte of the z-coordinate for an object
[X]
Variable zPointHi (category: 3D geometry)
High byte of the z-coordinate for a point
[X]
Variable zPointLo in workspace Main variable workspace
The low byte of the z-coordinate for the point with ID X is at zPointLo,X