|Token code:||206/$CE 3/$03|
in BASIC ROM:
|List of all BASIC keywords|
-- Return sprite collision information
Type: Function General Programming-Syntax: BUMP (N)
To determine which sprites have collided since the last check, use the BUMP function. BUMP(1) records which sprites have collided with each other and BUMP(2) records which sprites have collided with other objects on the screen, COLLISION need not be active to use BUMP. The bit positions (0-7) in the BUMP value correspond to sprites 1 through 8 respectively. BUMP(n) is reset to zero after each call.
The value returned by BUMP is the result of two raised to the power of the bit position. For example if BUMP returned a value of 16, sprite 4 was involved in a collision since 2 raised to the fourth power equals 16.
Examples[edit | edit source]
Indicates that sprite 2 and 3 have collided.
Indicates that sprite 5 has collided with an object on the screen