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 / Help with sparkys collision

Author
Message
BowserYo
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 23rd Dec 2010 23:08
Hello all, I am using sparkys DLL.



In that snippet, the radius of the sphere is 7. My player is not a sphere though, he is a human; so is there a way to vertically scale the collision sphere? or change it all together?

Jere are some of my other lines:




Thank you.
BowserYo

ßõw§€r¥¤
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Dec 2010 10:52
You can use 'box' collision but normally sphere is pretty good for players as their legs and arms tend to move about too. It's not always realistic but in most cases it's the best way.

Your setup code (the zero) is for 'per-polygon' collision at the moment:


Use a '1' for sphere collision and a '2' for box collision for your objects.

When you use 'sphereslide' checks to position your character you are using a sphere to check for collisions however, not the character object itself. In fact if you are using sphereslide to position your character you don't even need to 'setup' your character object unless you want to check for other objects colliding with it.

I hope that helps?

BowserYo
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 25th Dec 2010 21:13
Okay, so is there any way to create a "boxslide"? I was thinking of maybe stacking two on top of each other, but I'd only do that if it was the only way.

I just need a way to get sliding collisions, using something that I can make taller than it's width.

One note: When I took out the setup of my player the game crashed and said that the object (my player) wasn't set up as soon as it collided with the ground.

Thank you.

ßõw§€r¥¤
BowserYo
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 27th Dec 2010 17:07
I'm not stuck on Sparkys collision, is there another solution to my problem? I cannot seem to get past this.

ßõw§€r¥¤
Eminent
16
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 27th Dec 2010 18:43
I'm pretty sure there is only sphere sliding collision for sparkys. No polygon sliding collision or box.


BowserYo
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 27th Dec 2010 19:28
Okay...Is there another good collision system out there? I guess I could use Dark Basic's but I have heard it is slower?

ßõw§€r¥¤
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Jan 2011 10:33
Quote: "Okay, so is there any way to create a "boxslide"? I was thinking of maybe stacking two on top of each other, but I'd only do that if it was the only way."

That's how I've done it previously and it works really well, and quickly. Just do two sphereslide checks for your character.

Trust me Sparky's is way more accurate with many more commands than DBP native commands.

Login to post a reply

Server time is: 2026-07-18 02:08:40
Your offset time is: 2026-07-18 02:08:40