Compare commits
2 Commits
bc9239174a
...
b897b23b1b
Author | SHA1 | Date |
---|---|---|
Return0ne | b897b23b1b | |
Return0ne | b9ba62c4c8 |
2
Makefile
2
Makefile
|
@ -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
|
||||
|
|
|
@ -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
Binary file not shown.
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,8 @@ void InitGameplayScreen(void)
|
|||
|
||||
finishfromGameplayScreen = 0;
|
||||
|
||||
nextlevel = level + 1;
|
||||
|
||||
globalTimer = 0;
|
||||
|
||||
if (player.hp < 1) player.hp = 1;
|
||||
|
@ -193,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; nextlevel++; finishfromGameplayScreen = 4; }
|
||||
if (CheckAttackActivity(fireworks, 0, MAX_FIREWORKS) && level < 2) { StopMusicStream(Gameplaysong); levelunlocked[nextlevel] = true; finishfromGameplayScreen = 4; }
|
||||
|
||||
if (!mute) UpdateMusicStream(Gameplaysong);
|
||||
|
||||
|
@ -308,6 +310,8 @@ void UpdateGameplayScreen(void)
|
|||
enemy.hitbox.y = GetRandomValue(0, GetScreenHeight());
|
||||
shoot[i].active = false;
|
||||
}
|
||||
if (((shoot[i].hitbox.x + -attack_sprite.width) > GetScreenWidth()
|
||||
|| (shoot[i].hitbox.x <= -attack_sprite.width))) shoot[i].active = 0;
|
||||
}
|
||||
|
||||
if (enemy.hp < 1) { level++; enemy.hp = 5; }
|
||||
|
@ -319,14 +323,13 @@ void UpdateGameplayScreen(void)
|
|||
DamageActor(&player);
|
||||
fireworks[i].active = 0;
|
||||
}
|
||||
/* for (int j = 0; j < MAX_SHOOTS; j++) {
|
||||
for (int j = 0; j < MAX_SHOOTS; j++) {
|
||||
if (CheckCollisionRecs(shoot[j].hitbox, fireworks[i].hitbox) && shoot[j].active) {
|
||||
if (!mute) PlaySoundMulti(enemy.fxhit);
|
||||
fireworks[i].active = 0;
|
||||
fireworkAmount--;
|
||||
shoot[j].active = 0;
|
||||
}
|
||||
} */
|
||||
}
|
||||
switch (fireworks[i].active) {
|
||||
case 0:
|
||||
fireworks[i].hitbox.x = GetScreenWidth() + firework_sprite.width;
|
||||
|
|
|
@ -18,8 +18,6 @@ bool levelunlocked[3] = {1, 0 , 0};
|
|||
|
||||
void InitLevelSelScreen(void)
|
||||
{
|
||||
nextlevel = level + 1;
|
||||
|
||||
feather_sprite = LoadTexture("assets/gfx/feather.png");
|
||||
finishfromLevelSelScreen = 0;
|
||||
}
|
||||
|
@ -59,7 +57,7 @@ void DrawLevelSelScreen(void)
|
|||
else DrawText("3", 300, 220, 60, GRAY);
|
||||
|
||||
// printf("%d, %d, %d\n", levelunlocked[0], levelunlocked[1], levelunlocked[2]);
|
||||
printf("%d\n", levelunlocked[nextlevel]);
|
||||
// printf("%d\n", levelunlocked[nextlevel]);
|
||||
}
|
||||
|
||||
void UnloadLevelSelScreen(void)
|
||||
|
|
Loading…
Reference in New Issue