Merge pull request #4 from kevinbchen/main

Emscripten build
This commit is contained in:
Noel Berry 2021-01-05 20:46:17 -08:00 committed by GitHub
commit 14123e5b5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

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)

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()