Bill246 Posted March 12, 2019 Share Posted March 12, 2019 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? Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 13, 2019 Share Posted March 13, 2019 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. Quote Link to comment Share on other sites More sharing options...
vitoco Posted March 21, 2019 Share Posted March 21, 2019 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). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.