tilePropertiesListBelow method

List<Map<String, dynamic>>? tilePropertiesListBelow()

Method that checks what properties list map tile is currently

Implementation

List<Map<String, dynamic>>? tilePropertiesListBelow() {
  final map = gameRef.map;
  if (map.tiles.isNotEmpty) {
    Vector2Rect position = this.isObjectCollision()
        ? (this as ObjectCollision).rectCollision
        : this.position;
    return map
        .getRendered()
        .where((element) {
          return (element.position.overlaps(position) &&
              (element.properties != null));
        })
        .map<Map<String, dynamic>>((e) => e.properties!)
        .toList();
  }
  return null;
}