mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-30 09:08:35 +00:00
Merge branch 'develop' of github.com:AnonymusRaccoon/Bomberman into parser
# Conflicts: # sources/Map/Map.cpp # sources/Runner/GameScene.cpp # sources/Runner/PauseMenuScene.cpp # sources/Runner/Runner.cpp # sources/System/Controllable/ControllableSystem.cpp # sources/System/Lobby/LobbySystem.cpp
This commit is contained in:
+10
-2
@@ -67,10 +67,18 @@ namespace BBM
|
||||
CollisionComponent::CollidedAxis collidedAxis)
|
||||
{
|
||||
auto *health = entity.tryGetComponent<HealthComponent>();
|
||||
auto *movable = entity.tryGetComponent<MovableComponent>();
|
||||
auto *wallPos = wall.tryGetComponent<PositionComponent>();
|
||||
auto *entityPos = entity.tryGetComponent<PositionComponent>();
|
||||
|
||||
if (!health)
|
||||
return;
|
||||
health->takeDmg(health->getHealthPoint());
|
||||
auto posWall = Vector3f(wallPos->position.x, wallPos->position.y + 1, wallPos->position.z);
|
||||
auto vec = (posWall - entityPos->position).abs();
|
||||
if (vec.x < 0.3 && vec.z < 0.3 && posWall.distance(entityPos->position) < 0.5) {
|
||||
health->takeDmg(health->getHealthPoint());
|
||||
movable->_velocity = Vector3f();
|
||||
}
|
||||
}
|
||||
|
||||
void MapGenerator::wallCollision(WAL::Entity &entity,
|
||||
@@ -296,7 +304,7 @@ namespace BBM
|
||||
.addComponent<TagComponent<Hole>>()
|
||||
.addComponent<CollisionComponent>(
|
||||
WAL::Callback<WAL::Entity &, const WAL::Entity &, CollisionComponent::CollidedAxis>(),
|
||||
&MapGenerator::holeCollide, Vector3f(0.25, 0.25, 0.25),Vector3f(0.75, 1.75, 0.75));
|
||||
&MapGenerator::holeCollide, 0.25, 0.75);
|
||||
if (coords.y == 0)
|
||||
holeEntity.addComponent<Drawable3DComponent, RAY3D::Model>(holeObj, false, std::make_pair(MAP_DIFFUSE, holePng), Vector3f(1,1,1), 180);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user