disjaukifa Posted September 30, 2011 Share Posted September 30, 2011 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 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 30, 2011 Share Posted September 30, 2011 if somebody posts something really good here, I'll put it on the bB page. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 30, 2011 Author Share Posted September 30, 2011 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. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 30, 2011 Share Posted September 30, 2011 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+. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 30, 2011 Author Share Posted September 30, 2011 (edited) 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 September 30, 2011 by disjaukifa Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 30, 2011 Author Share Posted September 30, 2011 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. Quote Link to comment Share on other sites More sharing options...
Byte Knight Posted September 30, 2011 Share Posted September 30, 2011 Here's the way I did it with an earlier version of DPC+ that didn't have the collision detection between the virtual sprites. I don't think you the temp1-temp6 variables available in the multisprite kernel, so you may have to use other variables... 1 Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted October 3, 2011 Author Share Posted October 3, 2011 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. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted October 7, 2011 Share Posted October 7, 2011 (edited) 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 Edited October 7, 2011 by theloon Quote Link to comment Share on other sites More sharing options...
Mr SQL Posted October 12, 2011 Share Posted October 12, 2011 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). Quote Link to comment Share on other sites More sharing options...
8bitgnome Posted October 24, 2011 Share Posted October 24, 2011 Where can i learn to use multisprite kernals? Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted October 24, 2011 Author Share Posted October 24, 2011 Where can i learn to use multisprite kernals? Random Terrain's Bible to bB Programming! Here is the section to Multisprite Kernel. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.