Fixed and improved android template
- Added gestures module functions. - Fixed screen tap detection.
This commit is contained in:
parent
6e5ceaa30d
commit
8e30bd1f69
1 changed files with 9 additions and 6 deletions
|
@ -30,8 +30,9 @@ void android_main(struct android_app *app)
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
GameScreen currentScreen = LOGO;
|
GameScreen currentScreen = LOGO;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, app);
|
InitWindow(screenWidth, screenHeight, app);
|
||||||
|
InitGesturesSystem(app);
|
||||||
|
|
||||||
// TODO: Initialize all required variables and load all required data here!
|
// TODO: Initialize all required variables and load all required data here!
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@ void android_main(struct android_app *app)
|
||||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
switch(currentScreen)
|
switch(currentScreen)
|
||||||
{
|
{
|
||||||
case LOGO:
|
case LOGO:
|
||||||
|
@ -70,7 +71,7 @@ void android_main(struct android_app *app)
|
||||||
// TODO: Update TITLE screen variables here!
|
// TODO: Update TITLE screen variables here!
|
||||||
|
|
||||||
// Press enter to change to GAMEPLAY screen
|
// Press enter to change to GAMEPLAY screen
|
||||||
if (IsGestureDetected())
|
if (GetGestureType() == GESTURE_TAP)
|
||||||
{
|
{
|
||||||
PlaySound(fx);
|
PlaySound(fx);
|
||||||
currentScreen = GAMEPLAY;
|
currentScreen = GAMEPLAY;
|
||||||
|
@ -81,8 +82,8 @@ void android_main(struct android_app *app)
|
||||||
// TODO: Update GAMEPLAY screen variables here!
|
// TODO: Update GAMEPLAY screen variables here!
|
||||||
|
|
||||||
// Press enter to change to ENDING screen
|
// Press enter to change to ENDING screen
|
||||||
if (IsGestureDetected())
|
if (GetGestureType() == GESTURE_TAP)
|
||||||
{
|
{
|
||||||
PlaySound(fx);
|
PlaySound(fx);
|
||||||
currentScreen = ENDING;
|
currentScreen = ENDING;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +93,7 @@ void android_main(struct android_app *app)
|
||||||
// TODO: Update ENDING screen variables here!
|
// TODO: Update ENDING screen variables here!
|
||||||
|
|
||||||
// Press enter to return to TITLE screen
|
// Press enter to return to TITLE screen
|
||||||
if (IsGestureDetected())
|
if (GetGestureType() == GESTURE_TAP)
|
||||||
{
|
{
|
||||||
PlaySound(fx);
|
PlaySound(fx);
|
||||||
currentScreen = TITLE;
|
currentScreen = TITLE;
|
||||||
|
@ -100,6 +101,8 @@ void android_main(struct android_app *app)
|
||||||
} break;
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateGestures();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue