Jump to content
RevEng

boxcollision - easy software collision detection

Recommended Posts

I've noticed a few people struggling with software collision detection in the past, so I went ahead and backported the boxcollision routine from 7800basic, to a bB function. It can be used to detect collisions between different height and width sprites.

 

Included are simple examples for the standard, multisprite, and DPC+ kernels.

 

Box collisions are a bit expensive, so don't try to do a bunch in one frame, or you'll run out of cycles. And if one of your objects is one pixel wide and tall, it would likely be quicker to use a simple if...then, instead of this routine.

 

As always, enjoy!

boxcollision.zip

sample_std_wideplayer.bas.bin

  • Like 8

Share this post


Link to post
Share on other sites

Hello,

 

I wanted to say thanks for this. About a week ago you replied to my question in another thread with a link to this post.

I found this extremely beneficial. This helped me with a better solution than I had created for my collision struggle,

In adition it helped me gain a little insight into creating my own asm file.

 

Thanks!!!!

Share this post


Link to post
Share on other sites

I'm glad that it helped you out, and that you learned something along the way. You're welcome!

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