checkCollisions method

void checkCollisions ()

Checks collision of all visible Entity's with the Dozer.

Implementation

void checkCollisions() async {
  this.getVisibleEntities().forEach((id, e) {
    if (e is Brick || e is Barrier) {
      if (CollisionChecker.recCir(e, this._dozer)) {
        this._dozer.hitBy(e);
        e.hitBy(this._dozer);
        if (e is Brick) {
          visibleEntities.remove(id);
        }
      }
    } else if (e is Dot || e is PowerUp) {
      if (CollisionChecker.circles(e, this._dozer)) {
        this._dozer.hitBy(e);
        e.hitBy(this._dozer);
        visibleEntities.remove(id);
      }
    }
  });
}