基于Jquery编写并实现apk安卓系统安装文件

Jquery是一个适配性很强的程序,相比于andriod系统语言,更容易上手,而且通过java形式完全可以转化成apk文件,实现软件安装,这种网络教程很多,感兴趣的朋友可以自行搜索。

本文是一个通过Jquery实现的贪吃蛇小游戏,并且已成功在安卓手机上安装,具体界面如下:

实现代码如下:

<!DOCTYPE html>
<html>
	<head>
	<meta http-equip="Content_Type" content="text/html;charset=utf-8"/>
	<title>贪吃蛇</title>
	<meta name="viewport" content="width=device-width,shrink-to-fit=no">
	<link rel="stylesheet" href="index.css"/>

	</head>
	<body>
			<div class="background">
				<p class="score">您的成绩:<span>0</span></p>
				<div class="snake start"></div>
			</div>
			<div class="begin">
				<ul>
					<li><input type="button" id="btn_begin" value="开始"/></li>
					<li><input type="button" id="btn_exit" value="退出"/></li>
				</ul>
			</div>
			
			<div class="GameOver">
			        <h1>GAME OVER</h1>
			    </div>
			<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
			<script type="text/javascript" src="index.js"></script>
				</body>
			</html>

 

*{
	margin: 0px;
	padding: 0px;
	list-style: none;
}
body{
	position: relative;
}
.background{
	position: relative;
	top: 50px;
	z-index: -1;
	margin: 20px auto;
	width: 1000px;
	height: 600px;
	border: solid 2px ;
	background-color: bisque;
}
.snake{
	display: inline-block;
	border: solid 1px;
	width: 20px;
	height: 20px;
	background-color: saddlebrown;
	border-radius: 40%;
	position: absolute;
	z-index: 10px;
}
.start{
	top:300px;
	left: 100px;
}

.snake_boby{
	display: inline-block;
	border: solid 1px;
	width: 20px;
	height: 20px;
	background-color: yellowgreen;
	position: absolute;
	border-radius: 40%;
	z-index: 10px;
}
.food{
	display: inline-block;
	border: solid 0.5px;
	width: 20px;
	height: 20px;
	background-color:red;
	border-radius:50%;
	position: absolute;
	z-index: 10px;
}

.score{
	position: absolute;
	font-size: 20px;
	top: -30px;
	left: 0px;
}

.begin {
		position: absolute;
		top: 300px;
		left:650px;
		transform: translateX(-50%);
		border: solid 1px;
		background-size: 300px ;
		width: 150px;
		height: 100px;
}

.begin ul li input{
	width: 150px;
	height: 50px;
	line-height: 30px;
	border: none;
	background-color: #7dbb32;
	cursor: pointer;
	border-radius: .3em;
    box-shadow: 0 1px white inset;
    text-align: center;
    text-shadow: 0 1px 1px black;
    color:white;
    font-weight: bold;
    outline: none;
}

.GameOver{
	display: none;
}


.GameOver h1{
	text-align: center;
	margin-top: -380px;
	margin-left: 380px;
	color:red;
	font-size: 38px;
	font-weight: bold;
	text-shadow: 2px 2px 0 white;
    position: absolute;
    
}

 如果各位对源代码感兴趣,可以到我的主页下载,文件里也有apk文件,无广告,无病毒,也可以自己安装试试。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

疯狂的豆包

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值