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 Discussion / Camera Collision

Author
Message
Dr Manette
20
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 29th Apr 2006 07:28 Edited at: 3rd May 2006 00:11
I am making a game in which you have to find your way through a maze. The only problem I have is setting collision for the objects so that you can't go through the walls. It is in first person so I need to make an object that follows the camera and detects collision with another object. So far, everytime I try making code for this, it doesn't work. If anyone could write code that does this, it would be helpful. Or, if someone posts steps on how to, I could figure it out. Please be detailed and not just say "you have to set global collision and detect the object." Thanks.

Bio Fox...four guys, one computer, games like nobody's business.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Apr 2006 14:25 Edited at: 29th Apr 2006 14:26
I don't think that you can make an object follow the camera, but you can make the camera follow an object. So you position the object, perhaps a cube, and then position the camera to that object. You can then add collision to the object. Then instead of moving the camera, you move the object, and keep positioning the camera there. There is a box collision example in the help files.

General Sephiro
21
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 30th Apr 2006 06:55 Edited at: 30th Apr 2006 06:56
yes, you CAN make an object follow the camera, simply write your own code to do it. IT IS EASY~!!!!$!@%$!@$!@$!@$!@!!!!!!!!!!!!!!!!!!


The more Further away the object is move it forward faster, always set the object to face the camera. If you want the object to rotate around a different way then u can set it back to w/e way you want it AFTER it has moved....

Dr Manette
20
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 30th Apr 2006 21:10 Edited at: 3rd May 2006 00:12
Thanks, I'll try Pincho's idea of moving the object.

-----Edit-----
Actually, I'm having a lot of trouble with this consept. If it's really so easy, could someone please show me how to make the code??? I have a real problem actually moving the camera and object together. The current movement has forward moving the camera with "move camera 4.0" and back "move camera -4.0". Turning uses the mouse like this:
cy#=wrapvalue(cy#+mousemovex())
cz#=wrapvalue(cz#+mousemovez())
rotate camera cx#,cy#,cz#

I want to keep this is kind of movement for both the object and the camera. If anyone can show me some code, that would be great. So far, I haven't found any instructions on how to do this.

Bio Fox...four guys, one computer, games like nobody's business.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 1st May 2006 06:26 Edited at: 1st May 2006 06:30
Click on the link to my website at the bottom of this post and select 'Code Hints' from the menu.

Across the bottom you will then see shortcuts to a number of camera control snippets with explanations of how they work. In particular, take a look at the section on 'Set Camera To Follow'.

TDK_Man

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st May 2006 12:49
You can also look in the DB Classic examples for Free Flight.

Dr Manette
20
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 1st May 2006 22:23 Edited at: 3rd May 2006 00:12
Thanks everyone, this has really helped. I've got everything under control now.

Bio Fox...four guys, one computer, games like nobody's business.
jermaine
20
Years of Service
User Offline
Joined: 3rd May 2006
Location: Baltimore, Maryland
Posted: 3rd May 2006 22:53
Hello I just bought Dark Basic the $49 version.
I just need input on what kind of engine it is.
Can it make FPS, Third person shooters?

I moving from truevision3d and gamemaker 6.1

so this is the first program i ever bought.
also how long does it take to process my order?
I did the electronic order.

HI
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 19th Aug 2006 16:03
It makes pretty much anything! It took mine 2 weeks and i'm in West Virginia.

Lucifer
20
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 19th Aug 2006 16:38 Edited at: 19th Aug 2006 16:40
Quote: "I just need input on what kind of engine it is."


well, you can program anything from stupid text games to mario games to fps games, there are lots of posibilities in there. just dont get stuck in a dream of making a hl2 like some people seem to do. And there are tutorials on the tgc homepage, you should go through them when you get dbc.

Quote: "also how long does it take to process my order?
I did the electronic order."


if it's the electronic order i think it's 24 buisness hours. My Order of the cartography shop and the dbc enhancements didnt take so long to arrive..

Tíhí..
DB newbie
20
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 20th Aug 2006 22:35
ok this is wat you do to write your own code to place an object behind the camera.... i did it for my fps

you can lock the object to the screen the place it behind the camera by changing the cordinates.

<img src="http://www.boomspeed.com/egraphics/75as4.gif" border="0" title="Adopt_one_today_from_pickle-green.com/egraphics!">

Login to post a reply

Server time is: 2026-07-08 05:38:50
Your offset time is: 2026-07-08 05:38:50