Skip to content

ENAML/flappy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Play on web: https://enaml.github.io/flappy/

Info

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.

TODO

Main

  • 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

Web Compile

  • 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

Nice-to-have

Build Instructions

  • 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

Building for Web (TODO: deprecated)

Instructions

    1. Download and install emscripten (http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html)
    1. run source ./emsdk_env.sh from emsdk/ directory to set environment variables
    • ex: source ~/Projects/tests/emsdk/emsdk_env.sh
    1. 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)
    1. within our own Makefile, set correct paths for EMSCRIPTEN_PATH (to emsdk/ emscripten director) and RAYLIB_PATH (to raylib director)
    1. run make web
    1. if successful, .html / .js / .data files should be in bin/