Review ALL games to raylib 3.0

This commit is contained in:
Ray
2020-02-06 18:07:25 +01:00
parent 86bdf60887
commit 97054e4e0f
23 changed files with 364 additions and 294 deletions

View File

@ -205,14 +205,6 @@ endif
# Additional flags for compiler (if desired)
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# resource file contains windows executable icon and properties
# -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
ifeq ($(BUILD_MODE), RELEASE)
CFLAGS += -Wl,--subsystem,windows
endif
endif
ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(RAYLIB_LIBTYPE),STATIC)
CFLAGS += -D_DEFAULT_SOURCE
@ -275,6 +267,14 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# resource file contains windows executable icon and properties
LDFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data
# -Wl,--subsystem,windows hides the console window
ifeq ($(BUILD_MODE), RELEASE)
LDFLAGS += -Wl,--subsystem,windows
endif
endif
ifeq ($(PLATFORM_OS),BSD)
# Consider -L$(RAYLIB_INSTALL_PATH)
LDFLAGS += -L. -Lsrc -L/usr/local/lib

View File

@ -1,14 +1,14 @@
/*******************************************************************************************
*
* raylib - Advance Game template
* RE_PAIR [GLOBAL GAME JAM 2020]
*
* <Game title>
* <Game description>
* Let's find your perfect match!
* Ready for dating? Do you need some face tweaks? Choose wisely!
*
* This game has been created using raylib (www.raylib.com)
* This game has been created using raylib 3.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2014-2020 Ramon Santamaria (@raysan5)
* Copyright (c) 2020 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@ -28,7 +28,6 @@ Texture2D texNPatch = { 0 };
NPatchInfo npInfo = { 0 };
Texture2D texHead, texHair, texNose, texMouth, texEyes, texComp;
Texture2D texMakeup = { 0 };
Character playerBase = { 0 };
Character datingBase = { 0 };
@ -70,7 +69,7 @@ int main(void)
{
// Initialization (Note windowTitle is unused on Android)
//---------------------------------------------------------
InitWindow(screenWidth, screenHeight, "raylib template - advance game");
InitWindow(screenWidth, screenHeight, "RE-PAIR [GGJ2020]");
// Global data loading (assets that must be available in all screens, i.e. fonts)
InitAudioDevice();
@ -97,7 +96,6 @@ int main(void)
texMouth = LoadTexture("resources/mouth_models.png");
texEyes = LoadTexture("resources/eyes_models.png");
//texComp = LoadTexture("resources/comp_models.png");
texMakeup = LoadTexture("resources/makeup.png");
SetMusicVolume(music, 0.5f);
//PlayMusicStream(music);
@ -145,7 +143,6 @@ int main(void)
UnloadTexture(texMouth);
UnloadTexture(texEyes);
//UnloadTexture(texComp);
UnloadTexture(texMakeup);
CloseAudioDevice(); // Close audio context
@ -217,7 +214,7 @@ bool GuiButton(Rectangle bounds, const char *text, int forcedState)
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = 2; // PRESSED
else state = 1; // FOCUSED
if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON))
if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON) || IsGestureDetected(GESTURE_TAP))
{
pressed = true;
PlaySound(fxCoin);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -135,7 +135,7 @@ void UpdateEndingScreen(void)
}
// Press enter or tap to return to TITLE screen
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
if (IsKeyPressed(KEY_ENTER))
{
finishScreen = 1;
PlaySound(fxCoin);

View File

@ -4,7 +4,7 @@
*
* Logo Screen Functions Definitions (Init, Update, Draw, Unload)
*
* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2020 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.
@ -47,9 +47,9 @@ static int leftSideRecHeight = 0;
static int bottomSideRecWidth = 0;
static int rightSideRecHeight = 0;
static char raylib[8] = { 0 }; // raylib text array, max 8 letters
static int state = 0; // Tracking animation states (State Machine)
static float alpha = 1.0f; // Useful for fading
static char raylib[8] = { 0 }; // raylib text array, max 8 letters
static int state = 0; // Tracking animation states (State Machine)
static float alpha = 1.0f; // Useful for fading
//----------------------------------------------------------------------------------
// Logo Screen Functions Definition

View File

@ -109,11 +109,7 @@ void DrawTitleScreen(void)
if (titleCounter > 180)
{
if (GuiButton((Rectangle){ GetScreenWidth()/2 - 440/2, 580, 440, 80 }, "START DATE!", -1))
{
finishScreen = 1; // GAMEPLAY
PlaySound(fxCoin);
}
if (GuiButton((Rectangle){ GetScreenWidth()/2 - 440/2, 580, 440, 80 }, "START DATE!", -1)) finishScreen = 1; // GAMEPLAY
}
DrawText("powered by", 20, GetScreenHeight() - texLogo.height - 35, 10, BLACK);

View File

@ -100,15 +100,6 @@ void DrawTitleScreen(void);
void UnloadTitleScreen(void);
int FinishTitleScreen(void);
//----------------------------------------------------------------------------------
// Options Screen Functions Declaration
//----------------------------------------------------------------------------------
void InitOptionsScreen(void);
void UpdateOptionsScreen(void);
void DrawOptionsScreen(void);
void UnloadOptionsScreen(void);
int FinishOptionsScreen(void);
//----------------------------------------------------------------------------------
// Gameplay Screen Functions Declaration
//----------------------------------------------------------------------------------