Build first scene skeleton
This commit is contained in:
@@ -24,6 +24,19 @@ void drawOutline(const frostbite2D::Rect& rect, const frostbite2D::Color& color,
|
||||
color);
|
||||
}
|
||||
|
||||
void drawCross(const frostbite2D::Vec2& position,
|
||||
const frostbite2D::Color& color) {
|
||||
constexpr float kSize = 18.0f;
|
||||
constexpr float kThickness = 3.0f;
|
||||
drawRect(frostbite2D::Rect(position.x - kSize * 0.5f,
|
||||
position.y - kThickness * 0.5f, kSize,
|
||||
kThickness),
|
||||
color);
|
||||
drawRect(frostbite2D::Rect(position.x - kThickness * 0.5f,
|
||||
position.y - kSize * 0.5f, kThickness, kSize),
|
||||
color);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void DebugOverlay::Render(const LevelDefinition& level, const DebugFlags& flags,
|
||||
@@ -31,6 +44,12 @@ void DebugOverlay::Render(const LevelDefinition& level, const DebugFlags& flags,
|
||||
if (flags.showCollision) {
|
||||
drawCollision(level);
|
||||
}
|
||||
if (flags.showBattleZones) {
|
||||
drawBattleZones(level);
|
||||
}
|
||||
if (flags.showSpawnPoints) {
|
||||
drawSpawnPoints(level);
|
||||
}
|
||||
if (flags.showActorBounds && playerBounds) {
|
||||
drawActorBounds(*playerBounds);
|
||||
}
|
||||
@@ -46,4 +65,21 @@ void DebugOverlay::drawActorBounds(const frostbite2D::Rect& bounds) const {
|
||||
drawOutline(bounds, frostbite2D::Color(1.0f, 0.78f, 0.1f, 0.9f));
|
||||
}
|
||||
|
||||
void DebugOverlay::drawBattleZones(const LevelDefinition& level) const {
|
||||
for (const BattleZoneDefinition& zone : level.battleZones) {
|
||||
drawOutline(zone.trigger, frostbite2D::Color(0.95f, 0.25f, 0.25f, 0.9f),
|
||||
3.0f);
|
||||
drawOutline(zone.cameraBounds,
|
||||
frostbite2D::Color(0.25f, 0.55f, 1.0f, 0.75f), 2.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void DebugOverlay::drawSpawnPoints(const LevelDefinition& level) const {
|
||||
for (const BattleZoneDefinition& zone : level.battleZones) {
|
||||
for (const SpawnPoint& spawn : zone.enemySpawns) {
|
||||
drawCross(spawn.position, frostbite2D::Color(1.0f, 0.2f, 0.9f, 0.95f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ns_game
|
||||
|
||||
Reference in New Issue
Block a user