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

@@ -97,8 +97,8 @@ GL::VertexArray loadWorldModel(const td::game::World* world) {
for (int spawnColor = 0; spawnColor < 2; spawnColor++) {
const game::Spawn& spawn = world->getTeam(game::TeamColor(spawnColor)).getSpawn();
float fromX = spawn.x - 2, toX = spawn.x + 3;
float fromY = spawn.y - 2, toY = spawn.y + 3;
float fromX = spawn.getTopLeft().getX() , toX = spawn.getBottomRight().getX();
float fromY = spawn.getTopLeft().getY() , toY = spawn.getBottomRight().getY();
positions.insert(positions.end(), {
fromX, fromY,
@@ -125,8 +125,8 @@ GL::VertexArray loadWorldModel(const td::game::World* world) {
for (int castleColor = 0; castleColor < 2; castleColor++) {
const game::TeamCastle& castle = world->getTeam(game::TeamColor(castleColor)).getCastle();
float fromX = castle.x - 2, toX = castle.x + 3;
float fromY = castle.y - 2, toY = castle.y + 3;
float fromX = castle.getTopLeft().getX(), toX = castle.getBottomRight().getX();
float fromY = castle.getTopLeft().getY(), toY = castle.getBottomRight().getY();
positions.insert(positions.end(), {
fromX, fromY,