精易论坛

标题: VB 球体运动动画【新手教学】 [打印本页]

作者: 3721    时间: 2011-5-13 13:31
标题: VB 球体运动动画【新手教学】
                学习交流,老鸟勿喷。如有疏漏,多多指教。
Dim stepx%, rr%, lr$, xx1%, yy1% Private Sub Form_Load()
    stepx = 50: rr = 100
    Me.FillStyle = 0
    Me.FillColor = QBColor(12)
    Me.AutoRedraw = True
    Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
    Line1.x1 = 100: Line1.y1 = 100: Line1.X2 = 100: Line1.Y2 = 1000
    Line2.x1 = Me.Width - 200: Line2.y1 = 100: Line2.X2 = Me.Width - 200: Line2.Y2 = 1000
    xx1 = Line1.x1 + rr
    yy1 = (Line1.Y2 - Line1.y1) \ 2
    Timer1.Interval = 50
    lr = "R"
End SubPrivate Sub Timer1_Timer()
    xx1 = IIf(lr = "R", xx1 + stepx, xx1 - stepx)
    lr = IIf(xx1 >= Line2.x1 - rr, "L", lr)
    lr = IIf(xx1 <= Line1.x1 + rr, "R", lr)
    Me.Cls
    Me.CurrentX = xx1: Me.CurrentY = yy1
    Me.Circle (xx1, yy1), rr
End Sub


作者: konger    时间: 2011-5-18 02:23
这也沙发?!!
作者: 无与林比    时间: 2011-10-14 13:04
来看看,学习下
作者: ghoob    时间: 2016-1-13 15:15
VB 球体运动动画  不能动
作者: 914417177    时间: 2016-9-23 12:01
圆周运动啊




欢迎光临 精易论坛 (https://125.confly.eu.org/) Powered by Discuz! X3.4