Jump to content
Random Terrain

DPC+ Collision Example Program

Recommended Posts

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?

  • Like 2

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

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?
 

Share this post


Link to post
Share on other sites
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.

  • Like 1

Share this post


Link to post
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.

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...