diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/entity.cpp | 16 | ||||
-rw-r--r-- | src/gameplay.cpp | 4 | ||||
-rw-r--r-- | src/gameplay.hpp | 5 |
3 files changed, 17 insertions, 8 deletions
diff --git a/src/entity.cpp b/src/entity.cpp index 8427479..9892b0b 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -16,25 +16,25 @@ Entity::Entity(int const& h) : hp(h) { switch (dir) { case (0): { posX = - GetRandomValue((SCREENWIDTH / 2) - 30, (SCREENWIDTH / 2) + 30); + GetRandomValue((SCREENWIDTH / 2) - 300, (SCREENWIDTH / 2) + 300); posY = GetRandomValue(0, 40); break; } case (1): { - posX = GetRandomValue(SCREENWIDTH - 20, SCREENWIDTH + 20); - posY = GetRandomValue((SCREENHEIGHT / 2) - 30, - (SCREENHEIGHT / 2) + 30); + posX = GetRandomValue(SCREENWIDTH - 200, SCREENWIDTH + 200); + posY = GetRandomValue((SCREENHEIGHT / 2) - 300, + (SCREENHEIGHT / 2) + 300); break; } case (2): { posX = - GetRandomValue((SCREENWIDTH / 2) - 30, (SCREENWIDTH / 2) + 30); - posY = GetRandomValue(SCREENHEIGHT - 20, SCREENHEIGHT + 20); + GetRandomValue((SCREENWIDTH / 2) - 300, (SCREENWIDTH / 2) + 300); + posY = GetRandomValue(SCREENHEIGHT - 200, SCREENHEIGHT + 200); break; } case (3): { - posX = GetRandomValue(SCREENWIDTH - 20, SCREENWIDTH + 20); - posY = GetRandomValue((SCREENHEIGHT / 2), (SCREENHEIGHT / 2) + 10); + posX = GetRandomValue(SCREENWIDTH - 200, SCREENWIDTH + 200); + posY = GetRandomValue((SCREENHEIGHT / 2), (SCREENHEIGHT / 2) + 100); break; } } diff --git a/src/gameplay.cpp b/src/gameplay.cpp index b4c6477..49b86cc 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -215,6 +215,10 @@ int Game::tick() { en->posY += 2.1f; en->direction.y += 0.1f; } + // if ((GetRandomValue(0, 100) == 50) && (en->currentWeapon != nullptr)) { + // std::cout << "spawn enemy" << std::endl; + // en->currentWeapon->bang(enemies, &(*en)); + // } } else { if (en->posX >= SCREENWIDTH || en->posX <= 0 || en->posY >= SCREENHEIGHT) { diff --git a/src/gameplay.hpp b/src/gameplay.hpp index 6fadb79..a403661 100644 --- a/src/gameplay.hpp +++ b/src/gameplay.hpp @@ -34,10 +34,14 @@ #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 #define COOLPURPLE \ CLITERAL(Color) { 170, 153, 255, 255 } // cool Purple +// #define COOLPURPLE \ +// CLITERAL(Color) { 153, 0, 0, 255 } // cool Purple class Game { int nEnemies; // number of enemies on given level @@ -65,6 +69,7 @@ class Game { Vector2 origin; Texture2D crosshair; + // Texture2D background; public: Game(std::string const& path); |