Advertisement

VB.NET开发的小游戏——打地鼠

  •  5星
  •     浏览量: 0
  •     大小:None
  •      文件类型:None


简介:
打地鼠是一款使用VB.NET编写的休闲益智小游戏。玩家需快速点击钻出地面的地鼠图标,考验反应速度与手眼协调能力,适合各年龄段人群娱乐放松。 用VB.NET制作的小游戏——打地鼠 ```vb.net Public Class Form1 Inherits System.Windows.Forms.Form Dim pic As New PictureBox Dim goal As Integer Dim i As Integer Dim j As Integer Dim xx1() As Integer = {135, 277, 417} Dim xx2() As Integer = {157, 367} Dim xx3() As Integer = {32, 251, 482} Dim timer As Double = 1 Dim count As Integer 计时器跳动次数 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Text = 小游戏 Me.Size = New Size(650, 465) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Interval = 600 Timer1.Enabled = True Button2.Visible = True End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Button2.Text = 暂停 Then Button2.Text = 继续 Timer1.Enabled = False PictureBox1.Enabled = False ElseIf Button2.Text = 继续 Then Button2.Text = 暂停 Timer1.Enabled = True PictureBox1.Enabled = True End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ifclick = False PictureBox1.Enabled = True If timer = 0 Then Timer1.Enabled = False MsgBox(游戏结束,您的得分: + goal.ToString) Button3.Visible = False Exit Sub End If addpic() timer -= count * 0.5 更新计时器值 End Sub End Class ```

全部评论 (0)

还没有任何评论哟~
客服
客服
  • VB.NET——
    优质
    打地鼠是一款使用VB.NET编写的休闲益智小游戏。玩家需快速点击钻出地面的地鼠图标,考验反应速度与手眼协调能力,适合各年龄段人群娱乐放松。 用VB.NET制作的小游戏——打地鼠 ```vb.net Public Class Form1 Inherits System.Windows.Forms.Form Dim pic As New PictureBox Dim goal As Integer Dim i As Integer Dim j As Integer Dim xx1() As Integer = {135, 277, 417} Dim xx2() As Integer = {157, 367} Dim xx3() As Integer = {32, 251, 482} Dim timer As Double = 1 Dim count As Integer 计时器跳动次数 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Text = 小游戏 Me.Size = New Size(650, 465) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Interval = 600 Timer1.Enabled = True Button2.Visible = True End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Button2.Text = 暂停 Then Button2.Text = 继续 Timer1.Enabled = False PictureBox1.Enabled = False ElseIf Button2.Text = 继续 Then Button2.Text = 暂停 Timer1.Enabled = True PictureBox1.Enabled = True End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ifclick = False PictureBox1.Enabled = True If timer = 0 Then Timer1.Enabled = False MsgBox(游戏结束,您的得分: + goal.ToString) Button3.Visible = False Exit Sub End If addpic() timer -= count * 0.5 更新计时器值 End Sub End Class ```
  • C#
    优质
    这是一款使用C#编程语言开发的经典打地鼠游戏,玩家需要快速点击屏幕上随机出现的地鼠图像以获得高分。适合各年龄段的游戏爱好者挑战反应速度和敏捷性。 C# 打地鼠游戏源码:自定义锤子,地鼠位置不固定,随着游戏的进行难度会逐渐增加。
  • Creatorhitmouse.zip
    优质
    HitMouse.zip是由Creator精心打造的一款趣味横生的经典打地鼠游戏。玩家需快速反应,精准点击屏幕上随机出现的小老鼠,挑战高分纪录,享受轻松愉快的游戏时光。 Creator打地鼠游戏hitmouse.zip 使用cc.Class创建一个组件: ```javascript cc.Class({ extends: cc.Component, properties: { mouse: [cc.Node], hammer: cc.Node, txtCount: cc.Label, }, onLoad () { var manager = cc.director.getCollisionManager(); manager.enabled = true; this.count = 0; this.txtCount.string = this.count; }, start () { cc.director.getScheduler().schedule(this.logic, this, 0.5, false); this.node.on(cc.Node.EventType.TOUCH_START, function(event){ for(let i = 0; i < this.mouse.length; i++){ if(this.mouse[i].opacity == 0){ continue; } let parent = this.mouse[i].parent; let maskPos = parent.parent.convertToWorldSpaceAR(parent.position); let maskRect = cc.rect(maskPos.x - parent.width / 2 , maskPos.y, parent.width, parent.height); let mouse = this.mouse[i]; let mousePos = parent.convertToWorldSpaceAR(mouse.position); let mousRect = cc.rect(mousePos.x - mouse.width / 2, mousePos.y - mouse.height / 2, mouse.width, mouse.height); let mixRect = new cc.Rect(); maskRect.intersection(mixRect, mousRect); if(mixRect.contains(event.getLocation())){ this.hammer.position = parent.position; this.hammer.active = true; this.count++; this.txtCount.string = this.count; break; } } },this); this.node.on(cc.Node.EventType.TOUCH_END, function(event){ this.hammer.active = false; },this); }, logic(){ let index = Math.floor(Math.random() * 9); if(index < 0 || index >= this.mouse.length){ return; } this.mouse[index].getComponent(mouse).appear(); }, }); ``` 这段代码定义了一个用于打地鼠游戏的组件,包含鼠标、锤子和计分板。通过监听触摸事件来控制玩家是否成功击中地鼠,并更新分数显示。同时每0.5秒随机选择一个位置让地鼠出现。
  • 优质
    《地鼠打捞小游戏》是一款轻松有趣的休闲游戏,玩家需要控制潜水员使用捕鱼网捕获不断浮出水面的各种调皮的地鼠。游戏中色彩鲜艳、操作简单,适合各个年龄段的人士放松娱乐。 我开发了一款简单的打地鼠游戏,适用于各种尺寸的iPhone(不含 iPhone X,因为当时该型号尚未推出)。
  • ——Android
    优质
    《打地鼠》是一款专为Android用户设计的经典休闲游戏。玩家需快速反应,用锤子敲击不断冒出地面的地鼠,挑战高分记录。简洁的操作和可爱的画风深受各年龄层玩家喜爱。 Android课程设计——打地鼠,在Android Studio上编译成功!
  • 优质
    地鼠打捞小游戏是一款轻松愉快的休闲游戏,玩家需要快速反应,用铲子捕捉从洞中探出头来的调皮地鼠,考验眼手协调与敏捷思维。 实现了等级系统、计时器功能以及击中标记音效。支持图片转换,并且有得分显示与最高分记录。使用多线程技术实现上述功能,体现了软件设计的分层思想,适合初学者学习。
  • 基于gec6818_GEC6818
    优质
    本项目基于GEC6818开发板实现了一款趣味十足的打地鼠游戏。通过硬件与软件结合,实现了图像显示、触控响应等功能,为用户提供沉浸式的游戏体验。 基于gec6818的打地鼠游戏源码使用C语言编写,包含显示图片、计时和计分等功能。
  • 使用Qt
    优质
    本项目是一款基于Qt框架开发的经典打地鼠游戏,结合了C++和QML技术,旨在提供流畅、互动性强的游戏体验。 在博客上有博主讲解了如何使用Qt开发打地鼠游戏的相关文章。
  • 基于FPGA
    优质
    本项目基于FPGA技术实现了一款互动性强、趣味性高的电子版打地鼠游戏,通过硬件描述语言设计游戏逻辑及显示模块。 这段文字描述了一个包含打地鼠游戏完整工程源代码的项目,并附有一份详细文档报告来解释各个源代码文件的作用。