接鸡冠^^

欢迎来到程序小院

接鸡冠

玩法:左右移动棒棒君(小海豹)接住鸡冠,避开炸弹,若不小心接住炸弹则游戏结束,
赶紧接鸡冠吧,看看你能够接住多少鸡冠哦^^。。

开始游戏icon-default.png?t=N7T8https://www.ormcc.com/play/gameStart/211

html

  <div id="game-box"></div>

css

canvas{display: block;touch-action: none;user-select: none;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);width: 320px;height: 508px;cursor: inherit;margin-top: 0px;
}

js

game.physics.startSystem(Phaser.Physics.ARCADE);
// 背景
this.bg = game.add.sprite(0, 0, 'loadbg');
this.bg.width = _width;
this.bg.height = _height + dheight;
// 地面
this.ground = game.add.sprite(0, game.height, 'ground');
this.ground.anchor.set(0, 1);
this.ground.width = game.width;
this.ground.height = 195 / unit;
game.physics.arcade.enable(this.ground);
//鼹鼠
this.bang = game.add.sprite(game.world.centerX, game.height - 178 / unit, 'allbang');
this.bang.anchor.set(0.5, 1);
this.bang.width = 260 / unit;
this.bang.height = 440 / unit;
this.bang.animations.add('bangrun', runArr);
this.bang.animations.add('bangget', getArr);
this.bang.animations.add('banglose', loseArr);
this.bang.animations.play('bangrun', 20, true);
game.physics.arcade.enable(this.bang);
this.bang.body.width = 220 / unit;
this.bang.body.height = 400 / unit;
this.bang.body.offset.set(20 / unit, 20 / unit);
this.bang.body.collideWorldBounds = true;this.onStart();//音乐控制
this.voiceBtn = game.add.sprite(923 / unit, 45 / unit, 'voice', 1);
this.voiceBtn.width = 105 / unit;
this.voiceBtn.height = 105 / unit;
this.voiceBtn.inputEnabled = true;
this.voiceBtn.events.onInputDown.add(game.bgmControl, this);
//分数
this.showScore = game.add.sprite();
this.scoreBox = game.add.sprite(25 / unit, 20 / unit, 'scorebox');
this.scoreBox.width = 525 / unit;
this.scoreBox.height = 157 / unit;
this.showScore.addChild(this.scoreBox);
this.score = game.add.retroFont('score', 32, 62, "0123456789", 10, 0, 0);
this.score.setFixedWidth(320, Phaser.RetroFont.ALIGN_RIGHT);
this.score.text = "0";
this.num = game.add.image(200 / unit, 86 / unit, this.score);
this.num.scale.set(1 / unit);
this.showScore.addChild(this.num);
this.showScore.bringToTop();
//音效
this.getbgm = game.add.audio('get', 0.2, false);
this.boombgm = game.add.audio('boom', 0.2, false);
this.losebgm = game.add.audio('lose', 0.2, false);//游戏结束弹窗
this.overPopup = game.add.group();
this.overBox = game.add.image(46 / unit, 321 / unit, 'overbox');
this.overBox.width = 989 / unit;
this.overBox.height = 1068 / unit;
this.overPopup.add(this.overBox);
this.overscore = game.add.retroFont('overscore', 32, 62, "0123456789", 10, 0, 0);
this.overnum = game.add.image(603 / unit, 564 / unit, this.overscore);
this.overnum.scale.set(1 / unit);
this.overPopup.add(this.overnum);
this.againBtn = game.add.button(315 / unit, 695 / unit, 'again', function () {this.losebgm.stop();clickbgm.play();setTimeout(function () {game.state.start('game');if (!game.musicPause) {bgm.play();}}, 1000);
}, this);
this.againBtn.width = 477 / unit;
this.againBtn.height = 163 / unit;
this.overPopup.add(this.againBtn);
this.linkBtn = game.add.button(729 / unit, 1065 / unit, 'link', function () {}, this);
this.linkBtn.width = 240 / unit;
this.linkBtn.height = 60 / unit;
this.overPopup.add(this.linkBtn);
this.overPopup.visible = false;

源码

需要源码请关注添加好友哦^ ^

转载:欢迎来到本站,转载请注明文章出处https://ormcc.com/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/203879.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【精选】设计模式——策略设计模式-两种举例说明,具体代码实现

Java策略设计模式 简介 策略设计模式是一种行为型设计模式&#xff0c;它允许在运行时选择算法的行为。 在软件开发中&#xff0c;我们常常需要根据不同情况采取不同的行为。通常的做法是使用大量的条件语句来实现这种灵活性&#xff0c;但这会导致代码变得复杂、难以维护和扩…

C/C++---------------LeetCode第2154. 将找到的值乘以 2

将找到的值乘以 2 题目及要求哈希表递归 题目及要求 给你一个整数数组 nums &#xff0c;另给你一个整数 original &#xff0c;这是需要在 nums 中搜索的第一个数字。 接下来&#xff0c;你需要按下述步骤操作&#xff1a; 如果在 nums 中找到 original &#xff0c;将 ori…

Unity打包EXE自定义(拖拽)窗口大小

代码 using System.Collections; using System.Collections.Generic; using UnityEngine; using System; using System.Runtime.InteropServices; public class MyWindow : MonoBehaviour {[DllImport("user32.dll")]private static extern IntPtr GetActiveWindow(…

CSS-自适应导航栏(flex | grid)

目标&#xff1a;实现左右各有按钮&#xff0c;中间是内容&#xff0c;自适应显示中间的内容导航栏&#xff0c;即 根据中间的宽度大小显示内容。 自适应导航栏 总结&#xff1a;推荐 flex布局 / grid布局 flex布局&#xff1a; 两侧 flex:1; ----->中间自适应 grid布局&…

uniapp(微信小程序)聊天实例,支持图片,语音,表情(附源码)

效果预览 安装教程 配置 请参考Dome 会话配置 {info:{// 用户关键字userKey:2666,// 用户手机userPhone:15252156614,// 用户昵称userName: 健健,// 头像headImg: http://d.hiphotos.baidu.com/image/h%3D300/sign0defb42225381f3081198ba999004c67/6159252dd42a2834a75bb01…

【LeetCode 0028】【字符串】实现strStr

题目 https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/ 题解 暴力O(mn), i指向haystack当前位置&#xff0c;最多共移动 m-n 次. j 指向needle 当前位置&#xff0c;i每移动一次&#xff0c;往后n个字符与needle的n个字符进行比较&#…

CRM客户关系管理系统的主要功能有哪些?

我们都知道&#xff0c;CRM系统可以帮助企业加快业务增长。如果一个企业能提高业务效率、跨团队协作、有效管理客户、轻松共享和同步数据&#xff0c;那么企业竞争力将极大地提高。基于此&#xff0c;我们说说CRM客户关系管理系统的主要功能分析。 完整的CRM是什么样的&#x…

红队专题-开源资产扫描系统-ARL资产灯塔系统

ARL资产灯塔系统 安装说明问题 &#xff1a; 安装说明 源码地址 https://github.com/TophantTechnology/ARL https://github.com/TophantTechnology/ARL/wiki/Docker-%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85-ARL 安装环境 uname -a Linux VM-24-12-centos 3.10.0-1160.49.1.e…

不简单的字符串转换问题

关卡名 字符串&#xff1a;隐形的王者 我会了✔️ 内容 1.理解字符串的基本特征 ✔️ 2.记住Java、C或者Python里字符串都是怎么用的 ✔️ 3.掌握字符串转整数的几种场景和处理方法 ✔️ 字符串里存放的可以是字母&#xff0c;可以是数字&#xff0c;也可以是特殊字符&…

Redis中持久化策略RDB与AOF优缺点对比

Redis持久化策略对比 RDBAOF持久化方式定时对整个内存做快照记录每一次执行的命令数据完整性不完整,两次备份之间存在丢失相对完整,取决于刷盘策略文件大小会有压缩,文件体积小记录命令,文件体积较大宕机恢复速度很快慢数据恢复优先级低,数据完整性不如AOF高,记录了执行命令数据…

亚马逊云科技re:Invent,生成式AI正在彻底改变开发者的工作方式

去年此时&#xff0c;ChatGPT横空出世席卷全球&#xff0c;许多人称其意味着AI的iPhone时刻到来。CSDN创始人蒋涛对此曾预测&#xff1a;「下一步就是应用时刻&#xff0c;新应用时代将来临……大模型将推动更多的AI应用程序员诞生」。 在2023亚马逊云科技re:Invent全球大会第三…

Linux--环境变量

一.基本概念 * 环境变量 (environment variables) 一般是指在操作系统中用来指定操作系统运行环境的一些参数 * 如&#xff1a;我们在编写 C/C 代码的时候&#xff0c;在链接的时候&#xff0c;从来不知道我们的所链接的动态静态库在哪里&#xff0c;但 是照样可以链接成功&am…

使用jenkins插件Allure生成自动化测试报告

前言 以前做自动化测试的时候一直用的HTMLTestRunner来生成测试报告&#xff0c;后来也尝试过用Python的PyH模块自己构建测试报告&#xff0c;在后来看到了RobotFramework的测试报告&#xff0c;感觉之前用的测试报告都太简陋&#xff0c;它才是测试报告应该有的样子。也就是在…

微信小程序 -- ios 底部小黑条样式问题

问题&#xff1a; 如图&#xff0c;ios有的机型底部伪home键会显示在按钮之上&#xff0c;导致点击按钮的时候误触 解决&#xff1a; App.vue <script>export default {wx.getSystemInfo({success: res > {let bottomHeight res.screenHeight - res.safeArea.bott…

c语言五子棋

下面是一个简单的C语言五子棋实现示例&#xff1a; #include <stdio.h>#include <stdlib.h>#define BOARD_SIZE 15char board[BOARD_SIZE][BOARD_SIZE];void init_board() { int i, j; for (i 0; i < BOARD_SIZE; i) { for (j 0; j < BOARD_…

HarmonyOS4.0从零开始的开发教程09页签切换

HarmonyOS&#xff08;七&#xff09;页签切换 List组件和Grid组件的使用 Tabs组件的使用 概述 在我们常用的应用中&#xff0c;经常会有视图内容切换的场景&#xff0c;来展示更加丰富的内容。比如下面这个页面&#xff0c;点击底部的页签的选项&#xff0c;可以实现“首页…

[ES]ElasticSearch强转日期的时区问题

问题 由于ES不能修改时区&#xff0c;且默认时区始终为UTC。 当才查询数据时&#xff0c;通过强转获得的日期并不是想要的&#xff0c;通过分析发现&#xff0c;正是由于默认时区导致结果相差了8个小时。 查询语句&#xff1a; POST http://localhost:9200/_sql?formattext {&…

CTF工控工业互联网(ISC)复现总结WP(超详细)

工业互联网复现 Modbus协议&#xff1a;MMS协议&#xff1a;ISC工业互联网比赛题目复现&#xff1a;Modbus协议分析&#xff1a;组态软件安全分析&#xff1a;工业协议分析1&#xff1a;工业协议分析2&#xff1a;特殊的工控流量&#xff1a; Modbus协议&#xff1a; Modbus 市…

JavaScript中的连续赋值问题a.x = a = {n:2}

输出以下代码的执行结果并解释为什么 var a {n: 1}; var b a; a.x a {n: 2}; console.log (a.x); console.log (b.x); 下面来分析下这段简单代码的工作步骤&#xff0c;从而进一步理解js引用类型“赋值”的工作方式。 首先第一行和第二行 var a {n:1}; var b a; …

Android studio 工程的 module 依赖关系图绘制 、 Android Module 依赖关系的可视化实现

整体步骤&#xff1a; 1、利用gradle脚本生成dot&#xff1b; 2、利用graphviz将dot可视化转为图片 利用gradle脚本生成dot 下载projectDependencyGraph.gradle脚本 下载 projectDependencyGraph.gradle &#xff0c;放在项目根目录&#xff0c; 源码如下&#xff1a; t…