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 / regular dark basic 1st person q's

Author
Message
Xender
18
Years of Service
User Offline
Joined: 28th Apr 2006
Location:
Posted: 29th Apr 2006 21:34
Hey, I am sort of new to DarkBasic, have been playing around with some stuff and what I have been able to get is something I think is pretty neat and I would like to build off of it. Right now I have a 1st person game and I just have a few questions. When coding my game i am only using a camera, so like when i move forward with the arrow key i just simply move the camera forward and so forth with the other keys, but is that a good way to go about it? For example i play on having collision code, would i be able to do that with the camera? or should i ahve like a cube that is where the camera is,(from what i see when u have a cube inside the camera you cant see the cube so should i use that way instead or would just the camera work for collision). And my other question is I want to be able to jump.. and i have found stuff for jumping, but thats using like a cube to jump, i need the camera to go up and down on the Y axis. So i will show u my movement code, and maybe you could help me with figuring out how to make it look like a smooth jump (maybe using gravity[which will be def. used late game with cliffs]) Thank you.

EDIT: somereason the code wont attach, so i will just show u what i am using , it is exactly from the tutorials from here: http://developer.thegamecreators.com/?f=t01/3d_tutorial_13
and from this one (strafing , other one is mouselook) http://developer.thegamecreators.com/?f=t01/3d_tutorial_14

thanks

This code is just the code from the tutorial on this site (thegamecreators.com) and is located in the main loop.

basically just how to jump and what the best way to figure out collisions are (for with the camera, or with a cube that is exactly where the camera is so u cant see it, and how to go about both, thanks so much
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Apr 2006 23:21
Best to use a cube like you said.

Xender
18
Years of Service
User Offline
Joined: 28th Apr 2006
Location:
Posted: 30th Apr 2006 01:43
ok just make a cube, then have the camera follow it so closely that they overlap so u cant even see the cube that ur following, and just since the camera will be following the cube, i could just have the cube jump (which i kno how to do) and just the camera will follow, aight thanks a bunch!
Xender
18
Years of Service
User Offline
Joined: 28th Apr 2006
Location:
Posted: 30th Apr 2006 02:39
hrm...... i have been trying to get my code to work but its not working. i cant seem to figure out how to make a cube and have it be right on the camera, so basically just like a normal camera when moving. umm so like the tutorials on this site for 1st person camera in the DB tutorials, hwo could i get it so instead of just moving the camera with the arrow keys, i can get it so i move a cube using the arrow keys, and then have the camera be right on the cube, so u wouldnt really even see the cube andw ould think it isnt even there, but it is and ur just right in it. any one kno how i would code that?

thanks
Coder#05
19
Years of Service
User Offline
Joined: 26th Oct 2005
Location: Denmark
Posted: 30th Apr 2006 04:23 Edited at: 30th Apr 2006 04:37
you could just hide the cube that you "follow", with the command hide object the_cube_your_camera_is_following,

as for moving the object,.
just use the move object commands, or look into newx/zvalue commands
and postion the camera at the objects position and rotateing it with the object.
some thing like:


you might wanna rotate the camera independent on the object.
that way you could also easy add collision to the object that you are following, just use the built in commands(if you never tryed collision before)

does that help you?

edit: after answering you, i noticed that this question, or at least a question very simular to this one was posted right below this one. its called camera help plz(or something). try looking at that, by the looks off it, it explains wath you are trying to do.

Still a noob. easy comes easy goes

Login to post a reply

Server time is: 2024-11-27 20:30:54
Your offset time is: 2024-11-27 20:30:54