Skip to content
ray77Public

About

GORPH-WEB - WebAssembly build of GORPH, the C89/SDL2 shooter in C64 style, as it runs on arcade4ever.net

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GORPH-WEB

WebAssembly build of GORPH - Galactic Organic Robot Phalanx, the native C89/SDL2 shooter in C64 style. Game, controls and features are described in the main repository: ray77/gorph.

This repository contains the browser version as it runs on arcade4ever.net, including the page wrapper and a prebuilt gorph.js / gorph.wasm.

Contents

Path Purpose
src/ Game sources, identical to the desktop version plus web.c
build.sh Emscripten build script
index.html Page wrapper with canvas, boot splash and score hookup
gorph.js Prebuilt Emscripten loader
gorph.wasm Prebuilt game binary (all assets embedded, no data package)

Building

Requires Emscripten (emcc in the path):

./build.sh

The build uses -sASYNCIFY, so the game's fixed 50 Hz main loop including SDL_Delay runs unchanged in the browser.

Running locally

The files must be served over HTTP (browsers refuse to load .wasm from file://):

python3 -m http.server 8000

Then open http://localhost:8000/index.html. The boot splash logo and the score submission point to arcade4ever paths (/assets/img/logo.png, /games/newscore.php); locally the logo is missing and a game over leads to a missing page, the game itself runs normally.

Differences from the desktop version

  • Esc does not quit (a browser tab has nothing to quit to).
  • At game over the final score is passed to the page via window.onGorphGameOver(score) (src/web.c, one hook in src/game.c). Attract-mode runs never report a score.
  • Arrow keys and space are kept from scrolling the parent page, and the canvas takes keyboard focus on click (Safari needs this).

Both source changes are guarded by __EMSCRIPTEN__, so the same src/ still builds natively.

About

GORPH-WEB - WebAssembly build of GORPH, the C89/SDL2 shooter in C64 style, as it runs on arcade4ever.net

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages