Some tweaks revisiting an old game...
This commit is contained in:
parent
b4d67499a7
commit
a5329efb23
3 changed files with 19 additions and 45 deletions
|
@ -200,7 +200,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# resource file contains windows executable icon and properties
|
# resource file contains windows executable icon and properties
|
||||||
# -Wl,--subsystem,windows hides the console window
|
# -Wl,--subsystem,windows hides the console window
|
||||||
CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows
|
CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||||
|
|
|
@ -59,9 +59,9 @@ int main(void)
|
||||||
atlas02 = LoadTexture("resources/graphics/atlas02.png");
|
atlas02 = LoadTexture("resources/graphics/atlas02.png");
|
||||||
|
|
||||||
#if defined(PLATFORM_WEB) || defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID)
|
#if defined(PLATFORM_WEB) || defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID)
|
||||||
colorBlend = LoadShader("resources/shaders/glsl100/base.vs", "resources/shaders/glsl100/blend_color.fs");
|
colorBlend = LoadShader(0, "resources/shaders/glsl100/blend_color.fs");
|
||||||
#else
|
#else
|
||||||
colorBlend = LoadShader("resources/shaders/glsl330/base.vs", "resources/shaders/glsl330/blend_color.fs");
|
colorBlend = LoadShader(0, "resources/shaders/glsl330/blend_color.fs");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
InitAudioDevice();
|
InitAudioDevice();
|
||||||
|
@ -76,20 +76,14 @@ int main(void)
|
||||||
fxDieDingo = LoadSound("resources/audio/dingo_die.ogg");
|
fxDieDingo = LoadSound("resources/audio/dingo_die.ogg");
|
||||||
fxDieOwl = LoadSound("resources/audio/owl_die.ogg");
|
fxDieOwl = LoadSound("resources/audio/owl_die.ogg");
|
||||||
|
|
||||||
|
|
||||||
music = LoadMusicStream("resources/audio/jngl.xm");
|
music = LoadMusicStream("resources/audio/jngl.xm");
|
||||||
PlayMusicStream(music);
|
PlayMusicStream(music);
|
||||||
SetMusicVolume(music, 1.0f);
|
SetMusicVolume(music, 2.0f);
|
||||||
|
|
||||||
// Define and init first screen
|
// Define and init first screen
|
||||||
// NOTE: currentScreen is defined in screens.h as a global variable
|
// NOTE: currentScreen is defined in screens.h as a global variable
|
||||||
currentScreen = TITLE;
|
currentScreen = TITLE;
|
||||||
|
|
||||||
InitLogoScreen();
|
|
||||||
//InitOptionsScreen();
|
|
||||||
InitTitleScreen();
|
InitTitleScreen();
|
||||||
InitGameplayScreen();
|
|
||||||
InitEndingScreen();
|
|
||||||
|
|
||||||
#if defined(PLATFORM_WEB)
|
#if defined(PLATFORM_WEB)
|
||||||
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
|
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
|
||||||
|
@ -258,8 +252,6 @@ void UpdateDrawFrame(void)
|
||||||
|
|
||||||
if (onTransition) DrawTransition();
|
if (onTransition) DrawTransition();
|
||||||
|
|
||||||
DrawFPS(20, GetScreenHeight() - 30);
|
|
||||||
|
|
||||||
DrawRectangle(GetScreenWidth() - 200, GetScreenHeight() - 50, 200, 40, Fade(WHITE, 0.6f));
|
DrawRectangle(GetScreenWidth() - 200, GetScreenHeight() - 50, 200, 40, Fade(WHITE, 0.6f));
|
||||||
DrawText("ALPHA VERSION", GetScreenWidth() - 180, GetScreenHeight() - 40, 20, DARKGRAY);
|
DrawText("ALPHA VERSION", GetScreenWidth() - 180, GetScreenHeight() - 40, 20, DARKGRAY);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
|
|
||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
|
|
||||||
// DONE: Review MAX_* limits, don't waste memory!!!
|
|
||||||
#define MAX_ENEMIES 16
|
#define MAX_ENEMIES 16
|
||||||
#define MAX_BAMBOO 16
|
#define MAX_BAMBOO 16
|
||||||
#define MAX_LEAVES 14
|
#define MAX_LEAVES 14
|
||||||
|
@ -343,7 +342,6 @@ static Rectangle leftButton = {0, 0, 0, 0};
|
||||||
static Rectangle rightButton = {0, 0, 0, 0};
|
static Rectangle rightButton = {0, 0, 0, 0};
|
||||||
static Rectangle powerButton = {0, 0, 0, 0};
|
static Rectangle powerButton = {0, 0, 0, 0};
|
||||||
static Rectangle fire[MAX_FIRE];
|
static Rectangle fire[MAX_FIRE];
|
||||||
//static Rectangle flames[MAX_FLAMES];
|
|
||||||
static Rectangle ice[MAX_ICE];
|
static Rectangle ice[MAX_ICE];
|
||||||
static Rectangle resin[MAX_RESIN];
|
static Rectangle resin[MAX_RESIN];
|
||||||
static Rectangle wind[MAX_WIND];
|
static Rectangle wind[MAX_WIND];
|
||||||
|
@ -351,7 +349,7 @@ static Rectangle bamboo[MAX_BAMBOO];
|
||||||
static Rectangle snake[MAX_ENEMIES];
|
static Rectangle snake[MAX_ENEMIES];
|
||||||
static Rectangle dingo[MAX_ENEMIES];
|
static Rectangle dingo[MAX_ENEMIES];
|
||||||
static Rectangle owl[MAX_ENEMIES];
|
static Rectangle owl[MAX_ENEMIES];
|
||||||
static Rectangle leaf[MAX_LEAVES]; // DONE: Review name!
|
static Rectangle leaf[MAX_LEAVES];
|
||||||
static Rectangle powerBar;
|
static Rectangle powerBar;
|
||||||
static Rectangle backBar;
|
static Rectangle backBar;
|
||||||
static Rectangle fireAnimation;
|
static Rectangle fireAnimation;
|
||||||
|
@ -387,7 +385,7 @@ static Vector2 textSize;
|
||||||
static Vector2 clockPosition;
|
static Vector2 clockPosition;
|
||||||
|
|
||||||
static Particle enemyHit[MAX_ENEMIES];
|
static Particle enemyHit[MAX_ENEMIES];
|
||||||
static ParticleSystem leafParticles[MAX_LEAVES]; // DONE: Review!!! Creating 40 ParticleSystem!!! -> 40*128 = 5120 Particles! Maybe better create a struct Leaf?
|
static ParticleSystem leafParticles[MAX_LEAVES];
|
||||||
static ParticleSystem snowParticle;
|
static ParticleSystem snowParticle;
|
||||||
static ParticleSystem backSnowParticle;
|
static ParticleSystem backSnowParticle;
|
||||||
static ParticleSystem dandelionParticle;
|
static ParticleSystem dandelionParticle;
|
||||||
|
@ -1043,12 +1041,8 @@ void UpdateGameplayScreen(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
if (currentLeaves < LEAVESTOTRANSFORM && (IsKeyPressed(KEY_ENTER)))
|
if ((currentLeaves < LEAVESTOTRANSFORM) && (IsKeyPressed(KEY_ENTER))) currentLeaves += LEAVESTOTRANSFORM;
|
||||||
{
|
|
||||||
currentLeaves += LEAVESTOTRANSFORM;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (coolDown)
|
if (coolDown)
|
||||||
{
|
{
|
||||||
power += 20;
|
power += 20;
|
||||||
|
@ -1427,10 +1421,6 @@ void UpdateGameplayScreen(void)
|
||||||
|
|
||||||
if (CheckCollisionRecs(player, leaf[j]) && leafActive[j])
|
if (CheckCollisionRecs(player, leaf[j]) && leafActive[j])
|
||||||
{
|
{
|
||||||
//power += 20;
|
|
||||||
//printf("coin %c", coinType[j]);
|
|
||||||
|
|
||||||
// DONE: Review
|
|
||||||
popupLeaves[j].position = (Vector2){ leaf[j].x, leaf[j].y };
|
popupLeaves[j].position = (Vector2){ leaf[j].x, leaf[j].y };
|
||||||
popupLeaves[j].scale = 1.0f;
|
popupLeaves[j].scale = 1.0f;
|
||||||
popupLeaves[j].alpha = 1.0f;
|
popupLeaves[j].alpha = 1.0f;
|
||||||
|
@ -2232,7 +2222,6 @@ void UpdateGameplayScreen(void)
|
||||||
player.x -= speed;
|
player.x -= speed;
|
||||||
grabCounter += 1*TIME_FACTOR;
|
grabCounter += 1*TIME_FACTOR;
|
||||||
|
|
||||||
// DONE: Review, before checking collision with ALL enemies, check if they are active!
|
|
||||||
for (int i = 0; i < MAX_ENEMIES; i++)
|
for (int i = 0; i < MAX_ENEMIES; i++)
|
||||||
{
|
{
|
||||||
if (CheckCollisionRecs(player, snake[i]) && !isHitSnake[i] && snakeActive[i])
|
if (CheckCollisionRecs(player, snake[i]) && !isHitSnake[i] && snakeActive[i])
|
||||||
|
@ -2286,7 +2275,6 @@ void UpdateGameplayScreen(void)
|
||||||
enemyHit[i].speed = (Vector2){ dingo[i].x, dingo[i].y };
|
enemyHit[i].speed = (Vector2){ dingo[i].x, dingo[i].y };
|
||||||
enemyHit[i].size = (float)GetRandomValue(5, 10)/30;
|
enemyHit[i].size = (float)GetRandomValue(5, 10)/30;
|
||||||
enemyHit[i].rotation = 0.0f;
|
enemyHit[i].rotation = 0.0f;
|
||||||
//enemyHit[i].color = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
|
|
||||||
enemyHit[i].alpha = 1.0f;
|
enemyHit[i].alpha = 1.0f;
|
||||||
enemyHit[i].active = true;
|
enemyHit[i].active = true;
|
||||||
|
|
||||||
|
@ -2317,7 +2305,6 @@ void UpdateGameplayScreen(void)
|
||||||
enemyHit[i].speed = (Vector2){ owl[i].x, owl[i].y };
|
enemyHit[i].speed = (Vector2){ owl[i].x, owl[i].y };
|
||||||
enemyHit[i].size = (float)GetRandomValue(5, 10)/30;
|
enemyHit[i].size = (float)GetRandomValue(5, 10)/30;
|
||||||
enemyHit[i].rotation = 0.0f;
|
enemyHit[i].rotation = 0.0f;
|
||||||
//enemyHit[i].color = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
|
|
||||||
enemyHit[i].alpha = 1.0f;
|
enemyHit[i].alpha = 1.0f;
|
||||||
enemyHit[i].active = true;
|
enemyHit[i].active = true;
|
||||||
|
|
||||||
|
@ -2392,8 +2379,6 @@ void UpdateGameplayScreen(void)
|
||||||
thisFrameKoala = 0;
|
thisFrameKoala = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (curFrameKoala > 1) curFrameKoala = ;
|
|
||||||
|
|
||||||
if (curFrameKoala <= 1) koalaAnimationTransform.x = gameplay_koala_transform.x + koalaAnimationTransform.width*curFrameKoala;
|
if (curFrameKoala <= 1) koalaAnimationTransform.x = gameplay_koala_transform.x + koalaAnimationTransform.width*curFrameKoala;
|
||||||
|
|
||||||
if (transAniCounter >= 5)
|
if (transAniCounter >= 5)
|
||||||
|
@ -2407,8 +2392,7 @@ void UpdateGameplayScreen(void)
|
||||||
finalColor = RED;
|
finalColor = RED;
|
||||||
finalColor2 = WHITE;
|
finalColor2 = WHITE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (!transBackAnim)
|
|
||||||
{
|
{
|
||||||
finalColor = WHITE;
|
finalColor = WHITE;
|
||||||
finalColor2 = RED;
|
finalColor2 = RED;
|
||||||
|
@ -2420,9 +2404,7 @@ void UpdateGameplayScreen(void)
|
||||||
thisFrameKoala = 0;
|
thisFrameKoala = 0;
|
||||||
curFrameKoala = 0;
|
curFrameKoala = 0;
|
||||||
speedFX.active = true;
|
speedFX.active = true;
|
||||||
//speedMod = 2;
|
|
||||||
transCount = 0;
|
transCount = 0;
|
||||||
//printf ("THIS ISN'T EVEN MY FINAL FORM");
|
|
||||||
bambooTimer += 15*TIME_FACTOR;
|
bambooTimer += 15*TIME_FACTOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue