Module

Emo8.Game.Update

Package
purescript-emo8
Repository
opyapeus/purescript-emo8

#Update Source

type Update = UpdateR UpdateContext

Emo8 update monad which can access canvas size.

#UpdateContext Source

type UpdateContext = { canvasSize :: Rect }

#getCanvasSize Source

getCanvasSize :: Update Rect

Get the canvas size given by the emo8 function.

#isOutOfCanvas Source

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

Check if the object is outside the canvas.

The origin of x and y is the bottom left.

#isCollideCanvas Source

isCollideCanvas :: Size -> X -> Y -> Update Boolean

Check if the object collides the frame of the canvas.