Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
458 changes: 444 additions & 14 deletions fpsmeter.min.js
100755 → 100644

Large diffs are not rendered by default.

190 changes: 156 additions & 34 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,165 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Javascript Platformer</title>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Javascript Platformer</title>

<style>
body { background: #111; }
#platformer { margin: 1em auto; position: relative; width: 512px; height: 384px; }
#canvas { display: inline-block; width: 100%; height: 100%; }
#instructions { font-style: italic; color: #999; font-size: 9pt; margin-left: 1em; margin-top: 0.5em; }
#instructions b { color: #DDD; }
@media screen and (min-width: 0px) and (min-height: 0px) { #platformer { width: 512px; height: 384px; font-size: 7pt; } } /* block = 16 */
@media screen and (min-width: 840px) and (min-height: 530px) { #platformer { width: 640px; height: 480px; font-size: 9pt; } } /* block = 20 */
@media screen and (min-width: 968px) and (min-height: 626px) { #platformer { width: 768px; height: 576px; font-size: 11pt; } } /* block = 24 */
@media screen and (min-width: 1096px) and (min-height: 722px) { #platformer { width: 896px; height: 672px; font-size: 13pt; } } /* block = 28 */
@media screen and (min-width: 1224px) and (min-height: 818px) { #platformer { width: 1024px; height: 768px; font-size: 15pt; } } /* block = 32 */
</style>
<style>
body {
background: #111;
}
h1 {
color: white;
text-align: center;
}
#menu{
margin: 1em auto;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
background-color: aliceblue;
}
#platformer {
margin: 1em auto;
position: relative;
width: 512px;
height: 384px;
}
#screen{
width: 512px;
height: 384px;
}
#canvas {
display: none;
width: 100%;
height: 100%;
}
#display {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background-color: aquamarine;
background-image: url("title_img.png");
background-size: cover;
}
#start{
width: 20%;
height: 10%;
background-color: aliceblue;
border-radius: 50px;
}
#instructions {
font-style: italic;
color: #999;
font-size: 9pt;
margin-left: 1em;
margin-top: 0.5em;
}
#instructions b {
color: #ddd;
}
@media screen and (min-width: 0px) and (min-height: 0px) {
#platformer , #screen{
width: 512px;
height: 384px;
font-size: 7pt;
}
#menu{
width: 512px;
}
#start{
font-size: 7pt;
}
} /* block = 16 */
@media screen and (min-width: 840px) and (min-height: 530px) {
#platformer , #screen{
width: 640px;
height: 480px;
font-size: 9pt;
}
#menu{
width: 640px;
}
#start{
font-size: 9pt;
}
} /* block = 20 */
@media screen and (min-width: 968px) and (min-height: 626px) {
#platformer , #screen{
width: 768px;
height: 576px;
font-size: 11pt;
}
#menu{
width: 768px;
}
#start{
font-size: 11pt;
}
} /* block = 24 */
@media screen and (min-width: 1096px) and (min-height: 722px) {
#platformer , #screen{
width: 896px;
height: 672px;
font-size: 13pt;
}
#menu{
width: 896px;
}
#start{
font-size: 13pt;
}
} /* block = 28 */
@media screen and (min-width: 1224px) and (min-height: 818px) {
#platformer , #screen{
width: 1024px;
height: 768px;
font-size: 15pt;
}
#menu{
width: 1024px;
}
#start{
font-size: 15pt;
}

} /* block = 32 */
</style>
</head>

</head>
<body>
<h1>Tiny Platformer Game</h1>

<body>

<div id="platformer">

<canvas id="canvas">
<div class="unsupported">
Sorry, this example cannot be run because your browser does not support the &lt;canvas&gt; element
<div id="menu">
<button id="restart">Replay</button>
<button id="menuBTN">Menu</button>
</div>
<div id="platformer">
<div id="screen">
<div id="display">
<h1>Tiny Platformer Game</h1>
<button id="start">Start</button>
</div>
<canvas id="canvas">
<div class="unsupported">
Sorry, this example cannot be run because your browser does not
support the &lt;canvas&gt; element
</div>
</canvas>
</div>
<div id="instructions">
<b>LEFT/RIGHT</b> to move, <b>SPACE</b> to jump, collect gold and jump
on monsters.
</div>
</canvas>

<div id="instructions">
<b>LEFT/RIGHT</b> to move, <b>SPACE</b> to jump, collect gold and jump on monsters.
</div>

</div>

<script src="fpsmeter.min.js"></script>
<script src="platformer.js"></script>

</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="fpsmeter.min.js"></script>
<script src="platformer.js"></script>
</body>
</html>
Empty file modified level.tmx
100755 → 100644
Empty file.
0 level.json → level1.json
100755 → 100644
File renamed without changes.
Loading