javascript - 试图创建一个基本的跳跃恐龙游戏
问题描述
我使用 p5.js 作为在线编辑器,我收到语法错误,我不确定为什么,这对所有这一切都很新,我很确定我把整个事情都写了回来,只是在寻找支持或提示。
.game {
width: 600px;
height: 200px;
border: 1px solid black;
margin: auto;
}
.dino {
width: 50px;
height: 50px;
background-image: url(img/trex.png);
background-size: 50px 50px;
position: relative;
top: 150px;
}
.jump {
animation: jump 0.3s linear;
}
@keyframes jump {
0% {
top: 150px;
}
30% {
top: 130px;
}
50% {
top: 80px;
}
80% {
top: 130px;
}
100% {
top: 150px;
}
}
#cactus {
width: 20px;
height: 40px;
position: relative;
top: 110px;
left: 580px;
background-image: url("img/cactus.png");
background-size: 20px 40px;
animation: block 1s infinite linear;
}
@keyframes block {
0% {
left: 580px;
}
100% {
left: -20px;
}
}
我使用 p5.js 作为在线编辑器,我收到语法错误,我不确定为什么,这对所有这一切都很新,我很确定我把整个事情都写了回来,只是在寻找支持或提示。
解决方案
推荐阅读
- image - 如何在控制图像宽度的同时让图像扩展并在 Flutter 中为其赋予边框半径
- azure-data-factory - 从 azure 获取活动数据
- python - 我正在使用 Wİndows 10 并在 PyCharm 中安装 PyAudio 时出错
- node.js - 如何在 package.json 中使用 npm 之类的代理参数在生产模式下使用代理?
- sql - 一个查询为多个值返回多行且有限制
- reactjs - 如何将 react-dropzone 与 react-hook-form 一起使用?
- cookies - Chromium 如何存储 cookie(过期)时间?
- c# - AutoMapper 展平
- html - 移动设备的媒体查询在不同的移动设备中显示不同的对齐方式
- java - 如何获得有关客户端与 Spring SseEmitter 断开连接的通知?