drawing now seperate from gameLoop

+ refactoring
+ added soundMutedFlag
This commit is contained in:
LuckyLaszlo
2022-11-24 13:56:51 +01:00
parent 7d5895a6cc
commit 3474d54a2b
22 changed files with 105 additions and 106 deletions

View File

@@ -4,17 +4,16 @@ import url from "url";
import fs from "fs";
import path from "path";
import {wsServer} from "./wsServer.js"; wsServer; // no-op
import {wsServer} from "./wsServer.js"; wsServer; // no-op, just for loading
const hostname = "localhost";
const port = 8080;
const root = "../../www/";
const server = http.createServer((req, res) => {
// var q = new URL(req.url, `http://${req.getHeaders().host}`)
// @ts-ignore
var q = url.parse(req.url, true);
var filename = root + q.pathname;
// let q = new URL(req.url, `http://${req.getHeaders().host}`)
let q = url.parse(req.url, true);
let filename = root + q.pathname;
fs.readFile(filename, (err, data) => {
if (err) {
res.writeHead(404, {"Content-Type": "text/html"});