Jump to content

Photo

boxcollision - easy software collision detection


2 replies to this topic

#1 RevEng OFFLINE  

RevEng

    River Patroller

  • 4,794 posts
  • Bitnik
  • Location:Canada

Posted Sat May 19, 2018 3:49 PM

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!

Attached Files



#2 jeffry OFFLINE  

jeffry

    Space Invader

  • 10 posts

Posted Sat May 26, 2018 11:22 PM

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



#3 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,794 posts
  • Bitnik
  • Location:Canada

Posted Sat May 26, 2018 11:49 PM

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




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users