求vb代码,窗体上一个小球,到处滚,碰到边界就反弹回来

来源:百度知道 编辑:UC知道 时间:2024/05/25 22:18:41

我写来的游戏,全部源代码:

Dim vx As Integer, vy As Integer

Dim tm As Integer

Dim fs As Integer

Private Sub Command1_Click()

If Timer1.Enabled = False Then

Timer1.Enabled = True

If Shape2.Top > Picture1.Height Then

Dim x As Integer

x = 0

Shape1.Left = Picture1.Width / 2 - Shape1.Width / 2

Shape1.Top = Picture1.Height - 300

Shape2.Left = Picture1.Width / 2 - Shape2.Width / 2

Shape2.Top = Picture1.Height - Shape1.Height - Shape1.Height - 50

vx = 30

vy = 30

'Label1(0).Visible = False

'For i = 1 To 90 Step 2

'Unload Label1(i)