Use: The data-URI OR network path to image.
Note: Using network paths will cause the asset to be redownloaded to the clients if the clients cache is disabled.
type Image = StringUse: A horizontal displacement in number of pixels.
Note: Can be negative value.
type X = IntUse: A vertical displacement in number of pixels.
Note: Can be negative value.
type Y = IntUse: A horizontal width of an object in number of pixels.
Note: Cannot be negative.
type Width = IntUse: A vertical height of an object in number of pixels.
Note: Cannot be negative.
type Height = IntUse: The number of Frames in a FrameArray
Note: Cannot be negative.
type FrameCount = IntUse: The number of screen updates that a Frames in a FrameArray will be displayed for before transitioning to the next frame.
Note: Cannot be negative.
type FramesPerSecond = IntUse: A collection of Frames
type FrameArray = Array ImageUse: A angle in degrees.
type Deg = IntUse: A value that uniquely identifies a in-game asset (Image or Sprite).
type AssetId = IntUse: A value that uniquely identifies a game state.
type StateId = IntUse: A value that uniquely identifies a TileMap.
type MapId = IntUse: In game score
type Score = IntUse: The height text should be in pixels when displayed on screen.
type TextHeight = IntUse: The Size of the canvas the game will be drawn on.
type MonitorSize = SizeUse: A change in X and Y coordinates.
type Vector = PositionUse: A position relative with X and Y coordinates.
type Position = {
x :: X,
y :: Y
}Use: A speed with direction defined by a horizontal and vertical component.
type Velocity = {
xSpeed :: Number,
ySpeed :: Number
}Use: A collection of TileMaps
type Asset = {
mapData :: Array TileMap
}Use: A 2D array of ScaledImages. Any cell that is Nothing represents an empty tile.
type TileMap = Array (Array (Maybe ScaledImage))Use: A graphical context for drawning TileMaps on a monitor with a defined Size given a Context2D.
type DrawContext = {
ctx :: Context2D,
mapData :: Array TileMap,
monitorSize :: MonitorSize
}Use: A Image with a defined Size and AssetId.
type ScaledImage = {
id :: AssetId,
image :: Image,
size :: Size
}Use: A FrameArray that can be iterated through. Each of the images in the FrameArray will be scaled to the specified Size when drawn.
Note: frameIndex cannot be negative and frameCount should be the length of frames.
type Sprite = {
id :: AssetId,
frames :: FrameArray,
frameIndex :: Int,
framesPerSecond :: FramesPerSecond,
frameCount :: FrameCount,
size :: Size
}Use: An API request.
type Request = {
url :: String,
json :: String,
method :: String
}Use: A wrapping type for an object's Width and Height.
type Size = {
width :: Width,
height :: Height
}Use: An API request for storing a player's score and time.
type PlayerScoreCreateRequestData = {
username :: String,
score :: Int,
start :: String,
end :: String
}Use: An API reqponse containg the details of a player's highscore.
type PlayerScore = {
username :: String,
score :: Int,
time :: String,
position :: Int
}