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 / anyone help? how can i get an object to accelarate

Author
Message
Jonny_S
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 17th Oct 2002 14:58
?????
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 17th Oct 2002 23:18
You my friend need to learn more about mathematics, especially non-linear algebra. You're looking for a function that's non co-linear. For instance:
1,2,3,4,5,6,7,8,9 are points on a linear line, the line is straight.
1,2,4,8,16,32,64 are points on a non co-linear line. The object has an accelerating velocity, from 1 to 2 to 4 to 8, it goes faster and faster. So if your movement variable is x (how far you go each move) it would be like
x=2x
so that first x = 1. Then x=2 then x=4 then x=8 and it speeds up. If that doesnt work, try x=3x or higher. Or if you want it to accelearate really fast do x=x^2. That means it will square the old value of x. So it'll get reall big, really fast.

If that doesnt work for you, you could use a two variable system. You have one variable, A, and another, B. This code will incriment B larger each time:

a=1
b=1
do
inc a,b
inc b,1
set cursor 0,0
print a
loop

so b gets bigger each loop and is added to A. Hope that helps, you crazy newbie you.
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 17th Oct 2002 23:21
sorry, add a cls before the command print a
Jonny_S
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 24th Oct 2002 15:10
maths no gud hehehe wot about making a 3D object jump! on a flat matrix

RED DEVIL PRODUCTIONS
dARKNER
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: Sweden
Posted: 24th Oct 2002 15:29
Maths again ..

Many dif' way's to do this ..
So I give you an easy way (Stupid and unreal'istic) lol .

Use Sin() Form Deg = 0 to 180 ...

As if:

JumpMaxHeight = 50 (How high ? )
PlayerHeight = PlayerCurrentHeight
(ex. get ground height(1,px,py))

For tJumpDeg = 0 to 180
NewPlayerHeight = PlayerHeight * Sin(tJumpDeg)
Next tJumpDeg

Since Sin(0) = 0, Sin(90) = 1 and Sin(180) = 0 you get a perfect up and down motion ..

Hmm .. but you dont wanna loop the above like it is ..
probably more like:



//dARKNER
dARKNER
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: Sweden
Posted: 24th Oct 2002 15:31
Whupps sorry .. An error found it's way into my coding..

NewPlayerHeight = PlayerHeight * Sin(tJumpDeg)

should ofcourse be

NewPlayerHeight = PlayerHeight + (JumpMaxHeight * Sin(tJumpDeg))

Sorry B't that ...
Jonny_S
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 24th Oct 2002 15:33
im actually not a newbie i've been using DB 7months i just never used a accelarate or jump command

RED DEVIL PRODUCTIONS
dARKNER
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: Sweden
Posted: 24th Oct 2002 15:39
Maths you learn in school not in a DB manual ..

But alas we are all here to help each other with what areas we know best .. Mine is Math, and i suspect "QuothTheRaven" aint bad at it either ...

So just keep up the work and let us se some demos, games, apps from you in the future....

Maybe one with something jumpin in an accalereted way.. lol ..

//dARKNER
dARKNER
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: Sweden
Posted: 24th Oct 2002 16:37
A little prog of the above Jump function ...



//dARKNER
Jonny_S
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 27th Oct 2002 13:37
Thanx all this will help with my game loads

cheers
Jonny

monkey by day, crime fighting sex god by night
TGWDNGHN
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 27th Oct 2002 16:48
:*(
Cosine,Sine,Tangent...
WAAAAAAAA!
I know some forum members (not all of them use this one, they sue the old one) that don't even know what they are...There are even a few of my friends (who use the forum) who arn't even in high school! can you do something simpler such as using the the object's y position...I used it for my airplane example and its easy to use
Shock
AGK Developer
22
Years of Service
User Offline
Joined: 24th Oct 2002
Location: United Kingdom
Posted: 27th Oct 2002 20:15
ive just been using this for a car game, you can use it in your games, took me 15mins to make very easy to figure out...



www.shockforge.com ShockForge Software
www.havochost.com Unlim bandwdith, unlim space, you.havochost.com, you.s8i.com, visit site for more details.
...::::ShockForge::::...

Login to post a reply

Server time is: 2024-11-23 17:48:34
Your offset time is: 2024-11-23 17:48:34