
-----------------------------------
Murthtwo
Wed Dec 12, 2007 11:06 am

Projectile game help
-----------------------------------
Can somebody help me create a game were the user has to hit a randomly placed target and the user must be able to choose were they shoot from by clicking the mouse, as well as being able to choose how hard they want to shoot the ball . If the user clicks in a space they are not aloud to shoot from, it cant let them, and it has to keep track of their score.

If you have any tips or even the whole code, please help me  :D

-----------------------------------
HeavenAgain
Wed Dec 12, 2007 11:15 am

RE:Projectile game help
-----------------------------------
this is just physics, the easiest way to do this, is just let user enters the initial speed and angle,
slap me if im wrong but i think the equation is this
x2 = x1 + V*cos(theta)*t 
y2 = y1 + V*sin(theta)*t - (1/2)*g*t^2
and just draw the x and y of this dot or circle or w/e

and what if we have the whole code? :| we just give it to you? if only life was that easy..... hmm...

-----------------------------------
petree08
Wed Dec 12, 2007 1:13 pm

RE:Projectile game help
-----------------------------------
Wait, are you having a turret type game, if so you'll need to find angles between the turret and the mouse co-ordinates before you can implement the previously stated physics.  

this can be acomplished using turing's trig functions 
such as 
acrtand - tan inverse in degrees  
acrsind -sin inverse in degrees  
arccosd - cos inverse in degrees

theses commands also work in radians just drop the d at the end.  

look at the turing help for trig for a fuller explanAtion 
- happy coding

-----------------------------------
Murthtwo
Wed Dec 12, 2007 1:31 pm

Re: Projectile game help
-----------------------------------
Thank you soo much, at least now i can tackle this thing with some knowledge :

-----------------------------------
Murthtwo
Thu Dec 13, 2007 10:47 am

Re: Projectile game help
-----------------------------------
I need help with what I have so far, can anybody tell me how to fix when i shoot the ball; the target and the line disapear after you click and if you click above the line its supposed to say "->Please try againInvalid Position