add color nicknames

master
Vectozavr 2022-07-22 22:38:05 +07:00
parent 5ad78dfe70
commit 07cab50b6e
2 changed files with 2 additions and 1 deletions

View File

@ -211,7 +211,7 @@ void Shooter::drawStatsTable() {
for (auto &p : allPlayers) { for (auto &p : allPlayers) {
screen->drawText(std::to_string(i) + "\t" + p->playerNickName() + "\t" + std::to_string(p->kills()) + " / " + screen->drawText(std::to_string(i) + "\t" + p->playerNickName() + "\t" + std::to_string(p->kills()) + " / " +
std::to_string(p->deaths()), std::to_string(p->deaths()),
Vec2D{10, 15 + 35.0 * i}, 25, sf::Color(0, 0, 0, 150)); Vec2D{10, 15 + 35.0 * i}, 25, p->color());
i++; i++;
} }

View File

@ -13,6 +13,7 @@ Player::Player(ObjectNameTag name, const std::string &filename, const Vec3D &sca
setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0}); setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0});
setCollision(true); setCollision(true);
setVisible(false); setVisible(false);
setColor(sf::Color(0,0,0));
setCollisionCallBack([this](const ObjectNameTag &tag, std::shared_ptr<RigidBody> obj) { collisionWithObject(tag, obj); }); setCollisionCallBack([this](const ObjectNameTag &tag, std::shared_ptr<RigidBody> obj) { collisionWithObject(tag, obj); });
} }