Merge pull request #4 from kevinbchen/main

Emscripten build
This commit is contained in:
Noel Berry authored and GitHub committed 2021-01-05 20:46:17 -08:00
commit 14123e5b5e
2 files changed
+7

No files matched your search

+5
View File
@@ -44,6 +44,11 @@ add_executable(game
# Reference blah
target_link_libraries(game blah)
if( ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
set_target_properties(game PROPERTIES LINK_FLAGS "-s USE_SDL=2 -s USE_WEBGL2=1 --preload-file ${CMAKE_SOURCE_DIR}/content@/content")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
endif()
# copy SDL2 to the build directory
set(SDL2_DLL "" CACHE FILEPATH "SDL2 DLL Path")
if (SDL2_ENABLED)
+2
View File
@@ -28,6 +28,7 @@ bool Mover::move_x(int amount)
{
entity()->position.x += amount;
}
return false;
}
bool Mover::move_y(int amount)
@@ -64,6 +65,7 @@ bool Mover::move_y(int amount)
{
entity()->position.y += amount;
}
return false;
}
void Mover::stop_x()