Merge branch 'Doors' of github.com:progtime-net/DangerousD into Doors
This commit is contained in:
commit
e2352d7db4
1 changed files with 9 additions and 5 deletions
|
@ -142,14 +142,18 @@ namespace DangerousD.GameCore.Managers
|
|||
}
|
||||
private void CheckCollisionsE_LE(List<Entity> entities, List<LivingEntity> livingEntities)
|
||||
{
|
||||
foreach (var entity in entities)
|
||||
for (int i = 0; i < entities.Count; i++)
|
||||
{
|
||||
foreach (var livingEntity in livingEntities)
|
||||
|
||||
|
||||
for (int j = 0; j < livingEntities.Count; j++)
|
||||
{
|
||||
if (livingEntity.Rectangle.Intersects(entity.Rectangle))
|
||||
|
||||
|
||||
if (livingEntities[j].Rectangle.Intersects(entities[i].Rectangle))
|
||||
{
|
||||
livingEntity.OnCollision(entity);
|
||||
entity.OnCollision(livingEntity);
|
||||
livingEntities[j].OnCollision(entities[i]);
|
||||
entities[i].OnCollision(livingEntities[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue