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 / Dark Basic FPS jumping

Author
Message
Flinchy
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location:
Posted: 5th Jul 2007 21:27
okay basically i am making a basic FPS, it is for an assignment.

i'm having troubles getting jumping to happen

i read through the FPS guide in other forum but the jumping is based on the camera being oriented to the object (as far as i can tell at least) (and possibly that i don't have dbPRO.



where object 2 is the gun

but mine is the other way around, the object is oriented to the camera

is there some way to have the camera move up with the object following it in a jumping fashion

sorry if i'm being unclear.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 6th Jul 2007 19:35
Do you mean you want the camera to go up first and then the gun follows: as if the gunman is swinging his arms to get more lift?

You could use curvevalue() for this, I always forget how the parameters work but it basically goes from a start number to a target number by increments. By default it gets slower and slower the closer you get to the target value, I think that would look like a jump .
hope I was of help.

PS I always write in lower case (maybe having IF ENDIF etc in caps), for me the capital letters just seem to merge together. I also notice you have no annotation, if this snippet is taken directly from the tutorial it would be a good exercise to see if you can add REM statements to explain what's going on, then you wont have to read through all the code again to work out what it does because you have your comments.

I make music and art. Here is a sample of my art: done in Paint! It's all I have
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Jul 2007 22:13
Quote: "but mine is the other way around, the object is oriented to the camera

is there some way to have the camera move up with the object following it in a jumping fashion"


If you say your relationship between the camera and the object is opposite of the tutorial, then try switching the reference to the object position with a reference to the camera position:

Where you have POSITION OBJECT etc, try POSITION CAMERA

Where you have OBJECT POSITION X(2) try CAMERA POSITION X() and the same for Y and Z.

Or are you trying what Obese87 was asking about?

Enjoy your day.
Flinchy
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location:
Posted: 8th Jul 2007 08:26
ha

this is incredibly basic, i haven't put a particularly large effort into this, it isn't so important at the moment

yes i do rem out my statements just for that lol

i'll think i'll try what Latch said

the gun object is positioned to the camera, therefore the camera has to move for the gun to follow.
Flinchy
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location:
Posted: 9th Jul 2007 09:35
well i just gave up, it wasn't necessary, and wouldn't work no matter what i did... JUMP_SPEED# went up and down as it should... the camera just didn't haha.

thanks for the help anyway.
Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 9th Jul 2007 21:06
i have a good jump code. you can probably edit it to fit your needs.
i just cant figure out the code snipped function of the post though

The problem with the gaming community is people think that the resolution of a game defines how good it is. I am not afraid to make a game where the main character is 50x50.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Jul 2007 00:05
@flinchy

The method I proposed should work. Though I think the values for jump_speed# may be a bit small. I added a matrix for reference, and changed the value of jump_speed#, and also swapped out OBJECT for CAMERA and it seems to work:



Enjoy your day.
nerd69
18
Years of Service
User Offline
Joined: 20th Jul 2007
Location: Rogers
Posted: 20th Jul 2007 10:28
ill try them iv got that same problem with game

Kevin Z.

Login to post a reply

Server time is: 2026-07-06 01:18:11
Your offset time is: 2026-07-06 01:18:11