public SpIRIT(Texture2D a, Rectangle r, Checkpoint p) { AssetSheet = a; W = new CollisionWeb(r); point = p; isActive = false; onScreenSpeed = 7; }
//returns the tile a checkpoint is in public static Tile inTile(Level l, Checkpoint c) { foreach (Tile t in l.theLevel){ if (t.rect.Contains(c.getPoint())){ return t; } } return new Tile(); }
//constructor public CollisionWeb(Rectangle r) { area = r; p = new Checkpoint[6]; for (int i = 0; i<points.Length; i++) { p[i]=new Checkpoint(0,0); } pointsUpdate(); }
//returns true if the checkpoint's in a solid tile public static bool isColliding(Level l, Checkpoint c) { foreach (Tile t in l.theLevel) { if (t.rect.Contains(c.getPoint()) && t.isSolid) { return true; } } return false; }