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

电子商务网站运营与...个人简历自我评价怎么写

电子商务网站运营与...,个人简历自我评价怎么写,广州seo学徒,视频推广平台有哪些介绍#xff1a; 一个简单的打怪小游戏#xff0c;点击开始游戏后#xff0c;出现攻击按钮#xff0c;击败怪物后可以选择继续下一关和结束游戏。 继续下一个怪兽的血量会增加5点#xff0c;攻击按钮会随机变色。 效果图#xff1a; html代码#xff1a; !DOCTYPE…介绍 一个简单的打怪小游戏点击开始游戏后出现攻击按钮击败怪物后可以选择继续下一关和结束游戏。 继续下一个怪兽的血量会增加5点攻击按钮会随机变色。 效果图 html代码 !DOCTYPE html html langen head meta charsetUTF-8 meta nameviewport contentwidthdevice-width, initial-scale1.0 title打怪/title link relstylesheet href../layui/css/layui.css mediaall 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 classgame-containerh1打怪小游戏/h1h2 idmonster怪物 HP: span idmonsterHp10/span/h2button idstartGameButton classlayui-btn layui-btn-primary开始游戏/buttonbutton idattackButton classlayui-btn layui-btn-warm styledisplay: none;攻击怪物/buttonbutton idnextLevelButton classlayui-btn layui-btn-normal styledisplay: none;进入下一关/buttonbutton idendGameButton classlayui-btn layui-btn-danger styledisplay: none;结束游戏/buttonp idmessage/p /divscript 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://www.zqtcl.cn/news/385591/

相关文章:

  • 暗网做网站温州做网络推广的公司
  • 网站描述 修改上海火迎网络推广运营优化
  • 黄石网站建设哪家专业做个网站费用
  • 免费做的网站怎么设置域名解析宁夏百度seo
  • 化妆品产品的自建网站有哪些阿里云cdn wordpress错位
  • 增加网站流量网站新闻字体
  • 做外贸建网站需要推广吗服装如何做微商城网站
  • 上海市建设安全协会网站查询考试伪静态 wordpress
  • 网站免费建站o网站编程多少钱
  • 建设网站开发海外推广服务
  • 网站建设需要提供的资料文档营销平台建设
  • 做个响应式网站多少钱河南网络推广系统
  • wordpress的后台文章图文发布清远市seo广告优化
  • 长沙的互联网网站公司招标文件免费下载网站
  • icp备案系统网站品网站建设公司排名
  • 什么网站可以做音乐相册可信的品牌网站建设
  • 洛阳网站建设优惠公司网站查询ip地址
  • 学校网站模版电影网站要怎样做才有出路
  • 无锡网站建设 微信企业网站建设与管理期末考试
  • 海南海口网站开发公司怎么建立微网站?
  • 网站建设 鄂icp备app 微网站
  • 西安做网站seo网站站内优化怎么做
  • 建设网站方案公司wordpress 视差主题
  • 网站 建设 语言wordpress同步
  • 三水 网站建设建设部网站网上大厅
  • 深圳高端企业官方网站建设最好的网站设计开发公司
  • 主流大型网站开发语言调查怀柔富阳网站建设
  • 公司网站建设服务类别最便宜云主机永久免费
  • 心悦dnf免做卡网站竞价恶意点击犯法吗
  • 企业网站的类型包括无锡专业网站建设