aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/maps/stage_1_start.bfm4
-rw-r--r--src/gameplay.cpp5
-rw-r--r--src/gameplay.hpp10
-rw-r--r--src/main.cpp7
4 files changed, 15 insertions, 11 deletions
diff --git a/meta/maps/stage_1_start.bfm b/meta/maps/stage_1_start.bfm
index 74e68d9..91ca04e 100644
--- a/meta/maps/stage_1_start.bfm
+++ b/meta/maps/stage_1_start.bfm
@@ -1,4 +1,4 @@
BOSS 0 0
-ENEMIES 40 20
-WAVES 2 20
+ENEMIES 10 20
+WAVES 2 5
NEXT stage_1_1.bfm
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index 49b86cc..88da5ec 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -57,6 +57,7 @@ Game::Game(std::string const& path) : current(path) {
}
ifs.close();
enemies = new std::vector<Entity>;
+ InitAudioDevice();
AWeapon* shotty = new wp_shotty(SHOTTY_BANG,
SHOTTY_RELOAD
@@ -94,7 +95,6 @@ Game::Game(std::string const& path) : current(path) {
player->radius = 10;
player->victims = 0;
player->fury = 0;
- InitAudioDevice();
crosshair = LoadTexture(CROSSHAIR_TEX);
@@ -109,6 +109,7 @@ Game::Game(std::string const& path) : current(path) {
player->idleTex = LoadTexture(MUCHACHO_TEX);
}
+
Game::~Game() {
delete enemies;
delete player;
@@ -132,7 +133,7 @@ void Game::draw() {
cam.target.x = player->posX;
EndMode2D();
- auto texSize = (enemies->at(0).radius / 40.0f);
+
for (auto& en : *enemies) {
DrawCircle(en.posX, en.posY, en.radius, GREEN);
if (en.hp == 0)
diff --git a/src/gameplay.hpp b/src/gameplay.hpp
index a403661..7567efc 100644
--- a/src/gameplay.hpp
+++ b/src/gameplay.hpp
@@ -38,10 +38,10 @@
// TODO: boss textures
-#define COOLPURPLE \
- CLITERAL(Color) { 170, 153, 255, 255 } // cool Purple
// #define COOLPURPLE \
-// CLITERAL(Color) { 153, 0, 0, 255 } // cool Purple
+// 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
@@ -54,8 +54,6 @@ class Game {
std::vector<Entity>* enemies;
- std::vector<Terrain*>* terrain;
-
Entity* player;
std::string next; // next level
@@ -69,7 +67,7 @@ class Game {
Vector2 origin;
Texture2D crosshair;
- // Texture2D background;
+
public:
Game(std::string const& path);
diff --git a/src/main.cpp b/src/main.cpp
index 488de95..5d7c3be 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -25,6 +25,8 @@ int main(void) {
Game* game = nullptr;
+
+ Texture2D background = LoadTexture("../meta/media/sprites/background.png");
std::string path = "../meta/maps";
int i = 0;
for (const auto& entry :
@@ -103,10 +105,11 @@ int main(void) {
}
BeginDrawing();
- ClearBackground(COOLPURPLE);
+ // ClearBackground(COOLPURPLE);
switch (gs) {
case (TITLE): {
+ ClearBackground(COOLPURPLE);
DrawRectangle(200, 100, 1200, 700, RAYWHITE);
DrawRectangle(250, 150, 1100, 600, COOLPURPLE);
DrawText("THRESHOLD", 260, 160, 30, RAYWHITE);
@@ -116,6 +119,7 @@ int main(void) {
break;
}
case (PICK): {
+ ClearBackground(COOLPURPLE);
DrawRectangle(200, 100, 1200, 700, RAYWHITE);
DrawRectangle(250, 150, 1100, 600, COOLPURPLE);
DrawRectangle(300, 200, 1000, 500, RAYWHITE);
@@ -139,6 +143,7 @@ int main(void) {
break;
}
case (GAMEPLAY): {
+ DrawTexture(background, 0, 0, WHITE);
if (auto code = game->getKeys()) {
if (code == 1) // death
{