本文主要是介绍用html写游戏,用HTML写的整人小游戏(一)之 奔跑的no,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
这个小游戏是无意间看到的,觉得很有意思,所以拿出来和大家一起分享lei
基本界面就是下面的,以后希望能做更多的出来分享!谢谢你们、
#a{
width: 500px;
height: 200px;
position: absolute;
left: 500px;
top: 200px;
padding-top: 100px;
background-color: pink;
border: 1px black solid ;
text-align: center;
}
#no{
position: absolute;
left: 100px;
top: 100px;
}
function a(){
var no = document.getElementById("no");
no.style.left = Math.floor(Math.random()*450)+"px";
no.style.top = Math.floor(Math.random()*280)+"px";
}
function b(){
alert("得到你了!哈哈")
}
DO you wang to marry with me?
yes
no
这篇关于用html写游戏,用HTML写的整人小游戏(一)之 奔跑的no的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!