I am trying to create a simple game that uses a line as a cannon barell.
I want to use a horizontal slider to set the angle of the cannon.
Here is the starting position of the line.
Static xx As Integer
Static yy As Integer
xx = 0
yy = 200
line.x1 = 0
line.y1= 200
line.x2 = 50
line.y2= 200
The horizontal scroller starts at 0 and ends at 90.
Here is the code that I was trying.
conv = Val(hsbAngle.value) / 180 * 3.141592654 'convert radians to degrees
Line1.X2 = 50 * Cos(conv)
Line1.Y2 = -yy + (50 * Sin(conv))
I want to use a horizontal slider to set the angle of the cannon.
Here is the starting position of the line.
Static xx As Integer
Static yy As Integer
xx = 0
yy = 200
line.x1 = 0
line.y1= 200
line.x2 = 50
line.y2= 200
The horizontal scroller starts at 0 and ends at 90.
Here is the code that I was trying.
conv = Val(hsbAngle.value) / 180 * 3.141592654 'convert radians to degrees
Line1.X2 = 50 * Cos(conv)
Line1.Y2 = -yy + (50 * Sin(conv))