reset on menu

This commit is contained in:
davidovski 2021-07-18 00:48:40 +01:00
parent 8264a0eb11
commit 0a9f2cc755
2 changed files with 11 additions and 7 deletions

View File

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

View File

@ -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;
}