Hello, Guest the thread was called204 times and contains 2 replays

last post from MightyAxle at the

Need advice with Sprite Collision Detection using the BUMP command

  • Hi Everyone 😊


    I am using the BUMP command for data collision with background PETSCII.


    If I use the SPRITE 0 it works perfectly.


    However, if I use SPRITE 0 with SPRITE 1 both are counted rather than SPRITE 0. ( for example SPRITE 1 is thrust from a Space Ship )


    Here is my current small routine :


    580 C = BUMP(2)

    590 IF (C <> 0) THEN ... ( goto collision routine )


    I have tried to change the number in the (C <> 0) but nothing works for some reason. Must it be something simple?


    Many thanks. :thumbup:

  • If i read the manual right, you want to use BUMP(2) to check for sprite-data collisions, then go to collision routine if (C AND 1) <> 0.


    The BUMP commands returns a bitfield of all sprites that have collided, and you only care for sprite 0.

    Many thanks. 👍


    I did try it but the results were the same.


    However, if every time you use the BUMP command for either BUMP(1) = SPRITE to SPRITE or BUMP(2) = SPRITE to BACKGROUND setting a different letter or short variable works every time e.g.


    580 P = BUMP(2)

    590 IF P AND 1 THEN GOTO 940 ( Sprite to Background for Sprite 1 )


    I am so glad this works. 😊


    Not long now until I release my second MEGA65 game / project. 👍