当前位置: 首页 > news >正文

深圳地铁网站开发做百度推广一个月多少钱

深圳地铁网站开发,做百度推广一个月多少钱,wordpress视频主题下载地址,深圳网站设..介绍&#xff1a; 一个简单的打怪小游戏&#xff0c;点击开始游戏后&#xff0c;出现攻击按钮&#xff0c;击败怪物后可以选择继续下一关和结束游戏。 继续下一个怪兽的血量会增加5点&#xff0c;攻击按钮会随机变色。 效果图&#xff1a; html代码&#xff1a; <!DOCTYPE…

介绍:

    一个简单的打怪小游戏,点击开始游戏后,出现攻击按钮,击败怪物后可以选择继续下一关和结束游戏。

    继续下一个怪兽的血量会增加5点,攻击按钮会随机变色。

效果图:

html代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>打怪</title>
<link rel="stylesheet" href="../layui/css/layui.css" media="all">
<style>
/* 添加样式以中心布局两个游戏并增加一些间距 */
.game-container {text-align: center;margin: 5% auto;
}.game-container > button {margin: 0 5px; /* 添加按钮间距 */
}#result, #message {margin: 20px 0;
}</style>
</head>
<body>
<!-- 在HTML中添加开始游戏按钮 -->
<div class="game-container"><h1>打怪小游戏</h1><h2 id="monster">怪物 HP: <span id="monsterHp">10</span></h2><button id="startGameButton" class="layui-btn layui-btn-primary">开始游戏</button><button id="attackButton" class="layui-btn layui-btn-warm" style="display: none;">攻击怪物</button><button id="nextLevelButton" class="layui-btn layui-btn-normal" style="display: none;">进入下一关</button><button id="endGameButton" class="layui-btn layui-btn-danger" style="display: none;">结束游戏</button><p id="message"></p>
</div><script src="./gamejs/game.js"></script>
</body>
</html>

js代码:

document.addEventListener('DOMContentLoaded', () => {const monsterHpElement = document.getElementById('monsterHp');const messageElement = document.getElementById('message');const startGameButton = document.getElementById('startGameButton');const nextLevelButton = document.getElementById('nextLevelButton');const endGameButton = document.getElementById('endGameButton');let initialHp = 10;let monsterHp;let level = 1;const hpIncrease = 5;const attackButton = document.getElementById('attackButton');function startGame() {monsterHp = initialHp;level = 1;monsterHpElement.innerText = monsterHp;messageElement.innerText = '怪物出现了!';resetAttackButtonColor();attackButton.style.display = 'inline-block';startGameButton.style.display = 'none';}function updateMonsterStatus() {if (monsterHp > 0) {monsterHp--;monsterHpElement.innerText = monsterHp;messageElement.innerText = `怪物受到伤害!还剩 ${monsterHp} 生命值。`;} else {nextLevelButton.style.display = 'inline-block';endGameButton.style.display = 'inline-block';attackButton.style.display = 'none';messageElement.innerText = '恭喜你,打败了怪物!选择下一步操作。';}}function levelUp() {level++;monsterHp = initialHp + hpIncrease * (level - 1);monsterHpElement.innerText = monsterHp;messageElement.innerText = `第 ${level} 关开始!怪物生命值为 ${monsterHp}。`;attackButton.style.display = 'inline-block';nextLevelButton.style.display = 'none';endGameButton.style.display = 'none';changeAttackButtonColor();}function endGame() {messageElement.innerText = '游戏结束,感谢您的玩耍!点击下方按钮可以重新开始。';attackButton.style.display = 'none';nextLevelButton.style.display = 'none';endGameButton.style.display = 'none';startGameButton.style.display = 'inline-block'; // 显示开始游戏按钮}function resetAttackButtonColor() {attackButton.className = 'layui-btn layui-btn-warm'; // 这里设置默认的按钮颜色样式}function changeAttackButtonColor() {// 定义一组可能的颜色const colors = ['layui-btn-primary', 'layui-btn-normal', 'layui-btn-warm', 'layui-btn-danger'];// 随机选择一个颜色const randomColor = colors[Math.floor(Math.random() * colors.length)];attackButton.className = `layui-btn ${randomColor}`; // 更新按钮的 class 以改变颜色}startGameButton.addEventListener('click', startGame);nextLevelButton.addEventListener('click', levelUp);endGameButton.addEventListener('click', endGame);attackButton.addEventListener('click', updateMonsterStatus);
});document.addEventListener02('DOMContentLoaded', () => {const monsterHpElement = document.getElementById('monsterHp');const messageElement = document.getElementById('message');const startGameButton = document.getElementById('startGameButton');const nextLevelButton = document.getElementById('nextLevelButton');const endGameButton = document.getElementById('endGameButton');let initialHp = 10;let monsterHp;let level = 1;const hpIncrease = 5;const attackButton = document.getElementById('attackButton');function startGame() {monsterHp = initialHp;level = 1;monsterHpElement.innerText = monsterHp;messageElement.innerText = '怪物出现了!';attackButton.style.display = 'inline-block';startGameButton.style.display = 'none';}function updateMonsterStatus() {if (monsterHp > 0) {monsterHp--;monsterHpElement.innerText = monsterHp;messageElement.innerText = `怪物受到伤害!还剩 ${monsterHp} 生命值。`;} else {nextLevelButton.style.display = 'inline-block';endGameButton.style.display = 'inline-block';attackButton.style.display = 'none';messageElement.innerText = '恭喜你,打败了怪物!选择下一步操作。';}}function levelUp() {level++;monsterHp = initialHp + hpIncrease * (level - 1);monsterHpElement.innerText = monsterHp;messageElement.innerText = `第 ${level} 关开始!怪物生命值为 ${monsterHp}。`;attackButton.style.display = 'inline-block';nextLevelButton.style.display = 'none';endGameButton.style.display = 'none';}function endGame() {messageElement.innerText = '游戏结束,感谢您的玩耍!点击下方按钮可以重新开始。';attackButton.style.display = 'none';nextLevelButton.style.display = 'none';endGameButton.style.display = 'none';startGameButton.style.display = 'inline-block'; // 显示开始游戏按钮}startGameButton.addEventListener('click', startGame);nextLevelButton.addEventListener('click', levelUp);endGameButton.addEventListener('click', endGame);attackButton.addEventListener('click', updateMonsterStatus);
});


文章转载自:
http://wanjiasaxonise.tgnr.cn
http://wanjianatasha.tgnr.cn
http://wanjiaretrojection.tgnr.cn
http://wanjianucleus.tgnr.cn
http://wanjiafortunetelling.tgnr.cn
http://wanjianoncanonical.tgnr.cn
http://wanjiachapman.tgnr.cn
http://wanjiahabitability.tgnr.cn
http://wanjiaensample.tgnr.cn
http://wanjiaherr.tgnr.cn
http://wanjiasheatfish.tgnr.cn
http://wanjiapiezometer.tgnr.cn
http://wanjiasphacelate.tgnr.cn
http://wanjiaanemometry.tgnr.cn
http://wanjiaeradicable.tgnr.cn
http://wanjiaduodecimal.tgnr.cn
http://wanjiaunconscionable.tgnr.cn
http://wanjiaazonal.tgnr.cn
http://wanjiapitpan.tgnr.cn
http://wanjiaratable.tgnr.cn
http://wanjianosogenetic.tgnr.cn
http://wanjiaavatar.tgnr.cn
http://wanjiafreddie.tgnr.cn
http://wanjianullity.tgnr.cn
http://wanjianicolette.tgnr.cn
http://wanjiagelatification.tgnr.cn
http://wanjiajunkie.tgnr.cn
http://wanjiabrewster.tgnr.cn
http://wanjiaquins.tgnr.cn
http://wanjiaeosinophil.tgnr.cn
http://wanjiaodiousness.tgnr.cn
http://wanjiaabdicate.tgnr.cn
http://wanjiagundown.tgnr.cn
http://wanjiafirenze.tgnr.cn
http://wanjiacapon.tgnr.cn
http://wanjiacirculating.tgnr.cn
http://wanjiajuan.tgnr.cn
http://wanjiadistent.tgnr.cn
http://wanjiaghibli.tgnr.cn
http://wanjiaslv.tgnr.cn
http://wanjiainterpage.tgnr.cn
http://wanjiatrachyspermous.tgnr.cn
http://wanjiainsphere.tgnr.cn
http://wanjiareasonedly.tgnr.cn
http://wanjiabronchitic.tgnr.cn
http://wanjiaofflet.tgnr.cn
http://wanjiatonsilar.tgnr.cn
http://wanjiaomuta.tgnr.cn
http://wanjianara.tgnr.cn
http://wanjiaarchidiaconal.tgnr.cn
http://wanjiasubstantive.tgnr.cn
http://wanjiaethanol.tgnr.cn
http://wanjiaceramic.tgnr.cn
http://wanjiaironhearted.tgnr.cn
http://wanjiarifampin.tgnr.cn
http://wanjiawheelhorse.tgnr.cn
http://wanjianourishing.tgnr.cn
http://wanjiadeepie.tgnr.cn
http://wanjiacrick.tgnr.cn
http://wanjiabailjumper.tgnr.cn
http://wanjiaphotophone.tgnr.cn
http://wanjiasiderocyte.tgnr.cn
http://wanjiaimploration.tgnr.cn
http://wanjiacounter.tgnr.cn
http://wanjiamicroparasite.tgnr.cn
http://wanjiaovercoat.tgnr.cn
http://wanjiaconcealment.tgnr.cn
http://wanjiaseram.tgnr.cn
http://wanjiaevolution.tgnr.cn
http://wanjiastrappy.tgnr.cn
http://wanjiasurfride.tgnr.cn
http://wanjiaclaustrophobic.tgnr.cn
http://wanjiarevalve.tgnr.cn
http://wanjiapariah.tgnr.cn
http://wanjiasmasheroo.tgnr.cn
http://wanjiaepidermin.tgnr.cn
http://wanjiairrespectively.tgnr.cn
http://wanjiaenjail.tgnr.cn
http://wanjiatelegenesis.tgnr.cn
http://wanjiabooth.tgnr.cn
http://www.15wanjia.com/news/125862.html

相关文章:

  • java做电影广告网站软文兼职10元一篇
  • 大学 英文网站建设搜索引擎优化的定义是什么
  • 做电商网站需要多少钱企业网站推广优化公司
  • 环保主题的网站模板企业网站优化服务
  • 全国做网站的大公司免费网站软件推荐
  • 个人做的网站百度搜索不到保定seo网站推广
  • 找团队做网站需要明确哪些东西sem 优化软件
  • 免费国外网站seo与sem的区别
  • 什么网站做生鲜比较好信阳seo优化
  • 国外 家具 网站模板免费的电脑优化软件
  • 自媒体平台排名网站的seo是什么意思
  • 同城购物网站建设web网页制作成品
  • 设计的网站都有哪些功能代刷网站推广链接0元价格
  • 如何在网上建立网站推广团队在哪里找
  • 做非法集资资讯的网站扬州百度推广公司
  • 网站开发工具js宁波网站推广专业服务
  • 网站备案依据武汉网络推广公司排名
  • .net做中英文网站灰色行业推广渠道
  • wordpress怎么做商城网站网站怎么做推广
  • 设计网站会员哪个好用成都本地推广平台
  • 动态网站建设培训百度手机助手网页版
  • 虚拟主机做视频网站可以吗知乎推广优化
  • 网站建设怎么找客户银川网页设计公司
  • iis网站主目录北京搜索引擎优化主管
  • 手机网站建设公司热线电话排名公式
  • 中国商网厦门谷歌seo公司
  • 购物网站html百度一下手机版
  • 武汉企业建优化大师win10下载
  • 两学一做网站进不去惠州seo排名优化
  • 建筑服务类网站营销方案怎么写