diff options
| author | Ray <[email protected]> | 2016-02-20 01:09:47 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2016-02-20 01:09:47 +0100 |
| commit | 4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf (patch) | |
| tree | d9ee679c3b0bc5d4a20b31930994deb0e4c37948 /templates/android_project/jni/basic_game.c | |
| parent | f582ab06add085594f2579ee6e7d625212abd204 (diff) | |
| parent | 954ced21a42eb489ad382b4c00406a28778fee41 (diff) | |
| download | raylib-4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf.tar.gz raylib-4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf.zip | |
Merge pull request #83 from raysan5/develop
Develop branch integration
Diffstat (limited to 'templates/android_project/jni/basic_game.c')
| -rw-r--r-- | templates/android_project/jni/basic_game.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/templates/android_project/jni/basic_game.c b/templates/android_project/jni/basic_game.c index 987599a8..8a0413c3 100644 --- a/templates/android_project/jni/basic_game.c +++ b/templates/android_project/jni/basic_game.c @@ -30,7 +30,7 @@ void android_main(struct android_app *app) const int screenHeight = 450; GameScreen currentScreen = LOGO; - + InitWindow(screenWidth, screenHeight, app); // TODO: Initialize all required variables and load all required data here! @@ -43,7 +43,9 @@ void android_main(struct android_app *app) int framesCounter = 0; // Used to count frames - //SetTargetFPS(60); // Not required on Android, already locked to 60 fps + PlayMusicStream("ambient.ogg"); + + SetTargetFPS(60); // Not required on Android, already locked to 60 fps //-------------------------------------------------------------------------------------- // Main game loop @@ -51,6 +53,8 @@ void android_main(struct android_app *app) { // Update //---------------------------------------------------------------------------------- + UpdateMusicStream(); + switch(currentScreen) { case LOGO: @@ -70,7 +74,7 @@ void android_main(struct android_app *app) // TODO: Update TITLE screen variables here! // Press enter to change to GAMEPLAY screen - if (IsScreenTouched()) + if (GetGestureType() == GESTURE_TAP) { PlaySound(fx); currentScreen = GAMEPLAY; @@ -81,8 +85,8 @@ void android_main(struct android_app *app) // TODO: Update GAMEPLAY screen variables here! // Press enter to change to ENDING screen - if (IsScreenTouched()) - { + if (GetGestureType() == GESTURE_TAP) + { PlaySound(fx); currentScreen = ENDING; } @@ -92,7 +96,7 @@ void android_main(struct android_app *app) // TODO: Update ENDING screen variables here! // Press enter to return to TITLE screen - if (IsScreenTouched()) + if (GetGestureType() == GESTURE_TAP) { PlaySound(fx); currentScreen = TITLE; |
