我到目前为止的这个程序可以工作,但是当它进入 for 循环时它会冻结。我用另一个程序做了类似的事情,但是它不喜欢它的形状。
GraphicsWindow.Height = 400
GraphicsWindow.Width = 600
GraphicsWindow.Title = "FairyTail"
GraphicsWindow.CanResize = "False"
animation()
Controls.ButtonClicked = action
Sub animation
GraphicsWindow.BrushColor = "Black"
Firstmove = Controls.AddButton("fireball", 300, 100)
Controls.Move(Firstmove, 0, 200)
endsub
Sub action
If Controls.GetButtonCaption(Firstmove) = "fireball" Then
GraphicsWindow.BrushColor = "Red"
fireball = Shapes.AddEllipse(20, 20)
Shapes.Move(fireball, 135, 115)
For i = 135 To 465
if i <> 465 then
Shapes.animate(fireball, i, 115, 1000)
i = i + 1
Program.Delay(100)
Else
Shapes.Remove(fireball)
endif
endfor
endif
endsub
我想要做的是在屏幕上移动火球然后将其移除。但我不知道如何在它动画后将其删除。