Init commit
This commit is contained in:
commit
0c5ad88981
8 changed files with 62 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.cache/
|
||||
dist/
|
16
index.html
Normal file
16
index.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<script src="js/index.mjs"></script>
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container">
|
||||
<canvas id="main"></canvas>
|
||||
<canvas id="temp"></canvas>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
16
js/game.mjs
Normal file
16
js/game.mjs
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
|
||||
const game = {
|
||||
state: {
|
||||
room: 'menu',
|
||||
paused: false
|
||||
}
|
||||
};
|
||||
|
||||
export function init() {
|
||||
game.state.room = 'menu';
|
||||
}
|
||||
|
||||
function tick() {
|
||||
requestAnimationFrame(tick);
|
||||
}
|
0
js/graphics/background.mjs
Normal file
0
js/graphics/background.mjs
Normal file
0
js/graphics/gui.mjs
Normal file
0
js/graphics/gui.mjs
Normal file
0
js/graphics/index.mjs
Normal file
0
js/graphics/index.mjs
Normal file
3
js/index.mjs
Normal file
3
js/index.mjs
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { init } from './game.mjs';
|
||||
|
||||
window.addEventListener('load', init);
|
25
styles.css
Normal file
25
styles.css
Normal file
|
@ -0,0 +1,25 @@
|
|||
body {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
#container {
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#main {
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
margin: 50px auto;
|
||||
border: 2px solid #111;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#temp {
|
||||
display: none;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue