mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-04 21:29:18 -05:00
Review templates for Android
- Removed useless templates - Reviewed all Makefiles - Rework some code for Android support - Added resources to advance template
This commit is contained in:
@ -51,10 +51,11 @@ void UpdateEndingScreen(void)
|
||||
{
|
||||
// TODO: Update ENDING screen variables here!
|
||||
|
||||
// Press enter to return to TITLE screen
|
||||
if (IsKeyPressed(KEY_ENTER))
|
||||
// Press enter or tap to return to TITLE screen
|
||||
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
|
||||
{
|
||||
finishScreen = 1;
|
||||
PlaySound(fxCoin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,8 +64,8 @@ void DrawEndingScreen(void)
|
||||
{
|
||||
// TODO: Draw ENDING screen here!
|
||||
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE);
|
||||
DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE);
|
||||
DrawText("PRESS ENTER to RETURN to TITLE SCREEN", 160, 220, 20, DARKBLUE);
|
||||
DrawTextEx(font, "ENDING SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, DARKBLUE);
|
||||
DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE);
|
||||
}
|
||||
|
||||
// Ending Screen Unload logic
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Gameplay Screen Functions Definitions (Init, Update, Draw, Unload)
|
||||
*
|
||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
||||
* Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
@ -51,10 +51,11 @@ void UpdateGameplayScreen(void)
|
||||
{
|
||||
// TODO: Update GAMEPLAY screen variables here!
|
||||
|
||||
// Press enter to change to ENDING screen
|
||||
if (IsKeyPressed(KEY_ENTER))
|
||||
// Press enter or tap to change to ENDING screen
|
||||
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
|
||||
{
|
||||
finishScreen = 1;
|
||||
PlaySound(fxCoin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,8 +64,8 @@ void DrawGameplayScreen(void)
|
||||
{
|
||||
// TODO: Draw GAMEPLAY screen here!
|
||||
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), PURPLE);
|
||||
DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON);
|
||||
DrawText("PRESS ENTER to JUMP to ENDING SCREEN", 170, 220, 20, MAROON);
|
||||
DrawTextEx(font, "GAMEPLAY SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, MAROON);
|
||||
DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, MAROON);
|
||||
}
|
||||
|
||||
// Gameplay Screen Unload logic
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
static int framesCounter;
|
||||
static int finishScreen;
|
||||
|
||||
static Texture2D logo;
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Logo Screen Functions Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -44,6 +46,8 @@ void InitLogoScreen(void)
|
||||
// TODO: Initialize LOGO screen variables here!
|
||||
framesCounter = 0;
|
||||
finishScreen = 0;
|
||||
|
||||
logo = LoadTexture("resources/raylib_logo.png");
|
||||
}
|
||||
|
||||
// Logo Screen Update logic
|
||||
@ -64,14 +68,18 @@ void UpdateLogoScreen(void)
|
||||
void DrawLogoScreen(void)
|
||||
{
|
||||
// TODO: Draw LOGO screen here!
|
||||
DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY);
|
||||
DrawText("WAIT for 2 SECONDS...", 290, 220, 20, GRAY);
|
||||
DrawTextEx(font, "LOGO SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, GRAY);
|
||||
DrawText("WAIT for 2 SECONDS...", 290, 400, 20, GRAY);
|
||||
|
||||
DrawTexture(logo, GetScreenWidth()/2 - logo.width/2, 100, WHITE);
|
||||
}
|
||||
|
||||
// Logo Screen Unload logic
|
||||
void UnloadLogoScreen(void)
|
||||
{
|
||||
// TODO: Unload LOGO screen variables here!
|
||||
|
||||
UnloadTexture(logo);
|
||||
}
|
||||
|
||||
// Logo Screen should finish?
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Title Screen Functions Definitions (Init, Update, Draw, Unload)
|
||||
*
|
||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
||||
* Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
@ -51,11 +51,12 @@ void UpdateTitleScreen(void)
|
||||
{
|
||||
// TODO: Update TITLE screen variables here!
|
||||
|
||||
// Press enter to change to GAMEPLAY screen
|
||||
if (IsKeyPressed(KEY_ENTER))
|
||||
// Press enter or tap to change to GAMEPLAY screen
|
||||
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
|
||||
{
|
||||
//finishScreen = 1; // OPTIONS
|
||||
finishScreen = 2; // GAMEPLAY
|
||||
PlaySound(fxCoin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +65,8 @@ void DrawTitleScreen(void)
|
||||
{
|
||||
// TODO: Draw TITLE screen here!
|
||||
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GREEN);
|
||||
DrawText("TITLE SCREEN", 20, 20, 40, DARKGREEN);
|
||||
DrawText("PRESS ENTER to JUMP to GAMEPLAY SCREEN", 160, 220, 20, DARKGREEN);
|
||||
DrawTextEx(font, "TITLE SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, DARKGREEN);
|
||||
DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, DARKGREEN);
|
||||
}
|
||||
|
||||
// Title Screen Unload logic
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Screens Functions Declarations (Init, Update, Draw, Unload)
|
||||
*
|
||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
||||
* Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
@ -29,12 +29,15 @@
|
||||
//----------------------------------------------------------------------------------
|
||||
// Types and Structures Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
typedef enum GameScreen { LOGO, TITLE, OPTIONS, GAMEPLAY, ENDING } GameScreen;
|
||||
typedef enum GameScreen { LOGO = 0, TITLE, OPTIONS, GAMEPLAY, ENDING } GameScreen;
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Global Variables Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
GameScreen currentScreen;
|
||||
SpriteFont font;
|
||||
Music music;
|
||||
Sound fxCoin;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" { // Prevents name mangling of functions
|
||||
|
||||
Reference in New Issue
Block a user