-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (37 loc) · 1.7 KB
/
index.html
File metadata and controls
37 lines (37 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!--
@author: Alexander Kidd
Created: 12/26/23
Description: This is a port/example of my Android game engine
that has been used for Bit Dreams games. Having it in web/javascript format
will make it much easier to survive API updates and platform ports in the future.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Bit Engine JS</title>
<link rel="icon" type="image/png" sizes="32x32" href="./favicon.ico">
<script type="text/javascript" src="assets.js"></script>
<script type="text/javascript" src="sound.js"></script>
<script type="text/javascript" src="clock.js"></script>
<script type="text/javascript" src="player.js"></script>
<script type="text/javascript" src="game.js"></script>
<script type="text/javascript" src="input.js"></script>
<script type="text/javascript" src="graphics.js"></script>
<script type="text/javascript" src="index.js"></script>
<link rel="stylesheet" href="index.css">
</head>
<body>
<canvas id="gameCanvas" width="800" height="480" autoplay></canvas>
<div class="center">Default controls: WASD to move, click to fire. Or touch for mobile.</div>
<script>
const ENGINE_VERSION = "1.0.0";
const CANVAS = document.getElementById('gameCanvas');
const CANVAS_WIDTH = CANVAS.width;
const CANVAS_HEIGHT = CANVAS.height;
const GAME_TICK_MS = 15; // ~ 1000 ms / 60 fps
const GFX_TICK_MS = 5; // Let graphics refresh almost as fast as possible.
startEngine(GAME_TICK_MS, GFX_TICK_MS, CANVAS.getContext("2d"));
</script>
</body>
</html>