Jump to content
IGNORED

What is the best method for collision with Multisprite Kernel (Not DPC+)


disjaukifa

Recommended Posts

Hey Guys,

 

Just as the title says, I'm trying to figure out the best way to do collision detection with the Multisprite Kernel. I've read Random's page on Multisprites several times tonight, and I just need some clarification/insights on the best way to do it. I'm trying to see if player1 has collided with players 2 ~ 5. I've got player0 collision down.

 

Thanks

Link to comment
Share on other sites

if somebody posts something really good here, I'll put it on the bB page.

 

I have to admit Random, I'm really glad you said that and didn't just reference to something that was already on your site because I have been reading it all night.

Yeah, I don't know much about the Multisprite Kernel. It was too limited and weird, so I mostly avoided it. I was hoping that something like the DPC+ stuff would come along. Once batari gets the DPC+ stuff fixed, I probably won't use anything else. Every game will be DPC+.

Link to comment
Share on other sites

if somebody posts something really good here, I'll put it on the bB page.

 

I have to admit Random, I'm really glad you said that and didn't just reference to something that was already on your site because I have been reading it all night.

Yeah, I don't know much about the Multisprite Kernel. It was too limited and weird, so I mostly avoided it. I was hoping that something like the DPC+ stuff would come along. Once batari gets the DPC+ stuff fixed, I probably won't use anything else. Every game will be DPC+.

 

That does make sense, and the DPC+ kernel is fantastic even in its current state of development, there is a certain amount fun and challenge to making a game that will fit into 2~4K. I wanted to see if I could do this. If I can get the collision figured out, I think I can do it. I'm going to have flicker problems which are just inherent with the multi-sprite kernel, but I'm doing this for the challenge and fun of it.

Edited by disjaukifa
Link to comment
Share on other sites

I had a thought this morning when I woke up. When you are geting the x, y coordinates of a sprite, where exactly is it located? I'm thinking of manual building an array that has the dimensions of each of my sprites and makes my own collision routine to see if they have collide.

 

I've got a way to do it now, its just not that forgiving, they have to have the EXACT same coordinates which is kind of annoying.

 

if player1x = player2x && player1y = player2y then  . . .

 

For what I'm doing the Y is actually not the issue, I'm fine with y being set to what it is, what I'd like to adjust is the x values. I rather not put a bunch of if statements in there but I will if that is the only way to do it.

Link to comment
Share on other sites

Thats Byte Knight! I took your example and modified it a bit to suit my needs. It actually works quite well however the more complex the sprite the more difficult the collision defection. I'll post later tonight my solution which is based on yours if anybody here can use it in the future.

Link to comment
Share on other sites

This question seems to be answered but here is a generic soft collision example modified from another BASIC dialect:

 

	function softcol
if x1 > x4 then return 0
if x2 < x3 then return 0
if y1 > y4 then return 0
if y2 < y3 then return 0
return 1
end

 

I realize this could be optimized and I haven't explained anything about the code. Sorry :P

Edited by theloon
Link to comment
Share on other sites

The soft collision dection routine from CityScape works similarly:

 

rem piggyback: seed d with a non zero value if opponent gets hit (frozen delay)

rem h is the playfield x

b=(player1x-10)/4:if b=h && d=0 then d=25

b=b+1:if b=h && d=0 then d=45

b=b-2:if b=h && d=0 then d=35

 

Description:

 

In the routine I'm using playfield pixels as missile sprites and need to detect collision with a hardware sprite but other playfield pixels exist so I couldn't use hardware collision; I'm also translating between playfield pixels and real pixels (/4) and use a range so that an exact hit is not required (it can be just behind or just in front).

Link to comment
Share on other sites

  • 2 weeks later...

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