diff options
-rw-r--r-- | meta/maps/savestate | 1 | ||||
-rw-r--r-- | meta/maps/stage_1_1.bfm | 4 | ||||
-rw-r--r-- | meta/maps/stage_1_boss.bfm | 2 | ||||
-rw-r--r-- | meta/maps/stage_1_start.bfm | 4 | ||||
-rw-r--r-- | meta/media/sprites/boss_dead.png | bin | 0 -> 1973 bytes | |||
-rw-r--r-- | meta/media/sprites/boss_hurt.png | bin | 0 -> 1995 bytes | |||
-rw-r--r-- | meta/media/sprites/boss_idle.png | bin | 0 -> 2034 bytes | |||
-rw-r--r-- | src/gameplay.cpp | 22 | ||||
-rw-r--r-- | src/gameplay.hpp | 7 |
9 files changed, 22 insertions, 18 deletions
diff --git a/meta/maps/savestate b/meta/maps/savestate deleted file mode 100644 index db0d1b1..0000000 --- a/meta/maps/savestate +++ /dev/null @@ -1 +0,0 @@ -../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm../meta/maps/stage_1_start.bfm
\ No newline at end of file diff --git a/meta/maps/stage_1_1.bfm b/meta/maps/stage_1_1.bfm index e49a396..61008a4 100644 --- a/meta/maps/stage_1_1.bfm +++ b/meta/maps/stage_1_1.bfm @@ -1,5 +1,5 @@ BOSS 0 0 -ENEMIES 15 20 -WAVES 1 15 +ENEMIES 20 20 +WAVES 2 10 NEXT stage_1_boss.bfm BACKGROUND ../meta/media/sprites/stage_1_regbg.png diff --git a/meta/maps/stage_1_boss.bfm b/meta/maps/stage_1_boss.bfm index a58e482..c5af193 100644 --- a/meta/maps/stage_1_boss.bfm +++ b/meta/maps/stage_1_boss.bfm @@ -1,4 +1,4 @@ -BOSS 1 3 +BOSS 1 10 ENEMIES 2 100 WAVES 1 2 NEXT stage_1_boss.bfm diff --git a/meta/maps/stage_1_start.bfm b/meta/maps/stage_1_start.bfm index 7a6b2bf..43aeea8 100644 --- a/meta/maps/stage_1_start.bfm +++ b/meta/maps/stage_1_start.bfm @@ -1,5 +1,5 @@ BOSS 0 0 -ENEMIES 10 20 -WAVES 2 5 +ENEMIES 20 20 +WAVES 4 5 NEXT stage_1_1.bfm BACKGROUND ../meta/media/sprites/stage_1_regbg.png diff --git a/meta/media/sprites/boss_dead.png b/meta/media/sprites/boss_dead.png Binary files differnew file mode 100644 index 0000000..e607ec3 --- /dev/null +++ b/meta/media/sprites/boss_dead.png diff --git a/meta/media/sprites/boss_hurt.png b/meta/media/sprites/boss_hurt.png Binary files differnew file mode 100644 index 0000000..c99ed4c --- /dev/null +++ b/meta/media/sprites/boss_hurt.png diff --git a/meta/media/sprites/boss_idle.png b/meta/media/sprites/boss_idle.png Binary files differnew file mode 100644 index 0000000..975dbe0 --- /dev/null +++ b/meta/media/sprites/boss_idle.png diff --git a/src/gameplay.cpp b/src/gameplay.cpp index ba1c07a..983afa0 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -74,8 +74,8 @@ Game::Game(std::string const& path) : current(path) { ); for (auto i = 0; i < nPerWave; i++) { - if (ehp == 0) { - Entity en(1); + if (ehp == 1) { + Entity en(ehp); en.radius = radius; en.idleTex = LoadTexture(SBIRE_TEX_IDLE); en.hurtTex = LoadTexture(SBIRE_TEX_HURT); @@ -86,8 +86,8 @@ Game::Game(std::string const& path) : current(path) { en.radius = radius; en.wp[0] = shotty; en.currentWeapon = en.wp[0]; - en.idleTex = LoadTexture(SBIRE_TEX_IDLE); - en.hurtTex = LoadTexture(SBIRE_TEX_HURT); + en.idleTex = LoadTexture(BOSS_TEX_IDLE); + en.hurtTex = LoadTexture(BOSS_TEX_HURT); enemies->push_back(en); // legacy code. TODO: remove AKchually no } } @@ -133,10 +133,10 @@ void Game::draw() { for (auto& en : *enemies) { if (en.hp == 0) - DrawTextureEx(en.hurtTex, (Vector2){en.posX - 20, en.posY - 20}, + DrawTextureEx(en.hurtTex, (Vector2){en.posX - en.radius, en.posY - en.radius}, 1.0f, 0.6f, WHITE); else { - DrawTextureEx(en.idleTex, (Vector2){en.posX - 20, en.posY - 20}, + DrawTextureEx(en.idleTex, (Vector2){en.posX - en.radius, en.posY - en.radius}, 1.0f, 0.6f, WHITE); } } @@ -158,6 +158,13 @@ void Game::draw() { for (auto i = 0; i < player->currentWeapon->barrel; i++) { DrawRectangle(40 + (i * 20), SCREENHEIGHT - 60, 10, 30, RED); } + if (enemies->at(0).hp >= 2) { + for (auto i = 0; i < enemies->size(); i++) { + for (auto j = 0; j < enemies->at(i).hp; j++) { + DrawRectangle(400 + (j * 40), 80 + (i * 40), 40, 30, COOLPURPLE); + } + } + } } // progress the game & check for player death @@ -176,15 +183,12 @@ int Game::tick() { if (player->victims == nPerWave && nWaves > 1) { nWaves--; - std::cout << "DEBUG : waves left [" << nWaves << std::endl; - std::cout << "DEBUG : victims [" << nWaves << std::endl; for (int i = 0 ; i < nPerWave; i++) { Entity en(1); en.radius = 20; en.idleTex = LoadTexture(SBIRE_TEX_IDLE); en.hurtTex = LoadTexture(SBIRE_TEX_HURT); enemies->push_back(en); - std::cout << "DEBUG : spawn new enemy [" << i << std::endl; } } diff --git a/src/gameplay.hpp b/src/gameplay.hpp index 4f16504..5d02e4c 100644 --- a/src/gameplay.hpp +++ b/src/gameplay.hpp @@ -34,9 +34,10 @@ #define SBIRE_TEX_IDLE "../meta/media/sprites/sbire_idle.png" #define SBIRE_TEX_HURT "../meta/media/sprites/sbire_hurt.png" -#define BACKGROUND_TEX "../meta/media/sprites/background.png" - -// TODO: boss textures +// boss textures +#define BOSS_TEX_IDLE "../meta/media/sprites/boss_idle.png" +#define BOSS_TEX_HURT "../meta/media/sprites/boss_hurt.png" +#define BOSS_TEX_DEAD "../meta/media/sprites/boss_hurt.png" // #define COOLPURPLE \ // CLITERAL(Color) { 170, 153, 255, 255 } // cool Purple |