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.

Author
Message
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 2nd Feb 2003 22:14
Ok, I have this First Person Shooter code, that somebody posted in a previous topic for me, now, I need my character to jump & I have a few questions to get it done.

1. Is there a force command or something similar, so if the jump button is pressed, I could force the player up or whatever needs to be done to get it to work?

2. Does anybody have any ideas to how this should be accomplished & if there is another way to do it than using a force command, & give me a group of commands to search for in the help file, so I can learn how to make this on my own?

By the way, thanks for having one of the most friendly forums in the game engine universe, this is one reason I have switched over to DBPro, which I ordered last Friday.
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 3rd Feb 2003 00:08
You need to implement forces yourself. You can do this using the 'force = mass x acceleration' equation, using the acceleration to change the velocity of the object (stored in a variable) and using the velocity to change the position of the object. There might be another way using vectors, but I haven't played with them much.
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 3rd Feb 2003 01:14
Lol, I learned Mass x acceleration in school about a month ago! lol.

Weight = force x acceleration due to gravity
Mechanical advantage = effort force ÷ resistance force
Average speed = change in speed ÷ time
Average speed = initial speed - final speed ÷ time

I could also learn how to make people jump. It can be useful...

AlamDV, NHL, NHL 2K3....... The best combination ever!
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 3rd Feb 2003 05:22
well, I always used Sin value, it makes it smooth jumping.

Specs: Dual Amd Athlon 2Ghz(1Ghz x 2), 40GB 15000 Rpm SCSI Hard Drive, 640 Mb 266Mhz DDR, 12x8x32 CDRW, ATI Rage Fury Pro 32Mb SD Video, 17' Monitor
CarlTaylor
21
Years of Service
User Offline
Joined: 13th Jan 2003
Location: United States
Posted: 3rd Feb 2003 20:08
I would suggest that you make a variable to tell how far through the jump your char is, so when he is nearing the top of the jump he slows down, then stops, then goes down again.

baseball = life
OneTouch
21
Years of Service
User Offline
Joined: 23rd Jan 2003
Location:
Posted: 4th Feb 2003 08:26
This would be a nice snippet to get my hands on,
if anyone is willing to post snippets from a FPS, I sure would love to have them!

need more information on game development,
visit http://www.dtagames.com
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 4th Feb 2003 14:25
"well, I always used Sin value, it makes it smooth jumping."

"I would suggest that you make a variable to tell how far through the jump your char is, so when he is nearing the top of the jump he slows down, then stops, then goes down again."

These are not very good methods. You need to use physics.

e.g.
At Start:
gravity=-1

Every Loop:
inc y,velocity
inc velocity,gravity
if shiftkey() then velocity=15
position object 1,x,y,z

I hope this helps, I can write a full program if necessary
OneTouch
21
Years of Service
User Offline
Joined: 23rd Jan 2003
Location:
Posted: 8th Feb 2003 00:58
If Spacekey()=1 then YSPD#=3

inc PY#,YSPD#

`Change the following line to set the fall rate
Dec YSPD#,0.2

if PY#<Y#
PY#=Y#
if BOUNCE=1
YSPD#=0.00-(YSPD#/2)
`Dampen if less than .5, otherwise it'll bounce forever
if yspd#>0 and yspd#<0.5 then yspd#=0
else
YSPD#=0
endif

need more information on game development,
visit http://www.dtagames.com

Login to post a reply

Server time is: 2024-11-24 01:57:40
Your offset time is: 2024-11-24 01:57:40