feat: add working shapes
This commit is contained in:
@@ -87,7 +87,7 @@ const TowerStats* getTowerStats(TowerType type, TowerLevel level);
|
||||
|
||||
typedef std::uint16_t TowerID;
|
||||
|
||||
class Tower : public utils::shape::Point {
|
||||
class Tower : public utils::shape::Circle {
|
||||
private:
|
||||
TowerID m_ID;
|
||||
TowerType m_Type;
|
||||
@@ -96,9 +96,9 @@ private:
|
||||
protected:
|
||||
utils::CooldownTimer m_Timer;
|
||||
public:
|
||||
Tower(TowerID id, TowerType type, std::int32_t x, std::int32_t y, PlayerID builder) : utils::shape::Point(x, y), m_ID(id), m_Type(type), m_Builder(builder),
|
||||
Tower(TowerID id, TowerType type, std::int32_t x, std::int32_t y, PlayerID builder) : utils::shape::Circle(x + 0.5f, y + 0.5f, 0), m_ID(id), m_Type(type), m_Builder(builder),
|
||||
m_Timer(getStats()->getDamageRate() * 1000) { // converting seconds to millis
|
||||
|
||||
setRadius(getStats()->getRange());
|
||||
}
|
||||
|
||||
virtual TowerType getType() const = 0;
|
||||
@@ -110,6 +110,7 @@ public:
|
||||
m_Level.setPath(path);
|
||||
m_Timer.setCooldown(getStats()->getDamageRate() * 1000); // converting seconds to millis
|
||||
m_Timer.reset();
|
||||
setRadius(getStats()->getRange());
|
||||
}
|
||||
|
||||
std::uint16_t getID() const { return m_ID; }
|
||||
|
||||
Reference in New Issue
Block a user