HTML5+CSS+JavaScript实现捉虫小游戏设计和实现
捉虫小游戏
首页展示:
选择昆虫:
效果展示:
有密集恐惧症的别玩哟、游戏永远不会停止 一直玩
项目源码结构:
图片和js以及css等基础文件代码实现
主要源码展示:
index.html:引入图片和css文件以及js
insect-catch-game enzhCatch The Insect
What is your "favorite" insect?
Fly
mosquito
spider
roach
Time:00:00
Score:0
Tell you a bad news, will you be angry?
Actually you are playing a game that never ends!!
部分style.css样式布局
@import url('https://fonts.googleapis.com/css?family=Press+Start+2P&display=swap'); * { margin: 0; padding: 0; box-sizing: border-box; } body { color: #fff; text-align: center; font-family: 'Press Start 2P', sans-serif; overflow: hidden; background: linear-gradient(135deg, #9cc8e9 10%, #0b6be0 90%); min-height: 100vh; } .screen { display: flex; justify-content: center; align-items: center; flex-direction: column; width: 100vw; height: 100vh; transition: all .4s cubic-bezier(0.165, 0.84, 0.44, 1); position: relative; overflow: hidden; } .screen.hidden { margin-top: -100vh; } .screen h1, .screen h2 { letter-spacing: 2px; margin-bottom: 1rem; line-height: 1.5; } .screen .btn { background: linear-gradient(135deg, #dfe0e2 10%, #f6f7f7 90%); outline: none; border-radius: 8px; padding: .8rem 4rem; color: #2396ef; display: inline-block; border: 1px solid transparent; letter-spacing: 2px; cursor: pointer; font-size: 18px; } .screen .btn.play { margin-top: 1rem; }
到此这篇关于HTML5+CSS+JavaScript实现捉虫小游戏设计和实现的文章就介绍到这了,更多相关html5 js捉虫小游戏内容请搜索潘少俊衡以前的文章或继续浏览下面的相关文章,希望大家以后多多支持潘少俊衡!
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。
本文地址:/web/html5/76614.html