mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-05 02:49:57 +00:00
fix tile position ingame
This commit is contained in:
@@ -205,10 +205,8 @@ namespace BBM
|
||||
int mapWidth = 16;
|
||||
int mapHeight = 16;
|
||||
int playerCount = 0;
|
||||
int playerID = 0;
|
||||
|
||||
for (auto &[_, lobby] : wal.getScene()->view<LobbyComponent>()) {
|
||||
playerID++;
|
||||
if (lobby.layout == ControllableComponent::NONE)
|
||||
continue;
|
||||
auto &player = Runner::createPlayer(*scene);
|
||||
@@ -219,8 +217,8 @@ namespace BBM
|
||||
auto *model = dynamic_cast<RAY3D::Model *>(player.getComponent<Drawable3DComponent>().drawable.get());
|
||||
model->setTextureToMaterial(MAP_DIFFUSE, "assets/player/textures/" + _colors[lobby.color] + ".png");
|
||||
std::string texturePath = "assets/player/ui/" + _colors[lobby.color] + ".png";
|
||||
int x = (playerID % 2 == 0) ? 1920 - 10 - 320 : 10;
|
||||
int y = playerID > 2 ? 1080 - 10 - 248 : 10;
|
||||
int x = (playerCount % 2 == 0) ? 1920 - 10 - 320 : 10;
|
||||
int y = (playerCount % 3 != 0) ? 1080 - 10 - 248 : 10;
|
||||
scene->addEntity("player color tile")
|
||||
.addComponent<PositionComponent>(x, y - 2, 0)
|
||||
.addComponent<Drawable2DComponent, RAY2D::Rectangle>(x, y, 320, 248, _rayColors[lobby.color]);
|
||||
|
||||
Reference in New Issue
Block a user