vb贪食蛇源代码

4星(超过85%的资源)
所需积分/C币:15 2012-04-21 16:52:54 16KB TXT
17
收藏 收藏
举报

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 tpsForbiddenZone FZ_TOP = 30 FZ_BOTTOM = 5330 FZ_LEFT = 30 FZ_RIGHT = 5730 End Enum '定义蛇头及身体初始化数枚举值 Private Enum tpsSnake SNAKEONE = 1 SNAKETWO = 2 SNAKETHREE = 3 SNAKEFOUR = 4 End Enum '定义蛇宽度的常量 Private Const SNAKEWIDTH As Integer = 100 '该过程用于显示游戏信息 Private Sub Form_Load() Me.Show Me.lblTitle = "BS贪食蛇 — (版本 " & App.Major & "." & App.Minor & "." & App.Revision & ")" Me.Caption = Me.lblTitle.Caption frmSplash.Show 1 End Sub '该过程用于使窗体恢复原始大小 Private Sub Form_Resize() If Me.WindowState 1 Then Me.Caption = "" Me.Height = 6405 '窗体高度为 6405 缇 Me.Width = 8535 '窗体宽度为 8535 缇 Me.Left = (Screen.Width - Width) \ 2 Me.Top = (Screen.Height - Height) \ 2 End If End Sub '该过程用于重新开始开始游戏 Private Sub cmdGameStart_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Beep msg = MsgBox("您确认要重新开始游戏吗?", 4 + 32, "BS贪食蛇") If msg = 6 Then Call m_subGameInitialize End Sub '该过程用于暂停/运行游戏 Private Sub chkPause_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Me.chkPause.Caption = "暂停游戏(&P)" Then Me.tmrSnakeMove.Enabled = False Me.tmrGameTime.Enabled = False Me.picMoveArea.Enabled = False Me.lblPauseLab.Visible = True Me.chkPause.Caption = "继续游戏(&R)" Else Me.tmrSnakeMove.Enabled = True Me.tmrGameTime.Enabled = True Me.picMoveArea.Enabled = True Me.lblPauseLab.Visible = False Me.chkPause.Caption = "暂停游戏(&P)" End If End Sub '该过程用于显示游戏规则 Private Sub cmdGameRules_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Beep MsgBox " BS贪食蛇:一个规则最简单的趣味游戏,您将用键盘" & Chr(13) & _ "上的4个方向键来控制蛇的运动方向。在运动过程中蛇"

...展开详情
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
qq_29198889 是文本格式的,如果是vbp就好了饿
2015-06-21
回复
rexshao 小白表示 不知道怎么用 txt格式的
2014-09-07
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
关注 私信
上传资源赚钱or赚积分
最新推荐
vb贪食蛇源代码 15积分/C币 立即下载
1/0