你的代码没多少关联性嘛,既然你已经把运动坐标都存进数组,那你应该在时钟事件里循环读数组才能转起来,在就是数组维数只需要0-359,不需要-360-360,你在过程zubiao里也是从0-360存的,和你定义的数组维数矛盾。代码改如下可转起来。
Option Explicit
Dim Round As Integer
Const PI = 3.14159
Private Sub Command1_Click()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Picture1.Scale (-80, 80)-(80, -80)
Picture1.Circle (0, 0), 10, RGB(0, 0, 0)
Picture1.Circle (20, 0), 10, RGB(255, 0, 0)
Picture1.Line (0, 0)-(20, 0), RGB(0, 0, 0)
End Sub
Private Sub Timer1_Timer()
Dim x As Integer, y As Integer
Dim L1 As Integer
L1 = Val(Text1.Text)
x = L1 * Cos(Round * PI / 180)
y = L1 * Sin(Round * PI / 180)
Picture1.Cls
Picture1.Circle (0, 0), 10, RGB(0, 0, 0)
Picture1.Circle (x, y), 10, RGB(255, 0, 0)
Picture1.Line (0, 0)-(x, y), RGB(0, 0, 0)
Round = Round + 1
If Round = 360 Then Round = 0
End Sub
Option Explicit
Dim Round As Integer
Const PI = 3.14159
Private Sub Command1_Click()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Picture1.Scale (-80, 80)-(80, -80)
Picture1.Circle (0, 0), 10, RGB(0, 0, 0)
Picture1.Circle (20, 0), 10, RGB(255, 0, 0)
Picture1.Line (0, 0)-(20, 0), RGB(0, 0, 0)
End Sub
Private Sub Timer1_Timer()
Dim x As Integer, y As Integer
Dim L1 As Integer
L1 = Val(Text1.Text)
x = L1 * Cos(Round * PI / 180)
y = L1 * Sin(Round * PI / 180)
Picture1.Cls
Picture1.Circle (0, 0), 10, RGB(0, 0, 0)
Picture1.Circle (x, y), 10, RGB(255, 0, 0)
Picture1.Line (0, 0)-(x, y), RGB(0, 0, 0)
Round = Round + 1
If Round = 360 Then Round = 0
End Sub