Jump to content
IGNORED

PM Collisions in Advan Basic


Recommended Posts

I've been working with Advan Basic for a few months and really enjoy it. The commands for player-missile graphics are much easier to use and faster than those in Atari Basic. One part I can't figure out is collision detection. The Advan Basic manual says the command T%=COLL(2%,16%) returns an integer whose value depends on whether or not player 2 has collided with other players. This sort of works for me, but I still stuck on getting it to work properly. What should the value of T% be if there is a collision? If I PEEK location 53260, which I think is the collision status of player 0, it returns 12. I want to do an IF statement where IF T% is the value of a collision, then do something. What number should I look for?

Link to comment
Share on other sites

There's bitsettings that would reflect what the GTIA collision registers return.

 

So player collisions are bit 3 for Player 3, bit 2 for Player 2 etc.

Of course a player can't collide with itself so it's associated value never gets set.

 

Generally you'd look for a nonzero value then take further action. Use an AND operation to filter the bits out further to see what other objects are involved.

Link to comment
Share on other sites

  • 2 weeks later...

Without trying Advan BASIC yet, I must say that whichever method you use to check for collisions, You must be sure that the screen frame was completely drawed, or the collision registers won't be modified. I usually clear the collision registers at the very beginning of a new frame, then wait for a complete redraw of the frame, probably using WAIT statement with a value of 0 or 1 as the argument, or by waiting for the value change of memory address 20 (RTCLOK).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...