Review games

This commit is contained in:
Ray 2019-05-21 22:36:52 +02:00
parent b1806f6600
commit 477f05db13
10 changed files with 224 additions and 89 deletions

View File

@ -1,14 +1,14 @@
/******************************************************************************************* /*******************************************************************************************
* *
* raylib - Advance Game template * CAT VS ROOMBA [GLOBAL GAME JAM 2019]
* *
* <Game title> * Ah! Home, sweet home! Time for some automatic cleaning...
* <Game description> * if the worst enemy of Roomba allows it... be careful with Cat!
* *
* This game has been created using raylib (www.raylib.com) * This game has been created using raylib 2.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* *
* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5) * Copyright (c) 2019 Ramon Santamaria (@raysan5)
* *
********************************************************************************************/ ********************************************************************************************/
@ -57,7 +57,7 @@ int main(void)
{ {
// Initialization (Note windowTitle is unused on Android) // Initialization (Note windowTitle is unused on Android)
//--------------------------------------------------------- //---------------------------------------------------------
InitWindow(screenWidth, screenHeight, "raylib template - advance game"); InitWindow(screenWidth, screenHeight, "CAT VS ROOMBA [GGJ19]");
// Global data loading (assets that must be available in all screens, i.e. fonts) // Global data loading (assets that must be available in all screens, i.e. fonts)
InitAudioDevice(); InitAudioDevice();

View File

@ -33,22 +33,22 @@
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Logo screen global variables // Logo screen global variables
static int framesCounter; static int framesCounter = 0;
static int finishScreen; static int finishScreen = 0;
static int logoPositionX; static int logoPositionX = 0;
static int logoPositionY; static int logoPositionY = 0;
static int lettersCount; static int lettersCount = 0;
static int topSideRecWidth; static int topSideRecWidth = 0;
static int leftSideRecHeight; static int leftSideRecHeight = 0;
static int bottomSideRecWidth; static int bottomSideRecWidth = 0;
static int rightSideRecHeight; static int rightSideRecHeight = 0;
static char raylib[8]; // raylib text array, max 8 letters static char raylib[8] = { 0 }; // raylib text array, max 8 letters
static int state; // Tracking animation states (State Machine) static int state = 0; // Tracking animation states (State Machine)
static float alpha = 1.0f; // Useful for fading static float alpha = 1.0f; // Useful for fading
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------

View File

@ -1,20 +1,19 @@
/******************************************************************************************* /*******************************************************************************************
* *
* JUST DO - Global Game Jam 2015 Videogame * JUST DO [GLOBAL GAME JAM 2015]
* Experimental puzzle game that lets the user try to find a logic solution to
* different shape-color-based situations.
* *
* Developed by: Ramon Santamaria (Ray San) * Experimental puzzle game that lets the user try to find a logic
* solution to different shape-color-based situations.
* *
* This game has been created using raylib 1.6 (www.raylib.com) * This game has been created using raylib 1.6 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* *
* raylib - Copyright (c) 2015 Ramon Santamaria (@raysan5) * Copyright (c) 2015 Ramon Santamaria (@raysan5)
* *
********************************************************************************************/ ********************************************************************************************/
#include "raylib.h" #include "raylib.h"
#include "screens/screens.h" // NOTE: Defines currentScreen #include "screens/screens.h" // NOTE: Defines global variable: currentScreen
#if defined(PLATFORM_WEB) #if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h> #include <emscripten/emscripten.h>
@ -53,7 +52,7 @@ int main(void)
{ {
// Initialization (Note windowTitle is unused on Android) // Initialization (Note windowTitle is unused on Android)
//--------------------------------------------------------- //---------------------------------------------------------
InitWindow(screenWidth, screenHeight, "GGJ15 - JUST DO"); InitWindow(screenWidth, screenHeight, "JUST DO [GGJ15]");
// Load global data here (assets that must be available in all screens, i.e. fonts) // Load global data here (assets that must be available in all screens, i.e. fonts)
InitAudioDevice(); InitAudioDevice();
@ -74,9 +73,6 @@ int main(void)
// Main game loop // Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key while (!WindowShouldClose()) // Detect window close button or ESC key
{ {
if (IsKeyPressed(KEY_SPACE)) PlaySound(levelWin);
UpdateDrawFrame(); UpdateDrawFrame();
} }
#endif #endif
@ -144,6 +140,8 @@ void UpdateDrawFrame(void)
{ {
// Update // Update
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
if (currentScreen != LOGO) UpdateMusicStream(music);
if (!onTransition) if (!onTransition)
{ {
if (IsKeyPressed('0')) if (IsKeyPressed('0'))
@ -197,8 +195,6 @@ void UpdateDrawFrame(void)
InitLevel08Screen(); InitLevel08Screen();
} }
UpdateMusicStream(music);
switch(currentScreen) switch(currentScreen)
{ {
case LOGO: case LOGO:

View File

@ -1,6 +1,6 @@
/******************************************************************************************* /*******************************************************************************************
* *
* raylib - Koala Seasons game * Koala Seasons [emegeme 2015]
* *
* Koala Seasons is a runner, you must survive as long as possible jumping from tree to tree * Koala Seasons is a runner, you must survive as long as possible jumping from tree to tree
* Ready to start the adventure? How long can you survive? * Ready to start the adventure? How long can you survive?
@ -13,7 +13,7 @@
********************************************************************************************/ ********************************************************************************************/
#include "raylib.h" #include "raylib.h"
#include "screens/screens.h" // NOTE: Defines currentScreen #include "screens/screens.h" // NOTE: Defines global variable: currentScreen
#if defined(PLATFORM_WEB) #if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h> #include <emscripten/emscripten.h>
@ -22,6 +22,9 @@
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Global Variables Definition (local to this module) // Global Variables Definition (local to this module)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
static const int screenWidth = 1280;
static const int screenHeight = 720;
static float transAlpha = 0; static float transAlpha = 0;
static bool onTransition = false; static bool onTransition = false;
static bool transFadeOut = false; static bool transFadeOut = false;
@ -43,17 +46,11 @@ void UpdateDrawFrame(void); // Update and Draw one frame
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Main entry point // Main entry point
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
int main(void) { int main(void)
// Initialization {
// Initialization (Note windowTitle is unused on Android)
//--------------------------------------------------------- //---------------------------------------------------------
const int screenWidth = 1280; InitWindow(screenWidth, screenHeight, "KOALA SEASONS");
const int screenHeight = 720;
const char windowTitle[30] = "KOALA SEASONS";
//SetConfigFlags(FLAG_FULLSCREEN_MODE);
// Note that windowTitle is ignored on Android
InitWindow(screenWidth, screenHeight, windowTitle);
// Load global data here (assets that must be available in all screens, i.e. fonts) // Load global data here (assets that must be available in all screens, i.e. fonts)
font = LoadFont("resources/graphics/mainfont.png"); font = LoadFont("resources/graphics/mainfont.png");

View File

@ -1,16 +1,16 @@
/******************************************************************************************* /*******************************************************************************************
* *
* GLOBAL GAME JAM 2016 - LIGHT MY RITUAL! * LIGHT MY RITUAL [GLOBAL GAME JAM 2016]
* *
* Preparing a ritual session is not that easy. * Preparing a ritual session is not that easy.
* You must light all the candles before the astral alignment finishes... * You must light all the candles before the astral alignment finishes...
* but dark creatures move in the shadows to put out all your lights! * but dark creatures move in the shadows to put out all your lights!
* Be fast! Be smart! Light my ritual! * Be fast! Be smart! Light my ritual!
* *
* This game has been created using raylib (www.raylib.com) * This game has been created using raylib 1.6 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* *
* Copyright (c) 2015 Ramon Santamaria (@raysan5) * Copyright (c) 2016 Ramon Santamaria (@raysan5)
* *
********************************************************************************************/ ********************************************************************************************/
@ -55,7 +55,7 @@ int main(void)
{ {
// Initialization (Note windowTitle is unused on Android) // Initialization (Note windowTitle is unused on Android)
//--------------------------------------------------------- //---------------------------------------------------------
InitWindow(screenWidth, screenHeight, "GGJ16 - LIGHT MY RITUAL!"); InitWindow(screenWidth, screenHeight, "LIGHT MY RITUAL! [GGJ16]");
// Global data loading (assets that must be available in all screens, i.e. fonts) // Global data loading (assets that must be available in all screens, i.e. fonts)
InitAudioDevice(); InitAudioDevice();

View File

@ -2,10 +2,12 @@
* *
* SKULLY ESCAPE [KING GAME JAM 2015] * SKULLY ESCAPE [KING GAME JAM 2015]
* *
* A scary graphic adventure in an old mansion
*
* This game has been created using raylib 1.6 (www.raylib.com) * This game has been created using raylib 1.6 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* *
* Copyright (c) 2014 Ramon Santamaria (@raysan5) * Copyright (c) 2015 Ramon Santamaria (@raysan5)
* *
********************************************************************************************/ ********************************************************************************************/
@ -52,7 +54,7 @@ int main(void)
{ {
// Initialization (Note windowTitle is unused on Android) // Initialization (Note windowTitle is unused on Android)
//--------------------------------------------------------- //---------------------------------------------------------
InitWindow(screenWidth, screenHeight, "SKULLY ESCAPE [KING GAMEJAM]"); InitWindow(screenWidth, screenHeight, "SKULLY ESCAPE [KING GAMEJAM 2015]");
// Global data loading (assets that must be available in all screens, i.e. fonts) // Global data loading (assets that must be available in all screens, i.e. fonts)
InitAudioDevice(); InitAudioDevice();

View File

@ -222,7 +222,7 @@ static char *StringReplace(char *orig, char *rep, char *with)
// Count the number of replacements needed // Count the number of replacements needed
ins = orig; ins = orig;
for (count = 0; tmp = strstr(ins, rep); ++count) for (count = 0; (tmp = strstr(ins, rep)); ++count)
{ {
ins = tmp + len_rep; ins = tmp + len_rep;
} }

View File

@ -26,19 +26,32 @@
#include "raylib.h" #include "raylib.h"
#include "screens.h" #include "screens.h"
#define LOGO_RECS_SIDE 16
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Global Variables Definition (local to this module) // Global Variables Definition (local to this module)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Logo screen global variables // Logo screen global variables
static int framesCounter; static int framesCounter = 0;
static int finishScreen; static int finishScreen = 0;
static Texture2D logoCW; static int logoPositionX = 0;
static int logoPositionY = 0;
static float fadeValue; static int lettersCount = 0;
static int showLogoFrames;
static bool fadeOut; static int topSideRecWidth = 0;
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 Texture2D texLogoCW = { 0 }; // Cinamon Works texture
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Logo Screen Functions Definition // Logo Screen Functions Definition
@ -47,53 +60,183 @@ static bool fadeOut;
// Logo Screen Initialization logic // Logo Screen Initialization logic
void InitLogoScreen(void) void InitLogoScreen(void)
{ {
framesCounter = 0; // Initialize LOGO screen variables here!
finishScreen = 0; finishScreen = 0;
framesCounter = 0;
lettersCount = 0;
logoCW = LoadTexture("resources/textures/cw_logo.png"); logoPositionX = GetScreenWidth()/2 - 128;
logoPositionY = GetScreenHeight()/2 - 128;
showLogoFrames = 60; topSideRecWidth = LOGO_RECS_SIDE;
fadeValue = 0; leftSideRecHeight = LOGO_RECS_SIDE;
bottomSideRecWidth = LOGO_RECS_SIDE;
rightSideRecHeight = LOGO_RECS_SIDE;
fadeOut = false; for (int i = 0; i < 8; i++) raylib[i] = '\0';
state = 0;
alpha = 1.0f;
texLogoCW = LoadTexture("resources/textures/cw_logo.png");
} }
// Logo Screen Update logic // Logo Screen Update logic
void UpdateLogoScreen(void) void UpdateLogoScreen(void)
{ {
if (!fadeOut) // Update LOGO screen variables here!
{ if (state == 0) // State 0: Small box blinking
fadeValue += 0.02f; {
if (fadeValue > 1.01f) framesCounter++;
if (framesCounter == 80)
{ {
fadeValue = 1.0f; state = 1;
framesCounter++; framesCounter = 0; // Reset counter... will be used later...
}
if ((framesCounter%showLogoFrames) == 0) }
else if (state == 1) // State 1: Top and left bars growing
{
topSideRecWidth += 8;
leftSideRecHeight += 8;
if (topSideRecWidth == 256) state = 2;
}
else if (state == 2) // State 2: Bottom and right bars growing
{
bottomSideRecWidth += 8;
rightSideRecHeight += 8;
if (bottomSideRecWidth == 256) state = 3;
}
else if (state == 3) // State 3: Letters appearing (one by one)
{
framesCounter++;
if (framesCounter/10) // Every 12 frames, one more letter!
{
lettersCount++;
framesCounter = 0;
}
switch (lettersCount)
{
case 1: raylib[0] = 'r'; break;
case 2: raylib[1] = 'a'; break;
case 3: raylib[2] = 'y'; break;
case 4: raylib[3] = 'l'; break;
case 5: raylib[4] = 'i'; break;
case 6: raylib[5] = 'b'; break;
default: break;
}
// When all letters have appeared...
if (lettersCount >= 10)
{
state = 4;
framesCounter = 0;
}
}
else if (state == 4)
{
framesCounter++;
if (framesCounter > 100)
{
alpha -= 0.02f;
if (alpha <= 0.0f)
{ {
fadeOut = true; alpha = 0.0f;
finishScreen = true; framesCounter = 0;
} state = 5;
} }
} }
}
if (IsKeyPressed(KEY_ENTER)) finishScreen = true; else if (state == 5)
{
alpha += 0.02f;
if (alpha >= 1.0f) alpha = 1.0f;
framesCounter++;
if (framesCounter > 200)
{
framesCounter = 0;
state = 6;
}
}
else if (state == 6)
{
alpha -= 0.02f;
if (alpha >= 1.0f) alpha = 1.0f;
framesCounter++;
if (framesCounter > 100)
{
framesCounter = 0;
finishScreen = 1;
}
}
} }
// Logo Screen Draw logic // Logo Screen Draw logic
void DrawLogoScreen(void) void DrawLogoScreen(void)
{ {
DrawTexture(logoCW, GetScreenWidth()/2 - logoCW.width/2, GetScreenHeight()/2 - logoCW.height/2, Fade(WHITE, fadeValue)); if (state == 0)
{
if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK);
}
else if (state == 1)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
}
else if (state == 2)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK);
DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK);
DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK);
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK);
}
else if (state == 3)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha));
}
else if (state == 4)
{
DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha));
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha));
DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha));
if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(DARKGRAY, alpha));
}
else if ((state == 5) || (state == 6)) DrawTexture(texLogoCW, GetScreenWidth()/2 - texLogoCW.width/2, GetScreenHeight()/2 - texLogoCW.height/2, Fade(WHITE, alpha));
} }
// Logo Screen Unload logic // Logo Screen Unload logic
void UnloadLogoScreen(void) void UnloadLogoScreen(void)
{ {
UnloadTexture(logoCW); // Unload LOGO screen variables here!
UnloadTexture(texLogoCW);
} }
// Logo Screen should finish? // Logo Screen should finish?
int FinishLogoScreen(void) int FinishLogoScreen(void)
{ {
return finishScreen; return finishScreen;
} }

View File

@ -1,13 +1,14 @@
/******************************************************************************************* /*******************************************************************************************
* *
* raylib - transmission mission * TRANSMISSION MISSION [GLOBAL GAME JAM 2018]
* *
* Code and transmit the right message * Code the different filtration messages to be send to newspaper
* to avoid being understood in case of interception.
* *
* This game has been created using raylib (www.raylib.com) * This game has been created using raylib 1.8 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* *
* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5) * Copyright (c) 2018 Ramon Santamaria (@raysan5)
* *
********************************************************************************************/ ********************************************************************************************/
@ -53,13 +54,9 @@ static void UpdateDrawFrame(void); // Update and Draw one frame
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
int main(void) int main(void)
{ {
// Initialization // Initialization (Note windowTitle is unused on Android)
//--------------------------------------------------------- //---------------------------------------------------------
#ifndef PLATFORM_ANDROID InitWindow(screenWidth, screenHeight, "transmission mission [GGJ18]");
SetConfigFlags(FLAG_SHOW_LOGO); // | FLAG_FULLSCREEN_MODE);
#endif
// Note windowTitle is unused on Android
InitWindow(screenWidth, screenHeight, "raylib game - transmission mission");
// Global data loading (assets that must be available in all screens, i.e. fonts) // Global data loading (assets that must be available in all screens, i.e. fonts)
InitAudioDevice(); InitAudioDevice();

View File

@ -1,6 +1,6 @@
/******************************************************************************************* /*******************************************************************************************
* *
* GLOBAL GAME JAM 2017 - WAVE COLLECTOR * WAVE COLLECTOR [GLOBAL GAME JAM 2017]
* *
* The ultimate wave particles collector is here! * The ultimate wave particles collector is here!
* You must follow the wave and collect all the particles * You must follow the wave and collect all the particles
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
SetConfigFlags(FLAG_MSAA_4X_HINT); SetConfigFlags(FLAG_MSAA_4X_HINT);
#endif #endif
// Note windowTitle is unused on Android // Note windowTitle is unused on Android
InitWindow(screenWidth, screenHeight, "GGJ17 - WAVE COLLECTOR"); InitWindow(screenWidth, screenHeight, "WAVE COLLECTOR [GGJ17]");
// Global data loading (assets that must be available in all screens, i.e. fonts) // Global data loading (assets that must be available in all screens, i.e. fonts)
InitAudioDevice(); InitAudioDevice();