当前位置:网站首页>网页游戏引擎
网页游戏引擎
2022-07-04 15:18:00 【王家五哥】
网页游戏引擎-半成品
示例代码:
<!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 轴
* @param {Object} y 轴
* @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>
边栏推荐
- ECCV 2022 released: 1629 papers were selected, and the employment rate was less than 20%
- Can you really use MySQL explain?
- Market trend report, technical innovation and market forecast of electrochromic glass and devices in China and Indonesia
- 最大子数组与矩阵乘法
- 智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
- Hair growth shampoo industry Research Report - market status analysis and development prospect forecast
- 周大福践行「百周年承诺」,真诚服务推动绿色环保
- Visual studio 2019 (localdb) mssqllocaldb SQL Server 2014 database version is 852 and cannot be opened. This server supports 782
- Lv166 turned over
- NoSQL之readis配置与优化(终章)
猜你喜欢
新的职业已经出现,怎么能够停滞不前 ,人社部公布建筑新职业
VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
建筑建材行业经销商协同系统解决方案:赋能企业构建核心竞争力
NoSQL之readis配置与优化(终章)
被PMP考试“折磨”出来的考试心得,值得你一览
《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
GO开发:如何利用Go单例模式保障流媒体高并发的安全性?
51 single chip microcomputer temperature alarm based on WiFi control
"Cannot initialize Photoshop because the temporary storage disk is full" graphic solution
Analysis of abnormal frequency of minor GC in container environment
随机推荐
Years of training, towards Kata 3.0! Enter the safe container experience out of the box | dragon lizard Technology
Research Report on market supply and demand and strategy of tetramethylpyrazine industry in China
GO开发:如何利用Go单例模式保障流媒体高并发的安全性?
China Indonesia adhesive market trend report, technological innovation and market forecast
. Net applications consider x64 generation
2022PMP考试基本情况详情了解
中信证券网上开户安全吗 开户收费吗
Object.keys()的用法
L1-072 scratch lottery
China's roof ladder market trend report, technological innovation and market forecast
China's plastic processing machinery market trend report, technological innovation and market forecast
Spark 中的 Rebalance 操作以及与Repartition操作的区别
ECCV 2022 released: 1629 papers were selected, and the employment rate was less than 20%
PyTorch深度学习快速入门教程
Transformer中position encoding实践
Research Report on surgical otorhinolaryngology equipment industry - market status analysis and development prospect prediction
.Net 应用考虑x64生成
【云原生】服务网格是什么“格”?
C# 实现 FFT 正反变换 和 频域滤波
Implement graph data construction task based on check point