Jump to content
IGNORED

DPC+ virtual collision detection


jbs30000

Recommended Posts

Apologies if I'm typing something you guys already know. I did lots of searching on virtual sprite collision detection and didn't find much so I did my own experiment.

 

I placed sprites 0 and 3 on the screen and then programmed the joystick to move sprite 0. I put, if collision(player0, player3) then reboot and every time they touched the program rebooted.

 

I changed all references from sprite 0 to sprite 5 and it still worked. This is awesome.

Link to comment
Share on other sites

  • 2 weeks later...

I just discovered something else. If you check for a collision between player0 and players 2-9 you'll get an accurate reading. If you check for a collision between player0 and player1, then any collision between player0 and players 1-9 will cause a collision and you'll have to narrow it down by doing other collision checks between player0 and players 2-9. Or check for other collisions first and place (player0, player1) last.

  • Like 1
Link to comment
Share on other sites

I just discovered something else. If you check for a collision between player0 and players 2-9 you'll get an accurate reading. If you check for a collision between player0 and player1, then any collision between player0 and players 1-9 will cause a collision and you'll have to narrow it down by doing other collision checks between player0 and players 2-9. Or check for other collisions first and place (player0, player1) last.

 

Thanks for the info.

Link to comment
Share on other sites

My final post about this. Disregard what I've been saying. I've done lots of tests and it doesn't work as simply as I thought. Depending on where the collision occurs, sometimes a collision between player0 and player2 registers as a collision between player0 and player2, other times it registers as a collision between player0 and player1.

 

I guess for now checking the x and y positions of sprites to see if there's any overlap is the way to go. At lease for bB version 1.1d.

Link to comment
Share on other sites

  • 1 year later...

could RT or jbs give an example of checking x and y positions to differentiate between collisions? it must be simple, as all references I've found to this are without examples, but if one of you guys (or anyone else) could spell it out for me, that'd be fantastic. i'm using multisprite, and before i recode my game to utilize DPC i'd like to see if i can get checking x/y's to work.

 

also, my apologies for necropost.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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