VB“反d球”程序设计

VB“反d球”程序设计,第1张

if

then

'

向左运动

x1=x1+1

end

if

if

then

'

向右运动

x1=x1-1

end

if

if

then

'

向上运动

y1=y1+1

'

使用自定义

坐标系统

有统一的坐标转换过程

end

if

if

then

'

向下运动

y1=y1-1

end

if

''达到最大边界后判断处理过程,回原始位置再来

还是

向反方向走

''

我只会左右反d球。 S1是Shape

Private Sub Timer1_Timer()

Static s

If S1.Left >= Form1.Width - S1.Width And s = 2 Then s = 0

If S1.Left <= 0 And s = 0 Then s = 2

If s = 0 Then S1.Left = S1.Left - 100

If s = 2 Then S1.Left = S1.Left + 100

End Sub


欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/yw/11135422.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-13
下一篇2023-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存