Hi,
I'm trying to make a game like "Gorilla". Don't know if you've ever played it, but you're two players (two gorillas) and you are standing ontop of tall buildings. You are then supposed to throw bananas on each other. You enter the speed and angle of the banana to make it go over the buildings and hit the other gorilla. And there is also wind blowing in different directions all the time that you have to take in count when you decide what angle and speed you're going to use.
I know how to calculate the path of the banana if you don't care about wind. But I have no idea what to do when there is wind blowing. Can anyone help, please?
Currently I have this code (just to see if it'll work)VB Code:
Private Sub cmdDraw_Click() Const pi As Double = 3.14159265358979 Const g As Double = 9.82 Dim v As Double Dim a As Double Dim x As Double Dim y As Double If edtV.Text = "" Or edtA.Text = "" Then MsgBox "Nu glömde du igen..." Exit Sub End If Me.Cls v = edtV a = edtA Me.Line (0, 200)-(600, 200) CurrentX = 0 CurrentY = 200 x = 0 Do y = Tan(a * (pi / 180)) * x - g / (2 * v * v * Cos(a * (pi / 180)) * Cos(a * (pi / 180))) * x * x Me.Line -(x * 5, -(y * 5) + 200) x = x + 1 Loop Until Tan(a * (pi / 180)) * x - g / (2 * v * v * Cos(a * (pi / 180)) * Cos(a * (pi / 180))) * x * x < -1 End Sub




Reply With Quote