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 / small bit of maths help please??

Author
Message
Matto
17
Years of Service
User Offline
Joined: 27th Aug 2002
Location:
Posted: 20th Sep 2002 15:58
I am looking to make a small game comprising of throwing hoops over a spike, you know the old game I mean surely.., I only want to make a simple version to start so decided a Power up bar for strength of throw and an angle statistic for the required angle of the hoop to be released at, say the hoop starts flat at this point and looks like it could be lying on the ground, so I raise the angle to about 45 degrees and power up the throw, how would I get the hoop to look aerodynamic in flight and have it's angle change as it flys off and gradually loosing speed dropping to the ground..

what would be a realistic way to manage the maths for the power and angle into flight, curve, distance and drop.

thanks
1ghz Cel,512 sdram 133,Gf2 MX 400 64,SBL 5.1,Win98
Best Upcoming MMOG - http://WWW.Atriarch.com
Project: Card Game with No Name
Nemesis
17
Years of Service
User Offline
Joined: 18th Sep 2002
Location: Australia
Posted: 25th Sep 2002 16:19
the movement over the ground would be constant unless you are factoring in wind resistance, in which case just slowly subtract from the vector. The height would be calculated according to the angle and power and use the newyvalue command to calculate this as one y value. This is then pulled back to the ground by adding the force of gravity (9.8m/s) to this addition height each second (divide by 60 for 60fps).

maybe something like this once you have the power and angle
(I haven't tried it but it should work)

rem ay# is vertical addition to height
rem only on x axis for movement for simplicity
rem angle# is the angle it is thrown at
rem power# is power
rem speed2# is x movement factoring in angle
ay# - newyvalue(0,angle#,power#)
speed2# = newxvalue(0,angle#,speed#)
do
ay# = ay# + (9.8 / 60)
y# = y# + ay#
x# = x# + speed2#
position object 1,x#,y#,0
sync
loop

I know everything! At least I don't know anything I don't know.

Login to post a reply

Server time is: 2020-01-23 02:33:39
Your offset time is: 2020-01-23 02:33:39