Compare commits
3 Commits
1e6a90750d
...
24e07ff3bc
Author | SHA1 | Date |
---|---|---|
Alexander Popov | 24e07ff3bc | |
Alexander Popov | 47ccf1f3b5 | |
Alexander Popov | 3e036598a2 |
|
@ -0,0 +1,21 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{*.html,*.css,*.json}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.js]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
|
@ -0,0 +1 @@
|
|||
dist/
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
Copyright (c) 2022 Alexander Popov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "webpack serve",
|
||||
"build": "webpack"
|
||||
},
|
||||
"dependencies": {
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webpack-dev-server": "^4.9.3"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>test</title>
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="canvas">
|
||||
<canvas id="game" width="400" height="620">
|
||||
<!-- ... -->
|
||||
</canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="game.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
@font-face {
|
||||
font-family: 'Monogram';
|
||||
src: url('/assets/monogram-extended.ttf') format('truetype');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.canvas {
|
||||
text-align: center;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
canvas#game {
|
||||
border: 2px solid #5d5d5d;
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"debug": true
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
// engine config file
|
||||
import config from './config.json';
|
||||
|
||||
const DEBUG = config.debug;
|
||||
let canvas = null;
|
||||
let context = null;
|
||||
let cW = null;
|
||||
let cH = null;
|
||||
|
||||
window.onload = function() {
|
||||
canvas = document.getElementById('game');
|
||||
context = canvas.getContext('2d');
|
||||
cW = canvas.width;
|
||||
cH = canvas.height;
|
||||
|
||||
// print canvas size
|
||||
if (DEBUG) console.log(`Canvas size ${cW} x ${cH}`);
|
||||
|
||||
window.requestAnimationFrame(gameLoop);
|
||||
}
|
||||
|
||||
function gameLoop(timeStamp) {
|
||||
update();
|
||||
draw();
|
||||
|
||||
window.requestAnimationFrame(gameLoop);
|
||||
}
|
||||
|
||||
function update() {
|
||||
//
|
||||
}
|
||||
|
||||
function draw() {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: './src/index.js',
|
||||
output: {
|
||||
filename: 'game.js',
|
||||
path: path.resolve(__dirname, 'public'),
|
||||
},
|
||||
devServer: {
|
||||
static: path.join(__dirname, 'public'),
|
||||
compress: false,
|
||||
port: 55555,
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue