- Player textures: Marine from DOOM & DOOM II by id Software
- Bullet texture: Enemy Bullets by Wahib Yousaf (link)
- In game font: ZAP by John Zaitseff (link)
- UI style: 98.css by Jordan Scales (@jdan) (link)
- UI font: Microsoft Sans-Serif by Microsoft
- UI icons: Windows 98 Icons by Microsoft
Other projects that helped me:
- grecha.js by Alexey Kutepov (@rexim) (link), the inspiration for
reactive.js - Windows 98 Icon Viewer by Alex Meub (link), a great website for quickly previewing all of Windows 98's icons
- Lode's Computer Graphics Tutorial by Lode Vandevenne (link), a wonderful resource about raycasters and how to make them
See USAGE.md
The project has the following structure:
DockerfileThis file describes the Docker environment necessary to build the client and the server.docker-compose.ymlThis file is a working (and production ready)docker-composefile to quickly setup and host the server.package.jsonNPM project file.scriptsAll the scripts needed to build the project.toolsExtra scripts that are used to generate source files at build-time.
staticContains the files that the HTTP server will serve to the client.cssStylesheet and font files.htmlHTML files.jsJavaScript and WASM files.imgImages used by the UI.
resResources for the WASM game, such as textures and map data.srcAll the source files.clientSource code for the frontend (JavaScript).wasmSource code for the game (C)
serverSource code for the HTTP and game server (TypeScript)
To host the server you will need the Docker installed and configured on your system. The first step is to clone this repository:
git clone https://github.com/markx86/gloom.gitIf you have setup SSH access to GitHub, it is recommended you use that:
git clone git@github.com:markx86/gloom.gitAfter cloning the repository, enter the project root with cd gloom and run:
Note
Before running this command you might want to check out the configuration section.
docker compose up --build -dImportant
If you do not wish to run the server as a daemon, use
docker compose up --buildinstead. Do note that pressing Ctrl+C or closing the terminal
will also close the server.
This will take a while (up to 5 minutes or more, depending on your internet connection).
After the server is up and running you can connect to it locally, by going to http://localhost:8080,
assuming you are using the same machine the server is being hosted on.
If you have any problems, you can check the server logs by using the command:
docker compose logs -fThe server accepts the following environment variables:
LOG_VERBOSE: Enables/Disables verbose logging. Set to1to enable. By default, it's disabled.COOKIE_SECRET: The secret key used to sign the cookies. If it's not set, the server will generate a random one each time it is started.HTTP_PORT: Controls the port on which the HTTP server should listen for incoming requests. By default, it's set to 8080.HTTPS_PORT: Controls the port on which the HTTPS server should listen for incoming requests. By default, it's set to 8443.HTTPS_KEY: Path to the HTTPS server's certificate key. By default, it's./cert.key.HTTPS_CERT: Path to the HTTPS server's certificate. By default, it's./cert.pem.PGHOST: Hostname of the PostgreSQL server.PGPORT: Port of the PostgreSQL server.PGUSER: PostgreSQL user.PGPASSWORD: Password for the PostgreSQL user.
Important
If you're using docker-compose, you can change these options by creating a .env file in the project root,
and writing your values there, in the form PARAM_NAME=param_value. For example COOKIE_SECRET=mySuperSecret1234.