Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cwebfps

Currently it's just

Basic FPS game attempt for the web with raylib

Contents

  1. Cloning
  2. Building (Web)
  3. Hosting online

Cloning

git clone --recurse-submodules --shallow-submodules https://github.com/plu5/cwebfps.git

Building (Web)

  1. Install emscripten if you don't have it already. emcc and emar need to be in PATH.
  2. Build raylib:
    cd raylib/src
    emcc -c rcore.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
    emcc -c rshapes.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
    emcc -c rtextures.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
    emcc -c rtext.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
    emcc -c rmodels.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
    emcc -c raudio.c -Os -Wall -DPLATFORM_WEB
    emar rcs libraylib.a rcore.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o
  3. Build the game:
    cd ../..
    make -C cwebfps
  4. Host the game:
    cd cwebfps
    python -m http.server
  5. It will be on http://127.0.0.1:8000/ on the same machine, or localip:8000 on other machines in the local network, where localip is the local ip of the device you're hosting on (ip address on Arch, and on other operating systems ifconfig or ipconfig).

Hosting online

After building, upload the files index.html, index.js, index.wasm, index.data

About

raylib web fps attempt

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages