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 / Sparks Sliding Collision

Author
Message
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th Dec 2010 01:04 Edited at: 15th Dec 2010 02:16
So i cant get what i should do to get sliding collision in sparkys. I need to see a code example that would show for example how to make one cube slide across the surface of a diagonally placed other cube xD Help is appreciated!!!!

Behold the new marble game coming soon: Marbsticle Course > > >http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0 coming January to February 2011
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th Dec 2010 01:39
Here is some code; it doesnt work, obviously.



Behold the new marble game coming soon: Marbsticle Course > > >http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0 coming January to February 2011
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Dec 2010 02:17 Edited at: 15th Dec 2010 02:20
y=sc_getcollisionslidex()
should be
y=sc_getcollisionslidey()

Your also setting up cube 1 and checking for collision against cube 1. But you're moving cube 1 so it won't do anything.

You need to set up cube 2 and check for collision against cube 2:


Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th Dec 2010 02:25
thanks cowbox but it doesnt cause the first block to move downwards when it hits the 2nd one, in other words it wouldnt slide.

Behold the new marble game coming soon: Marbsticle Course > > >http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0 coming January to February 2011
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th Dec 2010 02:31 Edited at: 15th Dec 2010 02:37
never mind, i just had to make some values float. thanks cowbox!




ok, so how would i get collision against a more complex non sphere object, like terrain?

Behold the new marble game coming soon: Marbsticle Course > > >http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0 coming January to February 2011
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Dec 2010 02:33 Edited at: 15th Dec 2010 02:34
K I messed up your code and made it tidier and stuff but there seems to be some kind of bug that stops it sliding all the way:

Probably best to ask Paul about it (seeing as he made the plugin xD)

EDIT:
Ah floats, that's it. xD

I knew something felt wrong when I was coding that. !

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th Dec 2010 02:43
yeh, float do the trick when you're sinking, lol! oh yah, how would i get collision against a terrain? i can imagine you wouldnt use sphereslide...

Behold the new marble game coming soon: Marbsticle Course > > >http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0 coming January to February 2011
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th Dec 2010 02:43 Edited at: 15th Dec 2010 02:44
dunno why it double posted

Behold the new marble game coming soon: Marbsticle Course > > >http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0 coming January to February 2011
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Dec 2010 03:21
Just set the terrain up to use complex collision. :S

I don't know how DBP terrains work but as long as it's a .x terrain it'll work the same as all the other .x files.

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th Dec 2010 03:23
yah, i figured as much xD

Behold the new marble game coming soon: Marbsticle Course > > >http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0 coming January to February 2011

Login to post a reply

Server time is: 2026-07-21 07:02:38
Your offset time is: 2026-07-21 07:02:38