https://github.com/pachadotdev/shinydoom
Doom running on Shiny (and shinyapps.io)
https://github.com/pachadotdev/shinydoom
doom rstats shiny webassembly
Last synced: 4 months ago
JSON representation
Doom running on Shiny (and shinyapps.io)
- Host: GitHub
- URL: https://github.com/pachadotdev/shinydoom
- Owner: pachadotdev
- License: apache-2.0
- Created: 2024-05-11T01:08:55.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-11T17:44:14.000Z (about 2 years ago)
- Last Synced: 2025-03-20T20:19:18.131Z (over 1 year ago)
- Topics: doom, rstats, shiny, webassembly
- Language: JavaScript
- Homepage: https://pacha.dev/blog/2024/05/10/
- Size: 4.4 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Doom in Shiny
## About
I wrote a [blog post](https://pacha.dev/blog/2024/05/10) explaining the details and I even included a video.
It is hosted on [shinyapps.io](https://pachamaltese.shinyapps.io/shinydoom/).
Here is how the game looks once it runs on Shiny:

## Build
```bash
apt-get install build-essential libsdl2-dev libsdl2-mixer-dev
git clone --depth 1 git@github.com:emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ..
git clone --depth 1 git@github.com:cloudflare/doom-wasm.git
cd doom-wasm && ./scripts/clean.sh && ./scripts/build.sh && cd ..
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O doom-wasm/src/doom1.wad
```
## Run locally
Source `app.R` from RStudio or VSCode.
## Run on shinyapps.io
Move the following files:
```bash
mkdir doom-compiled
mv doom-wasm/src/index.html doom-compiled/index.html
mv doom-wasm/src/doom1.wad doom-compiled/doom1.wad
mv doom-wasm/src/default.cfg doom-compiled/default.cfg
mv doom-wasm/src/websockets-doom.js doom-compiled/websockets-doom.js
mv doom-wasm/src/websockets-doom.html doom-compiled/websockets-doom.html
mv doom-wasm/src/websockets-doom.wasm doom-compiled/websockets-doom.wasm
mv doom-wasm/src/websockets-doom.wasm.map doom-compiled/websockets-doom.wasm.map
```
Then change the path in `app.R` to `doom-compiled` and deploy.
## Controls
* Space: fire
* E: open door
* up/down/left/right: move
* 1-4: change weapon
* Esc: release mouse/go to menu
* F: full screen
You can also use the mouse to move around.
*If you like what I do as a content creator, you can donate on [Buy Me a Coffee](https://buymeacoffee.com/pacha).*