C语言学习教程:超级玛丽游戏开发源码分享
这里推荐一下我建的C/C++语言学习交流秋秋裙,秋秋搜索群名称:小凯C/C++语言学习之家,裙里有不错的学习教程,从入门到项目实战。学习开发用到的开发工具,专业的老师解答学习问题。您在学习过程中有不懂的可以加入一起交流,对你学习C/C++语言会有很大帮助!
超级玛丽游戏开发源码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
*body{margin:0 auto;}
#status{
position: absolute;
left: 50%;
top: 170px;
margin-left: 60px;
}
.background {
background: rgb(52, 166, 251);
table-layout: fixed;
border-spacing: 0;
}
.background td { padding: 0; }
.lava { background: rgb(255, 100, 100); }
.wall { background: white; }
.actor { position: absolute; }
.coin { background: rgb(241, 229, 89); }
.player { background: rgb(64, 64, 64); }
.lost .player { background: rgb(160, 64, 64); }
.won .player {
box-shadow: -4px -7px 8px white, 4px -7px 8px white;
}
.game {
overflow: hidden;
max-width: 600px;
max-height: 450px;
position: relative;
}
</style>
</head>
<body>
<!--<img style="position: absolute;right: 0;top: 0;" src=" http://a4.qpic.cn/psb?/V13id91S0o4nYt/y9R.1dX5WxfYfZzDqBMG2hsjLT7LiZjPoCPYg.6gxhk!/b/dEMBAAAAAAAA&ek=1&kp=1&pt=0&bo=LAGyAQAAAAARF74!&vuin=206105759&tm=1522486800&sce=60-2-2&rf=viewer_4">-->
<div id='status'>How many lives you have left: <span id="lives"></span></div>
<script type="text/javascript">
/*
Based on Dark Blue by Thomas Palef.
Plans are submitted as an array of strings that forms a grid.
@ = Player start position
o = Coins
x = Solid surfaces
! = Non-moving lava
= = Vertical moving lava
v = Dripping lava
| = Horizontal moving lava
*/
var simpleLevelPlan = [
" ",
" ",
" x = x ",
" x o o x ",
" x @ xxxxx x ",
" xxxxx x ",
" x!!!!!!!!!!!!x ",
" xxxxxxxxxxxxxx ",
" "
];
var GAME_LEVELS = [
[" ",
" ",
" ",
" ",
" ",
" ",
" xxx ",
" xx xx xx!xx ",
" o o xx x!!!x ",
" xx!xx ",
" xxxxx xxx ",
" xx ",
" xx o o x ",
" x o x ",
" x xxxxx o x ",
" x xxxx o x ",
" x @ x x xxxxx x ",
" xxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxx ",
" x x x x ",
" x!!!x xooooox ",
" xooox xooooox ",
" xxxxx xxxxxxx ",
" ",
" "],
[" x!!x xxxxxxx x!x ",
" x!!x xxxx xxxx x!x ",
" x!!xxxxxxxxxx xx xx x!x ",
" xx!!!!!!!!!!xx xx xx x!x ",
" xxxxxxxxxx!!x x o o o x!x ",
" xx!x x o o xx!x ",
" x!x x xxxxxxxxxxxxxxx!!x ",
" xvx x x x !!!!!!!!!!!!!!xx ",
" xx | | | xx xxxxxxxxxxxxxxxxxxxxx ",
" xx!!!!!!!!!!!xx v ",
" xxxx!!!!!xxxx ",
" x x xxxxxxx xxx xxx ",
" x x x x x x ",
" x x x x ",
" x x xx x ",
" xx x x x ",
" x x o o x x x x ",
" xxxxxxx xxx xxx x x x x x x ",
" xx xx x x x x xxxxxx x x xxxxxxxxx x ",
" xx xx x o x x xx