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 / make a 3d wall that stops things

Author
Message
scuzz
16
Years of Service
User Offline
Joined: 27th Mar 2010
Location:
Posted: 9th Apr 2010 01:11
I know that you can use make object cube etc. etc. but i cant seem to figure out the code so that the wall will stop a user controlled cube when they touch eachother.
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 9th Apr 2010 01:30
For this you need to make collision check.Learn about it.There is Sparky`s plugin floating for free here if you need something advanced.It comes with nice examples, you can learn from.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
kuljot
17
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 9th Apr 2010 03:05
hey scuzz i am a little busy with homework right now. But by tommorow i will make a little program using sparkys showing you how to do that.So just keep checking.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
scuzz
16
Years of Service
User Offline
Joined: 27th Mar 2010
Location:
Posted: 9th Apr 2010 04:10
alright thanks kuljot. i dont have a clue what sparky's even is, but ill be waiting
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 9th Apr 2010 04:40
@ scuzz
I remember having your problem when I first moved to proper coding.

I'd been used to:

if cube1 collides with cube2 then stop cube1

As I learnt, there is no "stop" function in Dark BASIC Pro.

You've got to disallow it from moving.

A simple way to show this would be:

if cube1 is not colliding with cube2 then move cube1

This will cause cube1 to stop, in effect, when it hits cube2.

To put this into code for you would be something like this:


Now, as you'll notice if you run that - the cube will move inside cube 2 slightly when it hits it. - Sparky's collision DLL improves collision detection and thus improves results in these circumstances.

So all in all, you can do what you need without Sparky's DLL, but if you start making games you're going to need the DLL sooner or later once you realise Dark BASIC Pro's collision is somewhat limited.

kuljot
17
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 9th Apr 2010 07:51
Well first of all sparkys is a collision plugin for Dark basic pro.
i have attatched it, hopefull you know how to add it into your dark basic pro. Theres a few very good examples in there. The slidign collision oen will help you a lot.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
scuzz
16
Years of Service
User Offline
Joined: 27th Mar 2010
Location:
Posted: 9th Apr 2010 18:28
thanks cowbox, that works. And kuljot i dl'ed that but i dont have a DB Pro compiler or plugins folder

Login to post a reply

Server time is: 2026-07-26 15:31:48
Your offset time is: 2026-07-26 15:31:48