guilhermepo2 / glappy2d

a simple flappy game made with gueepo2D (duh)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gueepo2D Sample Project

Building

  1. Download and install https://cmake.org/ if you don't have it already.
  2. Download the repository git clone --recursive https://github.com/guilhermepo2/gueepo2D-sample.git
  3. Run CMake cmake -Bbuild ., or run it with VSCode or a GUI tool. You can download and manually set SDL2_PATH on CMakeLists.txt on the src/lib/gueepo2D/gueepo2D/engine/ folder, if that's not defined, CMake will download SDL2 2.0.18 automatically.
  4. Open gueepo2D-sample.sln on the build/ folder.

Building with emscripten

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/opt/homebrew/Cellar/emscripten/3.1.32/libexec/cmake/Modules/Platform/Emscripten.cmake -S/Users/gdeoliveira/workspace/glappy2d -B/Users/gdeoliveira/workspace/glappy2d/www 

Important to note that this is needed on CMakeLists.txt

if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
    message("emscripten: source dir: " ${CMAKE_SOURCE_DIR})
    set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-s USE_SDL=2 -s USE_WEBGL2=1 -s EXPORTED_FUNCTIONS=['_main','_malloc'] -s EXPORTED_RUNTIME_METHODS=\"['ccall', 'cwrap']\" --preload-file ../src/assets@assets/")
    # target_link_options(${PROJECT_NAME} PRIVATE -sEXPORTED_FUNCTIONS=['_malloc','_free'])
    set(CMAKE_EXECUTABLE_SUFFIX ".html")
endif()

About

a simple flappy game made with gueepo2D (duh)

License:MIT License


Languages

Language:C++ 88.2%Language:CMake 11.8%