Module

Emo8.Util.Collide

Package
purescript-emo8
Repository
opyapeus/purescript-emo8

#isOutOfCanvas Source

isOutOfCanvas :: Rect -> Size -> X -> Y -> Boolean

#isCollideCanvas Source

#isCollideMap Source

isCollideMap :: EmojiMap -> Size -> Walls -> Size -> X -> Y -> Boolean

Check if the object collides the emoji map with the specified map size, walls, object size, x and y.

The walls are emojis collidable in a certain map.

#isCollide Source

isCollide :: Size -> X -> Y -> Size -> X -> Y -> Boolean

Check if the two objects collide.

#Sink Source

type Sink = { x :: Int, y :: Int }

#sinkCanvas Source

sinkCanvas :: Rect -> Size -> X -> Y -> Maybe Sink

Calculate how deep the object is sunk outside the canvas.

#sinkMapXY Source

sinkMapXY :: EmojiMap -> Size -> Walls -> X -> Y -> Size -> X -> Y -> Maybe Sink

Calculate how deep the object is sunk in the walls. It takes emoji map, map size, walls, previous x, previous y, emoji size, x and y. ※ This function only checks 4-edges of the object and treats 1-map-cell for each the edges.