原生js实现祖玛青蛙吐珠子游戏代码
代码语言:html
所属分类:游戏
代码描述:原生js实现祖玛青蛙吐珠子游戏代码,游戏的主角是一只石青蛙,石青蛙会吐出各种颜色的珠子,珠子造型美丽,色彩鲜艳,环绕着石青蛙的是承载珠子的轨道,各种颜色的珠子沿着轨道往前滑动,石青蛙必需遏止珠子滚进轨道终点的洞穴。石青蛙吐出的珠子与轨道上的珠子相结合,颜色相同即可消失得分,当轨道上的所有珠子被消除干净时即取得游戏的胜利。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
font-family: inherit;
box-sizing: border-box;
}
*[hidden] {
display: none;
}
body {
line-height: 1;
}
menu,
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: "";
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html,
body {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background-image: radial-gradient(circle at center, #002129, #000);
overflow: hidden;
font-family: "Josefin Sans", sans-serif;
}
.container {
position: relative;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/bg.svg");
}
.container::before {
content: "";
display: block;
width: 1287.709px;
height: 1004.262px;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/bg-leaf.svg");
position: absolute;
top: -55px;
left: -80px;
}
.container .leaf {
position: absolute;
z-index: 10;
}
.container .leaf-01 {
width: 290.296px;
height: 197.981px;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/bg-leaf.svg");
transform-origin: top left;
top: -10px;
left: -50px;
animation: leaf 8s -2s infinite;
}
.container .leaf-02 {
width: 130.828px;
height: 131.056px;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/bg-leaf.svg");
transform-origin: top right;
top: -60px;
right: 325px;
animation: leaf 10s -3s infinite;
}
.container .leaf-03 {
width: 214.618px;
height: 225.252px;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/bg-leaf.svg");
transform-origin: top right;
top: 60px;
right: -60px;
animation: leaf 5s -2s infinite;
}
.container .leaf-04 {
width: 303.2px;
height: 356.908px;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/leaf-04.svg");
transform-origin: bottom left;
bottom: -60px;
left: 0px;
animation: leaf 7s -1s infinite;
}
.container .leaf-05 {
width: 253.153px;
height: 292.861px;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/leaf-05.svg");
transform-origin: bottom right;
bottom: -110px;
right: 660px;
animation: leaf 9s -3s infinite;
}
.container .leaf-06 {
width: 269.787px;
height: 346.454px;
background-image: url("//repo.bfw.wiki/bfwrepo/svg/zuma/leaf-06.svg");
transform-origin: bottom right;
bottom: -75px;
right: -40px;
animation: leaf 15s -5s infinite;
}
.container svg {
opacity: 0;
pointer-events: none;
}
.container .player {
width: 175px;
height: 175px;
position: absolute;
top: 0;
left: 0;
z-index: 11;
}
.container .player::before {
conte.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0