www.qcfz.net > 用VB做一个小游戏

用VB做一个小游戏

'定义蛇的运动速度枚举值 Private Enum tpsSpeed QUICKLY = 0 SLOWLY = 1 End Enum '定义蛇的运动方向枚举值 Private Enum tpsDirection D_UP = 38 D_DOWN = 40 D_LEFT = 37 D_RIGHT = 39 End Enum '定义运动区域4个禁区的枚举值 Private Enum t...

下面是个程序!希望有用 '定义蛇的运动速度枚举值 Private Enum tpsSpeed QUICKLY = 0 SLOWLY = 1 End Enum '定义蛇的运动方向枚举值 Private Enum tpsDirection D_UP = 38 D_DOWN = 40 D_LEFT = 37 D_RIGHT = 39 End Enum '定义运动区域4个禁区...

窗体放两个Label控件,一个Timer控件: Dim n As Integer Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case vbKeyUp If Label1.Top > 0 Then Label1.Top = Label1.Top - 50 Case vbKeyDown If Label1....

把代码复制到空窗体中按F5运行即可。 Option Explicit Private WithEvents Timer1 As Timer Private WithEvents Label1 As Label Dim GFangXiang As Boolean Dim HWB As Single Dim She() As ShenTi Dim X As Long, Y As Long Dim ZhuangTai(23,...

做个贪吃蛇,flppy bird,纵向像素赛车,推箱子,水果机 这些都不难,运用到一些特殊游戏算法, 贪吃蛇:创建pictureBox控件数组, 然后加身子就load picture1(picture1.UBound+1) 在声明一个动态数2d数组,每个身子都有一个X,Y值每移动一次贪吃...

你说的贪吃蛇、推箱子都不简单,涉及到很多方面的设计,要花不少时间的。这里估计很少有人能帮得上你。祝你好运。 帮你做了一个简单的猜数游戏,代码如下: '只需给窗体添加一个Command1的控件,单击它即可执行,允许多次执行 Private Sub Comma...

贪吃蛇Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)Dim C As LongIf KeyCode = 27 Then EndIf KeyCode = 32 Then If Timer1.Enabled = True Then Timer1.Enabled = False Label1.Visible = True Else Timer1.Enabled = True...

Private Sub Command0_Click() Dim x As String x = "●" If Command2.Caption = x Then Command2.Caption = "○" Else Command2.Caption = "●" End If If Command4.Caption = x Then Command4.Caption = "○" Else Command4.Caption = "●" End If ...

如果要做1-52的牌的话,建议这么来,1-4是1,5-8是2……以此类推,37-40是10吧,应该不是45吧? 这种情况下,只要将牌的序号整除4,然后+1得到的结果就是拍的数值了,比如9/4+1=3,这张牌是3,再假设1是黑桃,2是红桃,3是梅花,4是方块,那么将牌...

贪吃蛇 Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim C As Long If KeyCode = 27 Then End If KeyCode = 32 Then If Timer1.Enabled = True Then Timer1.Enabled = False Label1.Visible = True Else Timer1.Enabled = ...

网站地图

All rights reserved Powered by www.qcfz.net

copyright ©right 2010-2021。
www.qcfz.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com