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 / Bouncing Guns In DBC???

Author
Message
This one
20
Years of Service
User Offline
Joined: 7th Feb 2004
Location: Usa
Posted: 20th Feb 2004 04:22
Can this be done?????! Im having trouble making it bob up and down when i walked. I asked this Question about a week ago but didn't get a succesful answer. I need the code for DBC. there is an example however in my folder, but it doesn't clear state which part of it makes the gun bob and where xactly im supposed to set my camera for the view. If you can help at all then thanks! All the help i can get is much obliged! Thanks and have a great day!
This one.

"All creators of a game, have the true name"
Brandon Smith
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Urbana, Illinois (USA)
Posted: 20th Feb 2004 06:35
Well, pretty much anything you can thing of in a game can be done....somehow.

Why don't you try making a model of a gun, and then locking it to the screen.
Then create a variable that goes up or down as you walk forwards or backwords (and set it back to 0 after it gets too high).
Then you can make the gun move up and down (in relation to the variable) with a sin curve as you walk forward or backward. You can also make it move left and right as well as up or down with the sine curve.
If that's not clear, I'd be happy to help out more, just let me know.

Brandon
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 20th Feb 2004 07:07
dude, try the codebase. there's something for EXACLY what you want. well, it might be for dbpro, but maybe not...
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 20th Feb 2004 20:26
Do it with a sin curve.

This one
20
Years of Service
User Offline
Joined: 7th Feb 2004
Location: Usa
Posted: 20th Feb 2004 22:30
That particular code in the codebase is only for DBPro.

ok, ill go with the sin and cosine. And yes i need help Using the Sin and cosine for the gun bobbing up and down . any more suggestions before i give it a shot?

"All creators of a game, have the true name"
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 21st Feb 2004 00:42
yo uh i got a question...what is sin and cosine anyway...
This one
20
Years of Service
User Offline
Joined: 7th Feb 2004
Location: Usa
Posted: 21st Feb 2004 19:13
Its some kind of math. Anyway i need an exmaple on how to use that when building an FPS. Anyone know? ???/

"All creators of a game, have the true name"
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 21st Feb 2004 20:58
Sin is a function for working out lengths in triangles..... but it's graph looks like this:



It gives a nice bounce shape that changes direction smoothly.
Build it into your game like this:



Brandon Smith
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Urbana, Illinois (USA)
Posted: 21st Feb 2004 21:07 Edited at: 21st Feb 2004 21:18
Well "sine" (sorry) and cosine are functions that will take a line and it's angle and break it up into (usually) vertical and horizontal components (or pieces) if you're looking at that line on a piece of paper. It's really hard for me to explain withought being able to draw pictures though. But if you had a line of length 10 that was going at a 60 degree angle, you could instead say that that line was going at 10*cos(60)=5 units to the left and
10*sin(60)=8.66 units up. It just breaks a line up, that's all.

The reason I said that you should use a sine function is because the values it returns kind of produce a nice wave like looking effect if you have something follow it for each angle (in this case the value that increases or decreases as you walk forward or backward). I'm sorry if what I'm saying isn't making any sense.
I'll try and come up with an example later if I can get the time.

Best of luck on your project.
Brandon
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 21st Feb 2004 21:23
Echoooooo

This one
20
Years of Service
User Offline
Joined: 7th Feb 2004
Location: Usa
Posted: 22nd Feb 2004 05:36
OK! now i get it! Thanks, soo i just gotta use that 10*cos(60)=5 code to give it the wavy length feel. i think i know how to read angles pretty good cause i know some geometry hopefully all goes well. You can email me an example or a more indepth talk about Sin and cosine. Thanks, .

"All creators of a game, have the true name"
Brandon Smith
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Urbana, Illinois (USA)
Posted: 22nd Feb 2004 15:46
Sorry Chris, we just ended up posting explanations at the same time and I hadn't realized you were writing something as well. I wasn't trying to steal your credit

This one, if you can understand how sine and cosine work, then you are able to understand something that so many college students don't even understand that well. That's definitely great!, and you'll find that you're knowledge of geometry will help a lot all over the place in making video games.

Brandon
Brandon Smith
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Urbana, Illinois (USA)
Posted: 22nd Feb 2004 18:47
Well anyway, this is something like what I had in mind. I apologize that the code isn't commented, I just ran out of time, but if you have any quesiton I will be happy to answer them.

You can find the source code and media at this address
https://netfiles.uiuc.edu/bjsmith4/www/DarkBASIC/for_this_one.zip

If it doesn't compile then let me know and I'll upload a compiled version.

Good luck!
Brandon
This one
20
Years of Service
User Offline
Joined: 7th Feb 2004
Location: Usa
Posted: 22nd Feb 2004 21:50
ok thanks! that works really well and i can understand it more! but now is there a way to posistion the camera to give me a closer view? meaning like right on the back up the gun u see in first person shooters and not far outl ike the 3rd person?

"All creators of a game, have the true name"
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 28th Feb 2004 19:45
asuming you used lock object then just position the object a bit closer to the camera before you lock it.

http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.
Dark Serpent
20
Years of Service
User Offline
Joined: 24th Feb 2004
Location: U.S.A.
Posted: 24th Mar 2004 06:45
Wow Brandon Smith thats cool but how do ya just get it to bob a little just on the right side of the sreen like in any FPS? I mean the gun sways across the screen . If its noy too much trouble.

I'm such a
sponge008
20
Years of Service
User Offline
Joined: 8th Feb 2004
Location: MA, USA
Posted: 26th Mar 2004 00:52
Just make the movement values smaller.

Login to post a reply

Server time is: 2024-11-26 09:21:23
Your offset time is: 2024-11-26 09:21:23