three实现摄像头捕获头部运动穿过洋娃娃到达终点的鱿鱼游戏
代码语言:html
所属分类:游戏
代码描述:three实现一个红灯绿灯鱿鱼游戏,通过摄像头捕获你的头部运动,当玩偶不在看你的时候,移动你的头向前移动,使左上角的计数器达到100米。但是当洋娃娃看着你的时候,注意不要移动。如果移动传感器达到右下角的100%,您将失败。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<style>
@font-face {
font-family: "Digital";
src: url("//repo.bfw.wiki/bfwrepo/images/squidgame/digital-7+%28mono%29.ttf") format("truetype");
}
.timer {
font-family: Digital, monospace;
font-size: min(max(14px, 7vw), 46px);
color: #d7213c;
border: 5px outset #8b8b8b;
background: black;
text-align: center;
padding: 0 20px;
position: absolute;
bottom: 1.5vw;
left: 1.5vw;
}
.distance {
font-family: Digital, monospace;
font-size: min(max(14px, 7vw), 46px);
color: #d7213c;
border: 5px outset #8b8b8b;
background: black;
text-align: center;
padding: 0 20px;
position: absolute;
top: 1.5vw;
left: 1.5vw;
}
.movement {
font-family: Digital, monospace;
font-size: min(max(14px, 7vw), 46px);
color: #d7213c;
border: 5px outset #8b8b8b;
background: black;
text-align: center;
padding: 0 20px;
position: absolute;
bottom: 1.5vw;
right: 1.5vw;
}
.container {
height: 100vh;
display: grid;
place-items: center;
background: linear-gradient(#58abc2 50%, #d7327a 50%);
filter: brightness(0.7);
transition: 0.4s ease-out;
}
.container.is-playing {
filter: brightness(1);
}
.info {
font-size: 30px;
position: fixed;
top: 0;
left: 0;
padding: 10px;
background: white;
z-index: 19;
}
body {
margin: 0;
}
.game {
background: url(//repo.bfw.wiki/bfwrepo/images/squidgame/Squid_Game_Doll_bg.jpg);
background-size: cover;
background-position: center;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0