lobby: add background tiles with color code

This commit is contained in:
arthur.jamet
2021-06-11 15:58:43 +02:00
parent db8377ff4f
commit a1eb7be98b
+4
View File
@@ -359,7 +359,11 @@ namespace BBM
entity.getComponent<Drawable2DComponent>().drawable->setColor(ORANGE);
});
static const std::vector<RAY::Color> colors = { BLUE, RED, GREEN, YELLOW };
for (int i = 0; i < 4; i++) {
auto &playerTile = scene->addEntity("player tile")
.addComponent<PositionComponent>(224 * (i + 1) + 200 * i, 1080 / 3, 0)
.addComponent<Drawable2DComponent, RAY2D::Rectangle>(RAY::Vector2(224 * (i + 1) + 200 * i, 1080 / 3), RAY::Vector2(200, 200), colors[i]);
auto &player = scene->addEntity("player")
.addComponent<PositionComponent>(224 * (i + 1) + 200 * i, 1080 / 3, 0)
.addComponent<Drawable2DComponent, RAY::Texture>("assets/player/icons/none.png");