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 Professional Discussion / gravity help needed

Author
Message
AndyUK
23
Years of Service
User Offline
Joined: 2nd Apr 2003
Location: United Kingdom
Posted: 20th Sep 2003 01:41
Hi, after the latest patch i thought id have a go at bsp stuff..
Every single counterstrike map ive tried so far has displayed perfectly.. . The code below is a basic mouse/arrow keys job.. its all messy.. but can anyone help with gravity?? i added a move object down command in the loop but it seems slow going up hills or stairs.

| AMD Athlon XP 2000+ | 512DDR(400) | GF4MX400 64MB | Win2k Sp4 | Cup of Coffee |
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 20th Sep 2003 20:30
look at the tutorial of the FPS game that comes with dbp manual. It's simple gravity but it works - just a line in your loop that is trying to decrement you slightly on the Y axis each pass, the bsp floor/collision will prevent you from falling thru solid geometry but you will fall in empty space.

-RUST-
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 22nd Sep 2003 21:08
In many proper mathematic model based "worlds" gravity is often represented by a downward vector which pulls all objects down a certain distance each "turn".

Hope this is helpful.

Philip

What do you mean, bears aren't supposed to wear hats and a tie?
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Sep 2003 21:47
if jump=1 then objectY# = objectY# + grav_amount#
grav_amount# = grav_amount# - 0.1

If character lands on something then jump=0
TKF15H
23
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 23rd Sep 2003 02:15 Edited at: 23rd Sep 2003 02:20
I've always done this diferently (probably 'cause I only work with matrixes).
Every object I want to be affected by gravity is represented in an IMPLUSE array.
for object number=first to last
If the object is too high above ground, increase value in array and move object down using value in IMPULSE as speed. If object is touching floor, IMPULSE value=0. If jump=1 then IMPULSE value =-20.
next object number

hehe DarkEnglish...

I need an animator!!! HELP ME!!

Login to post a reply

Server time is: 2026-07-25 07:00:24
Your offset time is: 2026-07-25 07:00:24