Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Multiple collisions in Sparkys DLL

Author
Message
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 20th Apr 2010 04:30
Is there a way that I can check for individual collisions of objects that are all in the same group?

I have 4 objects that belong to Group 1 (obj# 20,21,22,23)
Is there a way that I can check if I hit object 20 and then object 21 later on?

Here is the code:


I am chechking to see if I collide with a group 1 obj so that it will get the collision and keep me from going into the object..
then, individually I want to make a sprite if I collide with that specific object
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 20th Apr 2010 04:34 Edited at: 20th Apr 2010 04:34
The help file says:

Quote: "
SC_sphereSlideGroup

SYNTAX
return integer=SC_sphereSlideGroup ( groupNum, oldx, oldy, oldz, x, y, z, radius, excludeObj )

-groupNum: the group you want to check for collision use 0 for all groups
-oldx...z: the start and end points of the sphere to check.
-radius: the radius of the sphere you want to cast.
-excludeObj: an object to exclude from the collision check.
returns: the object number collided with is returned
returns 0 if no collision occured.

"


So it should give you the object it collided with. In your case, QuestionCollide is the object you collided with, so just say:

If QuestionCollide=20
`blah blah blah
Endif

If QuestionCollide=21
`blah blah blah
Endif

etc.

<-- Spell based team dueling game!

Login to post a reply

Server time is: 2026-07-26 07:36:23
Your offset time is: 2026-07-26 07:36:23