mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-28 16:43:29 +00:00
fix print and useless operation
This commit is contained in:
@@ -76,7 +76,6 @@ namespace BBM {
|
||||
float value = (distribution(generator) / 10);
|
||||
BonusType bonus = NOTHING;
|
||||
|
||||
std::cout << value << std::endl;
|
||||
for (auto &chance : chanceValue)
|
||||
if (chance.second > value)
|
||||
bonus = chance.first;
|
||||
|
||||
@@ -261,7 +261,6 @@ namespace BBM
|
||||
|
||||
scene->addEntity("Floor")
|
||||
.addComponent<PositionComponent>(Vector3f(coords))
|
||||
//.addComponent<CollisionComponent>(1)
|
||||
.addComponent<Drawable3DComponent, RAY3D::Model>(floorObj, false, std::make_pair(MAP_DIFFUSE, floorPng));
|
||||
}
|
||||
|
||||
|
||||
@@ -28,11 +28,9 @@ namespace BBM
|
||||
auto playerHealth = entity->tryGetComponent<HealthComponent>();
|
||||
if (!playerHealth || !playerPos)
|
||||
return;
|
||||
for (auto &[other, pos, _] : this->_wal.getScene()->view<PositionComponent, CollisionComponent>()) {
|
||||
if (other.hasComponent<TagComponent<Player>>())
|
||||
continue;
|
||||
auto vec = playerPos->position.abs() - pos.position.abs();
|
||||
if (vec.abs().x < 0.65 && vec.abs().z < 0.65 && playerPos->position.distance(pos.position) < 1)
|
||||
for (auto &[other, pos, _] : this->_wal.getScene()->view<PositionComponent, TagComponent<Blowable>>()) {
|
||||
auto vec = (playerPos->position - pos.position).abs();
|
||||
if (vec.x < 0.65 && vec.z < 0.65 && playerPos->position.distance(pos.position) < 1)
|
||||
playerHealth->takeDmg(playerHealth->getHealthPoint());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace BBM
|
||||
{
|
||||
auto &controllable = entity.get<ControllableComponent>();
|
||||
auto &movable = entity.get<MovableComponent>();
|
||||
auto health = entity->tryGetComponent<HealthComponent>();
|
||||
Vector2f move = controllable.move.normalized() * controllable.speed;
|
||||
|
||||
movable.addForce(Vector3f(move.x, 0, move.y));
|
||||
|
||||
@@ -60,8 +60,6 @@ namespace BBM
|
||||
float lowerZDist = 0;
|
||||
|
||||
for (auto &[player, position, _] : this->_wal.getScene()->view<PositionComponent, TagComponent<Player>>()) {
|
||||
if (!player.hasComponent<MovableComponent>())
|
||||
player.addComponent<MovableComponent>();
|
||||
playerPos.emplace_back(position.position);
|
||||
}
|
||||
if (playerPos.size() == 1)
|
||||
|
||||
Reference in New Issue
Block a user