feat: implement shapes for entities

This commit is contained in:
2021-11-21 20:00:35 +01:00
parent a716e46c64
commit 070749e685
11 changed files with 92 additions and 70 deletions

View File

@@ -9,7 +9,7 @@ namespace game {
bool Tower::isMobInRange(MobPtr mob) {
if (mob->isDead())
return false;
return (m_X - mob->getX()) * (m_X - mob->getX()) + (m_Y - mob->getY()) * (m_Y - mob->getY()) < (getStats()->getRange() * getStats()->getRange());
return mob->collidesWith(*this);
}
const std::map<std::pair<TowerType, TowerLevel>, TowerStats> TowerConstants = {