Giter Site home page Giter Site logo

webstorage119 / doom-wasm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudflare/doom-wasm

0.0 0.0 0.0 951 KB

Chocolate Doom WebAssembly port with WebSockets support

Home Page: https://silentspacemarine.com

License: GNU General Public License v2.0

Shell 0.04% C++ 0.05% Python 0.18% C 98.28% Objective-C 0.13% Makefile 0.46% HTML 0.14% CMake 0.50% M4 0.22%

doom-wasm's Introduction

Wasm Doom

This is a Chocolate Doom WebAssembly port with WebSockets support.

Requirements

You need to install Emscripten and a few other tools first:

brew install emscripten
brew install automake
brew install sdl2 sdl2_mixer sdl2_net

Compiling

There are two scripts to facilitate compiling Wasm Doom:

./scripts/clean.sh
./scripts/build.sh

Running

Copy the shareware version of doom1.wad to ./src (make sure it has the name doom1.wad)

Then:

cd src
python -m SimpleHTTPServer

Then open your browser and point it to http://0.0.0.0:8000/

Doom should start (local mode, no network). Check doom-workers if you want to run multiplayer locally.

Inspect src/index.html for startup details.

Check our live multiplayer demo and blog post.

stdout procotol

To show important messages coming from the game while it's running we send the following formatted stdout messages, which can be parsed in the web page running the wasm:

doom: 1, failed to connect to websockets server
doom: 2, connected to %s
doom: 3, we're out of client addresses
doom: 4, ws error(eventType=%d, userData=%d)
doom: 5, ws close(eventType=%d, wasClean=%d, code=%d, reason=%s, userData=%d)
doom: 6, failed to send ws packet, reconnecting
doom: 7, failed to connect to %s
doom: 8, uid is %d
doom: 9, disconnected from server
doom: 10, game started
doom: 11, entering fullscreen
doom: 12, client '%s' timed out and disconnected

License

Chocolate Doom and this port are distributed under the GNU GPL. See the COPYING file for more information.

doom-wasm's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.