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 / 1st person games (jumping etc.)

Author
Message
Xender
19
Years of Service
User Offline
Joined: 28th Apr 2006
Location:
Posted: 29th Apr 2006 04:30
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.

This code is just the code from the tutorial on this site (thegamecreators.com) and is located in the main loop.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Apr 2006 16:06 Edited at: 30th Apr 2006 16:06
Quote: "from what i see when u have a cube inside the camera you cant see the cube"


Actually it's the other way around - when the camera is inside a cube, you can't see it unless you use Set Object and change the default Cull setting.

So yes - that would be one way to do 'camera collision'. Just position the cube at the camera's X,Y,Z position before each Sync in the main loop.

Any code you find for making an object jump, you should be able to apply to the camera just by replacing 'Object X' with 'Camera'.

http://forum.thegamecreators.com/?m=forum_view&t=77662&b=7

http://forum.thegamecreators.com/?m=forum_view&t=77186&b=10

TDK_Man

Login to post a reply

Server time is: 2025-05-23 15:07:11
Your offset time is: 2025-05-23 15:07:11