Play on web: https://enaml.github.io/flappy/
Flappy Bird clone built in C/C++. Currently compiles for Mac OSX (via Clang) and HTML5 / WebAssembly (via Emscripten).
Rendering and input are handled with the very cool, cross-platform Raylib library.
NOTE: This is a WIP and there are likely issues (sorry, I'm relatively new to C/C++). Build instructions and Makefile will probably need to be modified for your platform.
- Upgrade Raylib version to 2.*
- Improve compile process
- Define variables for emscripten stuff
- Define variables for Raylib stuff
- Add better logging
- Add score rendering
- Clean up codebase
- Clean up Makefile emscripten compilation
- Make new index.html
- Figure out how to set canvas size from C++ / makefile config
- Add closure compiler for emscripten
- Add WASM support
- Add title screen
- Add game-over screen
- Add particle fx
- Set up CMake / Premake for project
- Look into moving Vector/Matrix stuff to
GLM
from code inUtility
- main site: https://glm.g-truc.net/0.9.8/index.html
- (docs / examples): https://glm.g-truc.net/0.9.2/api/index.html
- Clone repo & submodules:
git clone --recurse-submodules https://github.com/ENAML/flappy.git
- build raylib (if necessary):
- Build for desktop (OSX)
brew install raylib
make
- Build for web
- If emscriten bytecode needs to be rebuilt
cd extern/raylib/src; make PLATFORM=PLATFORM_WEB
make web
- If emscriten bytecode needs to be rebuilt
-
- Download and install emscripten (http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html)
-
- run
source ./emsdk_env.sh
fromemsdk/
directory to set environment variables
- ex:
source ~/Projects/tests/emsdk/emsdk_env.sh
- run
-
- build RayLib for html5
cd raylib/src
make PLATFORM=PLATFORM_WEB
- NOTE: might need to modify Makefile (I had to remove everything under
#Emscripten required variables
)
-
- within our own Makefile, set correct paths for
EMSCRIPTEN_PATH
(toemsdk/
emscripten director) andRAYLIB_PATH
(toraylib
director)
- within our own Makefile, set correct paths for
-
- run
make web
- run
-
- if successful, .html / .js / .data files should be in
bin/
- if successful, .html / .js / .data files should be in