Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Parabola bullet thing
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
RaLz




PostPosted: Mon May 26, 2003 3:56 pm   Post subject: Parabola bullet thing

ok im making that one tank game where there are two tanks on bothsides and you shoot a bullet and it has to make an arch shape to get to the other side and hit the other tank.
Now i know im supposed to use a parabola for the bullet but i am bad at math and i don't know where to start so if someone could please do the bullet process for me or help me out that would be great. It needs to include how much power the shot is going to have and altitude.
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Mon May 26, 2003 4:14 pm   Post subject: (No subject)

Projectile_Posx := Projectile_Velocity * cosd (Angle) * Projectile_Time
Projectile_Posy := (-1 / 2) * Gravity * Projectile_Time ** 2 + Projectile_Velocity * sind (Angle) * Projectile_Time

it's the coordinates for the projectile, put it in a loop, increase the time variable each loop, and u should have it. I also have the equation that involves air-resistance, if you want it, i'll post it up.
RaLz




PostPosted: Mon May 26, 2003 6:53 pm   Post subject: (No subject)

yea that would be cool if you could
RaLz




PostPosted: Mon May 26, 2003 6:56 pm   Post subject: (No subject)

also it would be cool if you could explain that code to me cuz i don't get any of it
void




PostPosted: Mon May 26, 2003 8:43 pm   Post subject: (No subject)

basic projectile physics:
x= v*cos*theta*t
y=v*sin*theta-g*t^2/2

v=velocity
cos and sin are constants (use sind and cosd when ur doing it in turing)
t= time
g= gravity (i think its 9.8 or 9.3 m/ s^2)
theta= angle at which the projectile is shot
x= x-co ordinate
y= y- co ordinate
but yea....if you dont understand that...you should go ask your math teacher...they'll prolly help you better AND they will think ur a smart kid and boost your mark a good 3-4 % Very Happy any more help..just ask
RaLz




PostPosted: Mon May 26, 2003 8:46 pm   Post subject: (No subject)

thanx douchie
void




PostPosted: Mon May 26, 2003 8:51 pm   Post subject: (No subject)

yo!!.. who da blu...wiyado...who is this kid!!! and how does he know who i am...(only people i know can mess up my name like that and get away with it!!) lol..yea..who is this?
Homer_simpson




PostPosted: Mon May 26, 2003 8:52 pm   Post subject: (No subject)

oh that's some cool formula Very Happy 8)
good to know...=)
RaLz




PostPosted: Mon May 26, 2003 8:53 pm   Post subject: (No subject)

Ok i don't get what the projectile time has to do with it
RaLz




PostPosted: Mon May 26, 2003 8:55 pm   Post subject: (No subject)

its Raheel
void




PostPosted: Mon May 26, 2003 8:56 pm   Post subject: (No subject)

how long it takes to get from the initial launching point to reach the landing point....just make time a constant...its better that way/......WHO ARE YOU?!?!?!?!?....TELL ME...BEFORE I KILLL YOU (that was not a threat)
Homer_simpson




PostPosted: Mon May 26, 2003 9:02 pm   Post subject: (No subject)

ok... i tried using it in turing... one problem...
how do u multiply sine or cos in the formula?
void




PostPosted: Mon May 26, 2003 9:15 pm   Post subject: (No subject)

code:

var x, y, th : real
const v := 9
const t := 1
const g := 9.8
th := 12
x := v * cosd (th) * t
y := v * sind (th) * t - g * t ** 2 / 2

now the only problem is making x and y back into integers so i can locate with themm.....
AsianSensation




PostPosted: Mon May 26, 2003 9:23 pm   Post subject: (No subject)

x := cosd(angle) + (mass * velocity * cosd(angle) / air resistance) * (1 - e**(-air resistance * time / mass))

y := sind(angle) - (mass * gravity * time / air resistance)+((mass * velocity * sind(angle) / air resistance) + (mass**2 * gravity / (air resistance**2))) * (1 - e**(-air resistance * time / mass))

http://www.phy.davidson.edu/StuHome/jocampbell/projectile/projectile.htm

I think that web site give u the equation and maybe some explaination for it.
RaLz




PostPosted: Mon May 26, 2003 9:35 pm   Post subject: (No subject)

Yeahhhh this game has gotten wayy to complicated for me since iam onlin gr 10 and ihaven't learnt that much physics i will prolly not be able to do this. So any other suggestions cuz i thought this game wouldn't be this hard
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 27 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: