added new title music & agnostic struct array compare function

This commit is contained in:
Return0ne 2022-10-17 18:21:21 -04:00
parent b9ba62c4c8
commit b897b23b1b
5 changed files with 2698 additions and 50 deletions

View File

@ -44,7 +44,7 @@ RAYLIB_LIB_PATH ?= /usr/local/lib
RAYLIB_LIBTYPE ?= STATIC
# Build mode for project: DEBUG or RELEASE
BUILD_MODE ?= RELEASE
BUILD_MODE ?= DEBUG
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
# NOTE: This variable is only used for PLATFORM_OS: LINUX

View File

@ -5,9 +5,6 @@ A dumb raylib test which you can play [here](https://canneddonuts.itch.io/avoid-
- a build guide
- a tutorial
## Note
This game's code more specifically 'Main.c' is a retyped version of this [repo](https://github.com/raysan5/raylib-game-template) which is code under the zlib license.
## Preview
![Alt Text](./doc-assets/preview.png)
![Alt Text](./doc-assets/preview1.png)

File diff suppressed because it is too large Load Diff

View File

@ -21,14 +21,14 @@ int score = 0, bestscore = 0, finishfromGameplayScreen = 0, redfeathers = 0, gre
Music Gameplaysong = { 0 };
bool CheckFireworkActivity(void)
bool CheckAttackActivity(struct Attack attack[], int val, int max)
{
int matches = 0, val = 0;
for (int i = 0; i < MAX_FIREWORKS; i++) {
if (fireworks[i].active == val) matches++;
int matches = 0;
for (int i = 0; i < max; i++) {
if (attack[i].active == val) matches++;
}
if (matches == MAX_FIREWORKS) return true;
if (matches == max) return true;
else return false;
}
@ -195,7 +195,7 @@ void UpdateGameplayScreen(void)
if (INPUT_OPTION_PRESSED) pause = !pause;
// code to end the game
if (level > 2) { StopMusicStream(Gameplaysong); finishfromGameplayScreen = 3; }
if (CheckFireworkActivity() && level < 2) { StopMusicStream(Gameplaysong); levelunlocked[nextlevel] = true; finishfromGameplayScreen = 4; }
if (CheckAttackActivity(fireworks, 0, MAX_FIREWORKS) && level < 2) { StopMusicStream(Gameplaysong); levelunlocked[nextlevel] = true; finishfromGameplayScreen = 4; }
if (!mute) UpdateMusicStream(Gameplaysong);
@ -329,7 +329,7 @@ void UpdateGameplayScreen(void)
fireworks[i].active = 0;
fireworkAmount--;
}
}
}
switch (fireworks[i].active) {
case 0:
fireworks[i].hitbox.x = GetScreenWidth() + firework_sprite.width;