diff options
author | davidovski <david@sendula.com> | 2021-07-18 00:48:40 +0100 |
---|---|---|
committer | davidovski <david@sendula.com> | 2021-07-18 00:48:40 +0100 |
commit | 0a9f2cc7555cf991945c5c28b71f6004d3fba42f (patch) | |
tree | 3b2c1b4dd268f305302f4b60b535ba96fbb3b41e | |
parent | 8264a0eb115215a4d4962d6ba90ee3adcdf7a31e (diff) |
reset on menu
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/main.c | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ab8df..9579f4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,14 +28,14 @@ set(ASSETS_cg fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA) -add_executable(breakout ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}}) -target_compile_options(breakout PRIVATE -Wall -Wextra -Os) -target_link_libraries(breakout Gint::Gint) +add_executable(pong ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}}) +target_compile_options(pong PRIVATE -Wall -Wextra -Os) +target_link_libraries(pong Gint::Gint) if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G) - generate_g1a(TARGET breakout OUTPUT "pong.g1a" + generate_g1a(TARGET pong OUTPUT "pong.g1a" NAME "pong" ICON assets-fx/icon.png) elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) - generate_g3a(TARGET breakout OUTPUT "pong.g3a" + generate_g3a(TARGET pong OUTPUT "pong.g3a" NAME "pong" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) endif() @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. +#include <gint/gint.h> #include <gint/display.h> #include <gint/keyboard.h> #include <gint/keycodes.h> @@ -39,6 +40,8 @@ int h = 16; int w = 2; int main(void) { + gint_setrestart(1); + int tick = 1; bool game = true; while (game) { @@ -55,7 +58,7 @@ int main(void) pollevent(); if (keydown(KEY_EXIT)) - game = false; + gint_osmenu(); if (keydown(KEY_1) && p1 + h < 64) p1 += 1; @@ -113,6 +116,7 @@ int main(void) tick++; sleep_us(20*1000); } - game = true; + + return 0; } |