欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

html 实现经典赛车游戏-2.效果和源代码

最编程 2024-04-03 21:45:12
...

2.1 动态效果

html实现经典赛车小游戏

2.2 源代码

这里是主界面的代码,其他图片、js、css等代码,见下面的 源码下载 ,里面有所有代码资源和相关说明。

<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width" /> 
	<title>经典赛车小游戏 - xcLeigh</title>
	<link rel="icon" type="image/png" href="images/favicon.ico" /> 
	<link rel="stylesheet" type="text/css" href="css/normalize.css" />
	<link rel="stylesheet" href="css/style.css">
</head>
<body oncontextmenu="return false;" onselectstart="return false;" unselectable="on" ondragstart="return false;">
	<canvas height="450" width="750"></canvas>

	<!-- 四个角链接,底部说明 -->
	<div style="position:absolute;left:0;top:0; width:80px;height:80px;">
		<div  style="position:absolute;left:0;bottom:0; width:80px;height:80px;text-align:center;line-height:80px;color:#0F85F4;z-index:999;">
		<a href="https://blog.****.net/weixin_43151418/article/details/127635252" title="html实现飞机小游戏(源码)" target="_blank" style="text-decoration:none; font-weight:bold">打飞机</a>
		</div>
		  <div class='classScale' style='display:flex; justify-content: center; align-items: center; width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
		  <div class='classScale1' style='position:relative; top: -80px;width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
	  </div>
	  <div style="position:absolute;right:0;top:0; width:80px;height:80px;">
		<div  style="position:absolute;left:0;bottom:0; width:80px;height:80px;text-align:center;line-height:80px;color:#0BABC4;z-index:999;">
			<a href="https://blog.****.net/weixin_43151418/article/details/127631871" title="html实现贪吃蛇游戏(源码)" target="_blank" style="text-decoration:none; font-weight:bold">贪吃蛇</a>
		</div>
		  <div class='classScale' style='display:flex; justify-content: center; align-items: center; width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
		  <div class='classScale1' style='position:relative; top: -80px;width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
	  </div>
	  <div style="position:absolute;right:0;bottom:0; width:80px;height:80px;">
		<div  style="position:absolute;left:0;bottom:0; width:80px;height:80px;text-align:center;line-height:80px;color:red;z-index:999;">
			<a href="https://blog.****.net/weixin_43151418/article/details/127619801" title="html制作好看的五子棋(源码)" target="_blank" style="text-decoration:none; font-weight:bold">五子棋</a>
		</div>
		  <div class='classScale' style='display:flex; justify-content: center; align-items: center; width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
		  <div class='classScale1' style='position:relative; top: -80px;width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
	  </div>
	  <div style="position:absolute;left:0;bottom:0; width:80px;height:80px;">
		<div  style="position:absolute;left:0;bottom:0; width:80px;height:80px;text-align:center;line-height:80px;color:orange;z-index:999;">
			<a href="https://blog.****.net/weixin_43151418/article/details/127886480" title="html实现扫雷小游戏(附源码)" target="_blank" style="text-decoration:none; font-weight:bold;">扫雷</a>
		</div>
		  <div class='classScale' style='display:flex; justify-content: center; align-items: center; width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
		  <div class='classScale1' style='position:relative; top: -80px;width:80px;height:80px;border-radius:50%; opacity: 0.5;'>
		  </div>
	  </div>
	  <div  style="position:absolute;left:0;bottom:0; width:100%;height:70px; line-height:30px; text-align:center; z-index:99;">
		<div style="color:white;">控制键盘的 <span style="font-weight: bold; color: orange;">↑ ← ↓ →</span> 来行驶车子</div>
	  	<a href="https://blog.****.net/weixin_43151418" target="_blank" style="text-decoration:none; font-weight:bold;color:white;">xcLeigh | 星空系列 | 经典赛车小游戏</a>
	  </div>

	<script type="text/javascript" src="js/main.js"></script>
</body>
</html>