public static bool IntersectsWithTile(Engine.ICollisionable collisionAble1, Engine.Location location) { Engine.TileData data = location.getTile(); Tile tile = location.World.Level.TileSet[data.ID]; Rectangle rect = tile.CollisionArea, coll = collisionAble1.CollisionArea; rect.Offset(location.getTileX() * Tile.STANDARD_GTILE_WIDTH, location.getTileY() * Tile.STANDARD_GTILE_HEIGHT); return(IsIntersectPixels(coll, collisionAble1.Mask, rect, tile.Mask, false, data.Flipped)); }
public static bool IntersectsWithTile(Engine.ICollisionable collisionAble1, Engine.World world, int tileX, int tileY, out int maxY) { Engine.TileData data = world.Level.getTile(tileX, tileY); Tile tile = world.Level.TileSet[data.ID]; Rectangle rect = tile.CollisionArea, coll = collisionAble1.CollisionArea; rect.Offset(tileX * Tile.STANDARD_GTILE_WIDTH, tileY * Tile.STANDARD_GTILE_HEIGHT); return(IntersectPixels(coll, collisionAble1.Mask, rect, tile.Mask, false, data.Flipped, out maxY)); }
public static bool IntersectsWithTile(Sprites.Sprite collisionAble1, Level level, int tileX, int tileY, out int highY, out int lowY) { Engine.TileData data = level.GetTile(tileX, tileY); Tile tile = level.TileSet[data.Data]; Rectangle rect = new Rectangle(0, 0, TileSet.TileSize, TileSet.TileSize), coll = collisionAble1.CollisionArea; rect.Offset(tileX * TileSet.TileSize, tileY * TileSet.TileSize); return(IntersectsWithTile(coll, collisionAble1.Mask, rect, tile.Mask, false, false, out highY, out lowY)); }