From c79ba00b2085af8a775567276ce30f26a3515da3 Mon Sep 17 00:00:00 2001 From: Nimac0 Date: Tue, 30 Jan 2024 15:40:53 +0100 Subject: [PATCH] minor balancing to powerups and shooting speed --- include/Constants.h | 4 ++-- include/KeyboardController.h | 2 +- src/Game.cpp | 4 ++-- src/KeyboardController.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/Constants.h b/include/Constants.h index fababc7..81eddf2 100644 --- a/include/Constants.h +++ b/include/Constants.h @@ -7,7 +7,7 @@ using Team = std::size_t; constexpr std::size_t MAX_COMPONENTS = 32; constexpr std::size_t MAX_GROUPS = 32; -constexpr std::size_t MAX_STATS = 32; +constexpr std::size_t MAX_STATS = 8; constexpr std::size_t MAX_TEAMS = 8; constexpr int SCREEN_SIZE_HEIGHT = 640; @@ -20,7 +20,7 @@ constexpr int TILE_SIZE = 32; constexpr int MAP_SIZE_X = 25; constexpr int MAP_SIZE_Y = 20; -constexpr int SPAWN_ATTEMPTS = 30; +constexpr int SPAWN_ATTEMPTS = 20; constexpr int BUFF_DURATION = 6000; diff --git a/include/KeyboardController.h b/include/KeyboardController.h index eb36173..745972e 100644 --- a/include/KeyboardController.h +++ b/include/KeyboardController.h @@ -23,7 +23,7 @@ public: //for attack cooldown in between shots uint32_t lastFireTime; - uint32_t fireCooldown = 800; //in ms can be adjusted to change possible attack-speed + uint32_t fireCooldown = 1000; //in ms can be adjusted to change possible attack-speed KeyboardController() = default; KeyboardController(SDL_Scancode up, SDL_Scancode down, SDL_Scancode left, SDL_Scancode right, SDL_Scancode fire, Vector2D fireVelocity); diff --git a/src/Game.cpp b/src/Game.cpp index c0045c8..27c68ff 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -119,7 +119,7 @@ void Game::init(const char* title, int xpos, int ypos, int width, int height, bo player1.setTeam(TeamLabel::BLUE); player1.addComponent(80,80,2); //posx, posy, scale player1.addComponent("assets/chicken_knight_spritesheet.png", true); //adds sprite (32x32px), path needed - player1.addComponent(SDL_SCANCODE_W, SDL_SCANCODE_S, SDL_SCANCODE_A, SDL_SCANCODE_D, SDL_SCANCODE_E, Vector2D(1, 0));//custom keycontrols can be added + player1.addComponent(SDL_SCANCODE_W, SDL_SCANCODE_S, SDL_SCANCODE_A, SDL_SCANCODE_D, SDL_SCANCODE_E, Vector2D(2, 0));//custom keycontrols can be added player1.addComponent("player", 0.8f); //adds tag (for further use, reference tag) player1.addComponent(5, Direction::LEFT); player1.addComponent(); @@ -129,7 +129,7 @@ void Game::init(const char* title, int xpos, int ypos, int width, int height, bo player2.setTeam(TeamLabel::RED); player2.addComponent(600, 500, 2); player2.addComponent("assets/chicken_spritesheet.png", true); - player2.addComponent(SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_RCTRL, Vector2D(-1, 0)); + player2.addComponent(SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_RCTRL, Vector2D(-2, 0)); player2.addComponent("enemy", 0.8f); player2.addComponent(5, Direction::RIGHT); player2.addComponent(); diff --git a/src/KeyboardController.cpp b/src/KeyboardController.cpp index f3466a6..1a9c211 100644 --- a/src/KeyboardController.cpp +++ b/src/KeyboardController.cpp @@ -59,12 +59,12 @@ void KeyboardController::update() if (fireVelocity.x > 0) { sprite->setDirection(Direction::RIGHT); Game::assets->createProjectile(Vector2D(player->position.x, player->position.y), fireVelocity, - false, 1, 180, 1, "assets/egg.png", this->entity->getTeam()); + false, 1, 180, 2, "assets/egg.png", this->entity->getTeam()); } else { sprite->setDirection(Direction::LEFT); Game::assets->createProjectile(Vector2D(player->position.x, player->position.y), fireVelocity, - true, 1, 180, 1, "assets/egg.png", this->entity->getTeam()); + true, 1, 180, 2, "assets/egg.png", this->entity->getTeam()); } lastFireTime = currentTicks;