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.

Newcomers DBPro Corner / Wall Collision (yes , yes...)

Author
Message
Keemo1000
19
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 6th Mar 2006 17:16
Hey TGC,

Ok, how do i add wall collision to my model ?

Ive got this 3d maze model, and its got walls, when the player collides with a wall, he should stop, and not slide against it like the good old C.S Condition Zero. Just stop, like in real life, you collide with a wall, and then u stop, you dont pass through it or anything, so how do I go about coding it ?



In DBP - 3D is easier than 2D , 2 player is easier than Single player , Dont you think life rocks .. ?
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 6th Mar 2006 18:22
So you're looking for just stopping and no sliding collision? Ok, that's simpler then



Do something like that every loop and the player will stop if the Intersect Object ray is hitting any polygons in the maze object (object 2)

FunkyStickmen: Battle of the Races (1%)
Keemo1000
19
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 6th Mar 2006 19:06
can u explain how it works ?



In DBP - 3D is easier than 2D , 2 player is easier than Single player , Dont you think life rocks .. ?
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 6th Mar 2006 19:21 Edited at: 6th Mar 2006 19:48
I've written a fully working example with collision... Not sliding, but it works



It will only compile in DarkBasic Pro. Control the player object with the arrowkeys, and try walking into the red cube and you'll see the collision. I haven't really used darkbasics inbuild collision commands, so I don't really know if the "automatic object collision" command is slow...

-The Nerd

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 6th Mar 2006 21:19
Keemo:

ImageAll's collision works by casting a ray (using the intersect object command) directly infront of the player. The ray is like an invisible line, and if it is touching the object it's ment to be checking for, it will return a value. The value is the distance to the intersection, but in this case it's not needed. It is just used to check if you have collided... though i would recommend sliding collision, just stopping is very annoying ¬_¬'

Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 7th Mar 2006 04:12
or instead of just stopping give the player a small negative (bounce back) amount...
Keemo1000
19
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 9th Mar 2006 15:05
2 The Nerd:

Thanks, your code was just what I needed, but it turns out its slow, but can I fix that by increasing the speed of the object?

Also, how can I use the intersect object command to stop and/or slide back (since some of us game making gamers think its too boring).

2 The Rest:

Thanks too, but another problem just popped up, ok, i textured this model of mine yellow (using a yellow bitmap), but its color in the game is really dull, when I try using light and change its color to yellow too, it only gets worse. Is there a way to solve this? Ive had this other game I was working on, and I textured my level in a modeller and showed perfectly well. What should I do now ?



In DBP - 3D is easier than 2D , 2 player is easier than Single player , Dont you think life rocks .. ?
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 9th Mar 2006 19:54
Im not a pro at texturing by any means so I may be wrong about this, but I THINK that if you're using a texture you've made on an object not UV mapped it appears dull in-game (Like I said im not sure but I remember this happening to me a few times).

If you just want it yellow, throw one of these in there after you've made the object:



... Unless that was what you were using in the first place, in which case pay no attention to me

Keemo1000
19
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 10th Mar 2006 20:31
Sorry, didn't help.



In DBP - 3D is easier than 2D , 2 player is easier than Single player , Dont you think life rocks .. ?
Keemo1000
19
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 27th Mar 2006 20:44
Ok I solved my lighting problem, any tips on working with the demo of NGC ?



In DBP - 3D is easier than 2D , 2 player is easier than Single player , Dont you think life rocks .. ?

Login to post a reply

Server time is: 2024-09-24 19:25:58
Your offset time is: 2024-09-24 19:25:58