Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/talandar99/raylib_game_template

This is template for running raylib games and building them for web using emscripten
https://github.com/talandar99/raylib_game_template

c emscripten emsdk example game-development raygui raylib raylib-c template wasm web-assembly

Last synced: 28 days ago
JSON representation

This is template for running raylib games and building them for web using emscripten

Awesome Lists containing this project

README

        

* raylib_game_template
This is template for running raylib games and building them for web using emscripten or desktop

** Configuration
edit variables on top of Makefile before running command
#+begin_src bash
# pick platform "WEB" or "DESKTOP"
RAYLIB_SETUP_PLATFORM="DESKTOP"

# set to true or false based on preferences
# RAYGUI raygui is immediate-mode-gui library.
RAYLIB_USE_RAYGUI=true
# RPNG is library to load/save png images and manage png chunks.
RAYLIB_USE_RPNG=false
# raudio is audio library based on miniaudio.
RAYLIB_USE_RAUDIO=false
# rres is file-format to package resources
RAYLIB_USE_RRES=false
# NBNET is library designed to implement client-server architecture
RAYLIB_USE_NBNET=false
#+end_src

** Scripts
#+begin_src bash
make help # Show this help message
make deps # Download necessary dependencies and run setup_raylib_platform
make setup_raylib_platform # Setup raylib for the selected platform
make build # Build the project based on the selected platform
make web_run # Build and run web version with HTTP server
make desktop_run # Build and run desktop version
make clean # Clean the build and dependencies
#+end_src
** Getting dependencies
before building anything remember to get needed libraries
#+begin_src bash
make deps # Download necessary dependencies and run setup_raylib_platform
#+end_src

** Dekstop build
- change RAYLIB_SETUP_PLATFORM to "DESKTOP" in config on top of Makefile
- setup for desktop
#+begin_src bash
make setup_raylib_platform # Setup raylib for the selected platform
#+end_src
- create build
#+begin_src bash
make build # Build the project based on the selected platform
#+end_src
- or just run game
#+begin_src bash
make desktop_run # Build and run desktop version
#+end_src
** Web build
- change RAYLIB_SETUP_PLATFORM to "WEB" in config on top of Makefile
- setup for web
#+begin_src bash
make setup_raylib_platform # Setup raylib for the selected platform
#+end_src
- create web build
#+begin_src bash
make build # Build the project based on the selected platform
#+end_src
- You can start web server with python
#+begin_src bash
make web_run # Build and run web version with HTTP server
#+end_src
- go to this address: http://0.0.0.0:8000/main.html
** Dependancies
- gcc with all libraries (needed to build code)
- make (needed in build)
- git (needed to pull dependancies)
- bash (needed in order to run bash scripts)
- python3 (for running server)
- LINUX based operating system (untested on other)