Pebble.Game.Collision
Small collision helpers for simple 2D watch games.
Shapes
Rect
type alias Rect =
{ x : Int
, y : Int
, w : Int
, h : Int
}Axis-aligned rectangle bounds.
Circle
type alias Circle =
{ x : Int
, y : Int
, r : Int
}Circle bounds with integer center and radius.
Tests
rectRect
rectRect : Rect -> Rect -> BoolCheck whether two axis-aligned rectangles overlap.
pointInRect
pointInRect : { x : Int, y : Int } -> Rect -> BoolCheck whether a point is inside a rectangle.
circleCircle
circleCircle : Circle -> Circle -> BoolCheck whether two circles overlap.