+Random Terrain #1 Posted April 4, 2015 Like I promised before my Windows 7 computer died, I adapted an existing example program and made this: ex_dpc_collision_2015y_04m_13d_0434t.bin ex_dpc_collision_2015y_04m_13d_0434t.bas It's a collision toy to help us learn more about DPC+ collisions. Update: This program is now on the batari Basic page: randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_dpc_collision And the DPC+ collision detection section has been updated: randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_collision_detection How It Works: When you move the player0 sprite over the other sprites, a playfield pixel is turned on next to the starting position of the touched sprite. When a sprite touches the green column on the screen, a playfield pixel is turned on across from the starting position of the sprite on the other side of the column. Question: Is there anything I need to add to this program or change before putting it on the bB page? 2 Quote Share this post Link to post Share on other sites
Mountain King #2 Posted April 4, 2015 Thanks Random. I've been playing around with this example this morning. Just so I understand how this program works. When player0 collides with one of the virtual sprites, it compares their Y values and turns on a playfield pixel in front of the collided sprite? This seems to works well if all the virtual sprites stay in their initial position, but i seem to get multiple collisions when I move the virtual sprite out of it's "parking place". I imagine if a routine was written to do the same with the x position individual collisions could be identified anywhere on the screen. Quote Share this post Link to post Share on other sites
+Random Terrain #3 Posted April 4, 2015 Thanks Random. I've been playing around with this example this morning. Just so I understand how this program works. When player0 collides with one of the virtual sprites, it compares their Y values and turns on a playfield pixel in front of the collided sprite? This seems to works well if all the virtual sprites stay in their initial position, but i seem to get multiple collisions when I move the virtual sprite out of it's "parking place". I imagine if a routine was written to do the same with the x position individual collisions could be identified anywhere on the screen. Right, that's how it works at this time. I can try adding the x positions next and see how that goes. Quote Share this post Link to post Share on other sites
+Random Terrain #4 Posted April 5, 2015 The first post has been updated with the latest version of the program. Please let me know if I messed up anything or if there is a better way to do it or if there are other things that need to be added to the program. Thanks. Quote Share this post Link to post Share on other sites
Mountain King #5 Posted April 5, 2015 This is awesome! I've been struggling for so long with DPC collisions. This is a big help. I only noticed multiple collisions with the playfield. Everything else seems to work fine. Quote Share this post Link to post Share on other sites
+Random Terrain #6 Posted April 5, 2015 This is awesome! I've been struggling for so long with DPC collisions. This is a big help. I only noticed multiple collisions with the playfield. Everything else seems to work fine. Thanks for testing it. I'll check the playfield collision subsection tonight and see if I can make it work better. Quote Share this post Link to post Share on other sites
Mountain King #7 Posted April 5, 2015 I just implemented your routine into my game. Works great. Thanks again. 1 Quote Share this post Link to post Share on other sites
+Random Terrain #8 Posted April 8, 2015 Thanks for testing it. I'll check the playfield collision subsection tonight and see if I can make it work better. I just implemented your routine into my game. Works great. Thanks again. I made some changes to the program. You might want to take a look and see if the code you wanted to use has changed. For sprite 1 through 9, it looks like the one that touches a playfield pixel higher on the screen gets its y-coordinate placed in temp4. Other sprites touching a playfield pixel lower on the screen don't register as long as the sprite is still touching the higher playfield pixel. In other words, it seems like the sprite with the highest playfield pixel collision is the only one that gets reported. Quote Share this post Link to post Share on other sites
Mountain King #9 Posted April 8, 2015 For my game I was concerned about missile and player 1-9 collisions. So a modified version of your code worked great. I had to modify my sound and scoring routine a bit to work with yours. But it's fine now. Thanks for all the work you have done. 1 Quote Share this post Link to post Share on other sites
Mountain King #10 Posted April 8, 2015 (edited) Sorry double post Edited April 8, 2015 by Mountain King Quote Share this post Link to post Share on other sites
+Random Terrain #11 Posted April 16, 2015 I was dragging my feet since I knew it would be hard to do, but I finally updated the DPC+ collision detection section: randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_collision_detection 2 Quote Share this post Link to post Share on other sites
freshbrood #12 Posted June 28, 2020 Hello RT, everyone again. I am just now starting to get into the DPC+. About collision, is this mainly only good for, say, P5 vs. playfield? Is there collision for say, P5 vs. P6 now? Quote Share this post Link to post Share on other sites
+Random Terrain #13 Posted June 28, 2020 6 minutes ago, freshbrood said: Hello RT, everyone again. I am just now starting to get into the DPC+. About collision, is this mainly only good for, say, P5 vs. playfield? Is there collision for say, P5 vs. P6 now? Prior to the bB 1.1d release, we couldn't use collision() to detect collisions between the virtual sprites, but now we can. 1 Quote Share this post Link to post Share on other sites