elmman/src/Types.elm

43 lines
537 B
Elm
Raw Permalink Normal View History

module Types exposing (..)
import Time exposing (Time)
2017-06-28 16:09:20 +00:00
import Keyboard exposing (KeyCode)
type Direction
= Up
| Down
| Left
| Right
2017-06-28 16:09:20 +00:00
type KeyAction
= MoveUp
| MoveDown
| MoveLeft
| MoveRight
| NoKeyAction
type alias Model =
{ time : Time
, player : PlayerModel
}
2017-06-26 21:48:17 +00:00
type Msg
= Tick Time
| Tock Time
2017-06-28 16:09:20 +00:00
| Press KeyCode
2017-06-26 21:48:17 +00:00
type alias PlayerModel =
{ direction : Direction
, location : ( Float, Float )
2017-06-28 21:12:11 +00:00
, moving : Bool
}
type alias Range =
( Float, Float )