Build Your Own Platformer Game: HTML Code Tutorial
<html>
<head>
<title>Platformer Game</title>
<style>
body {
background-color: black;
}
<pre><code>#game-area {
width: 500px;
height: 500px;
margin: 0 auto;
}
#player {
width: 50px;
height: 50px;
background-color: red;
position: absolute;
}
#ground {
width: 500px;
height: 100px;
background-color: green;
position: absolute;
bottom: 0px;
}
</code></pre>
</style>
</head>
<body>
<div id='game-area'>
<div id='player'></div>
<div id='ground'></div>
</div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/lnRJ 著作权归作者所有。请勿转载和采集!