Compare commits
No commits in common. "f85084ca2060ab09e8ca0ec0ade6915af3f0d65d" and "5eab405bafd85c6ee17854f193f8eb3d16b04dde" have entirely different histories.
f85084ca20
...
5eab405baf
7 changed files with 32 additions and 17 deletions
Binary file not shown.
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 7.7 KiB |
|
@ -30,11 +30,12 @@ Sound fxfeather = { 0 };
|
||||||
Sound fxboom = { 0 };
|
Sound fxboom = { 0 };
|
||||||
bool pause;
|
bool pause;
|
||||||
bool DebugMode;
|
bool DebugMode;
|
||||||
|
int ammo = 0;
|
||||||
int fireworkAmount = 0;
|
int fireworkAmount = 0;
|
||||||
int GI_callcount = 0;
|
int GI_callcount = 0;
|
||||||
//int trigMov;
|
//int trigMov;
|
||||||
|
|
||||||
int score = 0, bestscore = 0, finishfromGameplayScreen = 0, greenfeathers = 0;
|
int score = 0, bestscore = 0, finishfromGameplayScreen = 0, redfeathers = 0, greenfeathers = 0;
|
||||||
|
|
||||||
Music Gameplaysong = { 0 };
|
Music Gameplaysong = { 0 };
|
||||||
|
|
||||||
|
@ -49,12 +50,12 @@ void LoadGamplayScreen(void)
|
||||||
feather_sprite = LoadTexture("assets/gfx/feather.png");
|
feather_sprite = LoadTexture("assets/gfx/feather.png");
|
||||||
attack_sprite = LoadTexture("assets/gfx/attack.png");
|
attack_sprite = LoadTexture("assets/gfx/attack.png");
|
||||||
firework_sprite = LoadTexture("assets/gfx/firework.png");
|
firework_sprite = LoadTexture("assets/gfx/firework.png");
|
||||||
// Gameplaysong = LoadMusicStream("assets/bgm/03-Boss.ogg");
|
Gameplaysong = LoadMusicStream("assets/bgm/03-Boss.ogg");
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitGameplayScreen(void)
|
void InitGameplayScreen(void)
|
||||||
{
|
{
|
||||||
// PlayMusicStream(Gameplaysong);
|
PlayMusicStream(Gameplaysong);
|
||||||
|
|
||||||
finishfromGameplayScreen = 0;
|
finishfromGameplayScreen = 0;
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ void InitGameplayScreen(void)
|
||||||
globalTimer = 0;
|
globalTimer = 0;
|
||||||
|
|
||||||
if (player.hp < 1) player.hp = 1;
|
if (player.hp < 1) player.hp = 1;
|
||||||
|
//if (ammo < 60) ammo = 60;
|
||||||
|
|
||||||
player.currentframe = 0;
|
player.currentframe = 0;
|
||||||
player.speed = 300.0f;
|
player.speed = 300.0f;
|
||||||
|
@ -142,7 +144,7 @@ void InitGameplayScreen(void)
|
||||||
shoot[i].speed.x = 5000.f;
|
shoot[i].speed.x = 5000.f;
|
||||||
shoot[i].speed.y = 0;
|
shoot[i].speed.y = 0;
|
||||||
shoot[i].active = false;
|
shoot[i].active = false;
|
||||||
shoot[i].color = GREEN;
|
shoot[i].color = RED;
|
||||||
}
|
}
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case LEVEL1: fireworkAmount = 100; break;
|
case LEVEL1: fireworkAmount = 100; break;
|
||||||
|
@ -180,7 +182,7 @@ void UpdateGameplayScreen(void)
|
||||||
finishfromGameplayScreen = 3;
|
finishfromGameplayScreen = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!mute) UpdateMusicStream(Gameplaysong);
|
if (!mute) UpdateMusicStream(Gameplaysong);
|
||||||
|
|
||||||
if (!pause) {
|
if (!pause) {
|
||||||
|
|
||||||
|
@ -194,14 +196,17 @@ void UpdateGameplayScreen(void)
|
||||||
if (player.currentframe != 1) player.currentframe = 2;
|
if (player.currentframe != 1) player.currentframe = 2;
|
||||||
} else player.speed = 300.0f;
|
} else player.speed = 300.0f;
|
||||||
if (INPUT_FIRE_DOWN) {
|
if (INPUT_FIRE_DOWN) {
|
||||||
|
// if (ammo > 0) {
|
||||||
for (int i = 0; i < MAX_SHOOTS; i++) {
|
for (int i = 0; i < MAX_SHOOTS; i++) {
|
||||||
if (!shoot[i].active) {
|
if (!shoot[i].active) {
|
||||||
|
ammo++;
|
||||||
shoot[i].hitbox.x = player.hitbox.x;
|
shoot[i].hitbox.x = player.hitbox.x;
|
||||||
shoot[i].hitbox.y = player.hitbox.y + player.hitbox.height/4;
|
shoot[i].hitbox.y = player.hitbox.y + player.hitbox.height/4;
|
||||||
shoot[i].active = true;
|
shoot[i].active = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// Update sprite positions
|
// Update sprite positions
|
||||||
player.sprite_pos = (Vector2){ player.hitbox.x, player.hitbox.y };
|
player.sprite_pos = (Vector2){ player.hitbox.x, player.hitbox.y };
|
||||||
|
@ -233,9 +238,12 @@ void UpdateGameplayScreen(void)
|
||||||
UpdateiFrameTimer(&player);
|
UpdateiFrameTimer(&player);
|
||||||
// UpdateiFrameTimer(&enemy);
|
// UpdateiFrameTimer(&enemy);
|
||||||
greenfeathers = player.hp;
|
greenfeathers = player.hp;
|
||||||
|
redfeathers = ammo;
|
||||||
|
|
||||||
// Debug stuff
|
// Debug stuff
|
||||||
if (IsKeyPressed(KEY_D)) DebugMode = !DebugMode;
|
if (IsKeyPressed(KEY_D)) DebugMode = !DebugMode;
|
||||||
|
if (IsKeyPressed(KEY_NINE)) ammo = 99;
|
||||||
|
if (IsKeyPressed(KEY_ZERO)) ammo = 0;
|
||||||
if (IsKeyPressed(KEY_G)) finishfromGameplayScreen = 1;
|
if (IsKeyPressed(KEY_G)) finishfromGameplayScreen = 1;
|
||||||
if (IsKeyPressed(KEY_Q)) finishfromGameplayScreen = 4;
|
if (IsKeyPressed(KEY_Q)) finishfromGameplayScreen = 4;
|
||||||
if (IsKeyPressed(KEY_EQUAL)) level++;
|
if (IsKeyPressed(KEY_EQUAL)) level++;
|
||||||
|
@ -256,7 +264,8 @@ void UpdateGameplayScreen(void)
|
||||||
if (level == LEVEL3) { if ((int) globalTimer % 10 == 0) feather.active = true; }
|
if (level == LEVEL3) { if ((int) globalTimer % 10 == 0) feather.active = true; }
|
||||||
else { if ((int) globalTimer % 30 == 0) feather.active = true; }
|
else { if ((int) globalTimer % 30 == 0) feather.active = true; }
|
||||||
switch (feather.power) {
|
switch (feather.power) {
|
||||||
case 0: feather.color = RED; break;
|
case 0: feather.color = GREEN; break;
|
||||||
|
case 1: feather.color = RED; break;
|
||||||
}
|
}
|
||||||
if (feather.active) {
|
if (feather.active) {
|
||||||
if (((feather.hitbox.x + -feather_sprite.width) > GetScreenWidth()
|
if (((feather.hitbox.x + -feather_sprite.width) > GetScreenWidth()
|
||||||
|
@ -264,6 +273,7 @@ void UpdateGameplayScreen(void)
|
||||||
if (CheckCollisionRecs(player.hitbox, feather.hitbox)) {
|
if (CheckCollisionRecs(player.hitbox, feather.hitbox)) {
|
||||||
switch (feather.power) {
|
switch (feather.power) {
|
||||||
case 0: player.hp++; break;
|
case 0: player.hp++; break;
|
||||||
|
case 1: ammo += 60; break;
|
||||||
}
|
}
|
||||||
if (!mute) PlaySoundMulti(fxfeather);
|
if (!mute) PlaySoundMulti(fxfeather);
|
||||||
ResetFeather();
|
ResetFeather();
|
||||||
|
@ -341,8 +351,8 @@ void DrawGameplayScreen(void)
|
||||||
case LEVEL2: DrawTexture(background, 0, 0, ORANGE); break;
|
case LEVEL2: DrawTexture(background, 0, 0, ORANGE); break;
|
||||||
case LEVEL3: DrawTexture(background, 0, 0, RED); break;
|
case LEVEL3: DrawTexture(background, 0, 0, RED); break;
|
||||||
}
|
}
|
||||||
|
DrawFPS(10, 430);
|
||||||
if (DebugMode) {
|
if (DebugMode) {
|
||||||
DrawFPS(10, 430);
|
|
||||||
DrawRectangleLines(player.hitbox.x, player.hitbox.y, player.hitbox.width, player.hitbox.height, BLUE);
|
DrawRectangleLines(player.hitbox.x, player.hitbox.y, player.hitbox.width, player.hitbox.height, BLUE);
|
||||||
DrawRectangleLines(feather.hitbox.x, feather.hitbox.y, feather.hitbox.width, feather.hitbox.height, WHITE);
|
DrawRectangleLines(feather.hitbox.x, feather.hitbox.y, feather.hitbox.width, feather.hitbox.height, WHITE);
|
||||||
//DrawRectangleLines(enemy.hitbox.x, enemy.hitbox.y, enemy.hitbox.width, enemy.hitbox.height, BLACK);
|
//DrawRectangleLines(enemy.hitbox.x, enemy.hitbox.y, enemy.hitbox.width, enemy.hitbox.height, BLACK);
|
||||||
|
@ -371,11 +381,13 @@ void DrawGameplayScreen(void)
|
||||||
}
|
}
|
||||||
// if (level == 2) DrawTextureRec(enemy_sprite, enemy.frameRec, enemy.sprite_pos, enemy.color);
|
// if (level == 2) DrawTextureRec(enemy_sprite, enemy.frameRec, enemy.sprite_pos, enemy.color);
|
||||||
DrawTextureRec(player_sprite, player.frameRec, player.sprite_pos, player.color);
|
DrawTextureRec(player_sprite, player.frameRec, player.sprite_pos, player.color);
|
||||||
DrawTexture(feather_sprite, 0, 0, RED);
|
DrawTexture(feather_sprite, 0, 0, GREEN);
|
||||||
DrawText(TextFormat("= %i", player.hp), 30, 30, 30, RED);
|
DrawText(TextFormat("= %i", player.hp), 30, 30, 30, GREEN);
|
||||||
|
DrawTexture(feather_sprite, 80, 0, RED);
|
||||||
|
DrawText(TextFormat("= %i", ammo), 110, 30, 30, RED);
|
||||||
// if (level == 2) DrawText(TextFormat("ENEMY HP: %i", enemy.hp), GetScreenWidth() - 380, 0, 20, RED);
|
// if (level == 2) DrawText(TextFormat("ENEMY HP: %i", enemy.hp), GetScreenWidth() - 380, 0, 20, RED);
|
||||||
// DrawText(TextFormat("FIREWORKS LEFT: %i", fireworkAmount), GetScreenWidth() - 240, 0, 20, GREEN);
|
DrawText(TextFormat("FIREWORKS LEFT: %i", fireworkAmount), GetScreenWidth() - 240, 0, 20, GREEN);
|
||||||
if (score > 500000) DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, (Color){ 222, 181, 0, 255 });
|
if (score >= 10000) DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, (Color){ 222, 181, 0, 255 });
|
||||||
else DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, BLUE);
|
else DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, BLUE);
|
||||||
if (pause && (((int)pauseTimer/30)%2)) DrawTextEx(ZadoBold, "PAUSED", (Vector2){ 280, 160 }, 60, 2, WHITE);
|
if (pause && (((int)pauseTimer/30)%2)) DrawTextEx(ZadoBold, "PAUSED", (Vector2){ 280, 160 }, 60, 2, WHITE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,9 +38,11 @@ void DrawLevelSelScreen(void)
|
||||||
{
|
{
|
||||||
DrawTexture(background, 0, 0, GRAY);
|
DrawTexture(background, 0, 0, GRAY);
|
||||||
|
|
||||||
DrawTexture(feather_sprite, 0, 0, RED);
|
DrawTexture(feather_sprite, 0, 0, GREEN);
|
||||||
DrawText(TextFormat("= %i", greenfeathers), 30, 30, 30, RED);
|
DrawText(TextFormat("= %i", greenfeathers), 30, 30, 30, GREEN);
|
||||||
if (score > 500000) DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, (Color){ 222, 181, 0, 255 });
|
DrawTexture(feather_sprite, 80, 0, RED);
|
||||||
|
DrawText(TextFormat("= %i", redfeathers), 110, 30, 30, RED);
|
||||||
|
if (score >= 10000) DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, (Color){ 222, 181, 0, 255 });
|
||||||
else DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, BLUE);
|
else DrawText(TextFormat("SCORE: %i", score), 10, 65, 30, BLUE);
|
||||||
|
|
||||||
if (levelSelected == 0) DrawText("1", 100, 220, 60, WHITE);
|
if (levelSelected == 0) DrawText("1", 100, 220, 60, WHITE);
|
||||||
|
|
|
@ -97,8 +97,8 @@ static void update_transition(void)
|
||||||
if (!transFadeOut) {
|
if (!transFadeOut) {
|
||||||
transAlpha += GetFrameTime();
|
transAlpha += GetFrameTime();
|
||||||
|
|
||||||
if (transAlpha > 1) {
|
if (transAlpha > 0.76f) {
|
||||||
transAlpha = 1;
|
transAlpha = 0.75f;
|
||||||
|
|
||||||
switch (transFromScreen) {
|
switch (transFromScreen) {
|
||||||
case TITLE: UnloadTitleScreen(); break;
|
case TITLE: UnloadTitleScreen(); break;
|
||||||
|
@ -129,7 +129,7 @@ static void update_transition(void)
|
||||||
} else {
|
} else {
|
||||||
transAlpha -= GetFrameTime();
|
transAlpha -= GetFrameTime();
|
||||||
|
|
||||||
if (transAlpha < 0) {
|
if (transAlpha < -0.75f) {
|
||||||
transAlpha = 0.0f;
|
transAlpha = 0.0f;
|
||||||
transFadeOut = false;
|
transFadeOut = false;
|
||||||
onTransition = false;
|
onTransition = false;
|
||||||
|
|
|
@ -11,5 +11,6 @@
|
||||||
|
|
||||||
extern int score;
|
extern int score;
|
||||||
extern int greenfeathers;
|
extern int greenfeathers;
|
||||||
|
extern int redfeathers;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue