js实现一个积分打地鼠小游戏代码
代码语言:html
所属分类:游戏
代码描述:js实现一个积分打地鼠小游戏代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <style> body{background: #45454d;cursor:url("//repo.bfw.wiki/bfwrepo/images/game/zadishu/hammer.ico"),auto; user-select: none} .holes{ width:600px; height:600px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #45454d; display: grid; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); } .hole{ position: relative; } .hole img{ position: absolute; width:97%; } .hole img.boom{ z-index: 1; visibility: hidden; } .hole img.mouse{ width:60%; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); visibility: hidden; } div{ font-size: 3em; color:#fff; } </style> </head> <body onclick = "knock()"> <div>积分:<span class="score"></span></div> <div class="holes"> <div class="hole"><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/boom.png" class="boom" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/hole.png" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/mouse.png" class="mouse" alt=""></div> <div class="hole"><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/boom.png" class="boom" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/hole.png" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/mouse.png" class="mouse" alt=""></div> <div class="hole"><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/boom.png" class="boom" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/hole.png" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/mouse.png" class="mouse" alt=""></div> <div class="hole"><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/boom.png" class="boom" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/hole.png" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/mouse.png" class="mouse" alt=""></div> <div class="hole"><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/boom.png" class="boom" alt=""><img src="//repo.bfw.wiki/bfwrepo/images/game/zadishu/hole.png" alt=""><img src="//repo.bfw.wiki/bfw.........完整代码请登录后点击上方下载按钮下载查看
网友评论0