当前位置:网站首页>Web game engine
Web game engine
2022-07-04 17:15:00 【The fifth brother of the Wang family】
Web game engine - Partially Prepared Products
Sample code :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div style="width: 500px;height: 400px;border: solid 1px;">
<div id="kuaiBut" style="width:20px;height:20px;background-color:green;">
</div>
</div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
var sunDun = 10;
setInterval(function() {
sunDun++;
console.log(sunDun);
moveFun('kuaiBut', 'left', 'top', sunDun);
if (sunDun >= 600) {
sunDun = 0;
}
}, 20)
})
/**
* @param {Object} x Axis
* @param {Object} y Axis
* @param {Object} lengt
*/
function moveFun(id, x, y, lengt) {
let pdWidth = $("#" + id).parent().width();
let pdheight = $("#" + id).parent().height();
console.log(pdWidth + ' - ' + pdheight);
if (y == '' || y == null || y == undefined) {
$("#" + id).css(x, lengt + 'px');
} else {
$("#" + id).css(x, lengt + 'px');
$("#" + id).css(y, lengt + 'px');
}
$("#" + id).css('position', 'absolute');
}
</script>
</html>
边栏推荐
- DataKit——真正的统一可观测性 Agent
- 安信证券手机版下载 网上开户安全吗
- VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
- ~88 running people practice
- C# 实现 FFT 正反变换 和 频域滤波
- Detailed process of DC-2 range construction and penetration practice (DC range Series)
- Configuration instance of Oracle listener server and client
- Transformer中position encoding实践
- 如何为ONgDB核心项目源码做贡献
- 整理混乱的头文件,我用include what you use
猜你喜欢
C# 更加优质的操作MongoDB数据库
C# 服务器日志模块
PingCode 性能测试之负载测试实践
2022年国内云管平台厂商哪家好?为什么?
Visual Studio 2019 (LocalDB)MSSQLLocalDB SQL Server 2014 数据库版本为852无法打开,此服务器支持782
It's too convenient. You can complete the code release and approval by nailing it!
go-micro教程 — 第二章 go-micro v3 使用Gin、Etcd
对人胜率84%,DeepMind AI首次在西洋陆军棋中达到人类专家水平
【Go ~ 0到1 】 第六天 文件的读写与创建
Visual studio 2019 (localdb) mssqllocaldb SQL Server 2014 database version is 852 and cannot be opened. This server supports 782
随机推荐
[glide] cache implementation - memory and disk cache
Which domestic cloud management platform manufacturer is good in 2022? Why?
昆明三环闭合工程将经过这些地方,有在你家附近的吗?
PingCode 性能测试之负载测试实践
基于check-point机制的任务状态回滚和数据分块任务
Why do you say that the maximum single table of MySQL database is 20million? Based on what?
Principle and general steps of SQL injection
Solution of dealer collaboration system in building materials industry: empowering enterprises to build core competitiveness
2022年国内云管平台厂商哪家好?为什么?
Solution du système de gestion de la chaîne d'approvisionnement du parc logistique intelligent
智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
The winning rate against people is 84%, and deepmind AI has reached the level of human experts in army chess for the first time
World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection
Maximum subarray and matrix multiplication
Unity interview questions (continuously updated)
Integration of ongdb graph database and spark
散列表
Smart Logistics Park supply chain management system solution: digital intelligent supply chain enables a new supply chain model for the logistics transportation industry
~88 running people practice
Understand ThreadLocal in one picture