jeffry Posted May 17, 2018 Share Posted May 17, 2018 (edited) I am trying to code my own colision detection. Everytime I think i have it ... I don't. I am hoping someone get help me get back on track. Suppose my player0 sprtie is a 8x8 square. If I set player0x = 50 & player0y = 50 which pixel of my sprite will be at coordinates 50,50? 123454678 a ######## b ######## c ######## d ######## e ######## f ######## g ######## h ######## Is a1? h1? a8? h8? Something else? Also how does using the REFP0 affect this? My code seems to me that everything looks correct yet it doesnt quite work. I believe if I can get a clear answer on which pixel is at the defined coordinate I can figure this out. Thanks for any help to set me straight. Edited May 17, 2018 by jeffry Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted May 17, 2018 Share Posted May 17, 2018 Have you played with any of the example programs below? You can move sprites around and see the coordinates in the score: Find Border Coordinates 9 Objects with Coordinates 13 Objects With Coordinates and Collision (DPC+) It can help you figure out exactly where things are. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted May 17, 2018 Share Posted May 17, 2018 (edited) H1. Reflecting the sprite won't affect the positioning of the sprite. Edited May 17, 2018 by kdgarris Quote Link to comment Share on other sites More sharing options...
jeffry Posted May 17, 2018 Author Share Posted May 17, 2018 @Random Terrain Thanks I had seen that program before in fact i modified it to measure and plot playfields. I just never thought about utilizing it in this context .. brainfart I guess... Thanks! P.S. I assume by your name you are the one with the similiarly named website.... SO THANK YOU again. you have given me unmeasurable guidence and help via that site. @kdgarris... Thanks.. I was hopping that not accounting for the REF was part of my problem but alas I screwed up elsewhere Thanks to Both of you!!!! 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted May 20, 2018 Share Posted May 20, 2018 The answer to your original question actually varies on the kernel used. The standard kernel uses your "h1" as the base. DPC+ uses your "a1". The multisprite kernel regular player uses "h1", and the virtual players are a bit offset from there. The wrinkle to all of these is if you use NUSIZ#=5 or NUSIZ#=7 to modify the player size, it's pushed one pixel to the right. I've put together a boxcollision routine for bB along with some samples, which you may be interested in. 1 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.