当前位置:网站首页>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>
边栏推荐
- 智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
- 高度剩余法
- Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
- 同构图与异构图CYPHER-TASK设计与TASK锁机制
- SQL implements split
- "Cannot initialize Photoshop because the temporary storage disk is full" graphic solution
- 太方便了,钉钉上就可完成代码发布审批啦!
- The test experience "tortured" by the PMP test is worth your review
- egg. JS learning notes
- 《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
猜你喜欢

【Go ~ 0到1 】 第六天 文件的读写与创建

Go micro tutorial - Chapter 2 go micro V3 using gin and etcd
Why do you say that the maximum single table of MySQL database is 20million? Based on what?

Smart Logistics Park supply chain management system solution: digital intelligent supply chain enables a new supply chain model for the logistics transportation industry

51 single chip microcomputer temperature alarm based on WiFi control

VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题

Learn more about the basic situation of 2022pmp examination

建筑建材行业经销商协同系统解决方案:赋能企业构建核心竞争力

ble HCI 流控机制

"Cannot initialize Photoshop because the temporary storage disk is full" graphic solution
随机推荐
[Chongqing Guangdong education] National Open University spring 2019 1248 public sector human resource management reference questions
Solution of commercial supply chain coordination system in the mineral industry: build a digital intelligent supply chain platform to ensure the safe supply of mineral resources
Years of training, towards Kata 3.0! Enter the safe container experience out of the box | dragon lizard Technology
How to implement a delay queue?
【Go ~ 0到1 】 第六天 文件的读写与创建
Rebalance operation in spark and its difference from repartition operation
The test experience "tortured" by the PMP test is worth your review
APOC custom functions and procedures
Spark 中的 Rebalance 操作以及与Repartition操作的区别
NFT流动性市场安全问题频发—NFT交易平台Quixotic被黑事件分析
被PMP考试“折磨”出来的考试心得,值得你一览
中信证券网上开户安全吗 开户收费吗
安信证券手机版下载 网上开户安全吗
将Opencv绘制图片显示在MFC Picture Control控件上
Go micro tutorial - Chapter 2 go micro V3 using gin and etcd
Learn more about the basic situation of 2022pmp examination
Embedded software architecture design - function call
Go development: how to use go singleton mode to ensure the security of high concurrency of streaming media?
c# 实现定义一套中间SQL可以跨库执行的SQL语句
Go语言循环语句(第10课下)