Installed

elm/browser
1.0.2
elm/core
1.0.5
elm/html
1.0.0
elm/json
1.1.3
elm-explorations/linear-algebra
1.0.3
elm-explorations/webgl
1.1.3

Registry

elm/http
2.0.0
elm/random
1.0.0
elm/time
1.0.0
elm/file
1.0.5
elm/svg
1.0.1
evancz/elm-playground
1.0.3
w0rm/elm-physics
5.1.3
rtfeldman/elm-css
18.0.0
mdgriffith/elm-ui
1.1.8
​x
      , Task.attempt GotFace (Texture.loadWith options "https://elm-lang.org/images/thwomp-face.jpg")
 
1
-- Thwomp looks at your mouse. What is it up to?
2
--
3
-- Dependencies:
4
--   elm install elm/json
5
--   elm install elm-explorations/linear-algebra
6
--   elm install elm-explorations/webgl
7
--
8
-- Thanks to The PaperNES Guy for the texture:
9
--   https://the-papernes-guy.deviantart.com/art/Thwomps-Thwomps-Thwomps-186879685
10
​
11
​
12
import Browser
13
import Browser.Dom as Dom
14
import Browser.Events as E
15
import Html exposing (Html)
16
import Html.Attributes exposing (height, style, width)
17
import Json.Decode as D
18
import Math.Matrix4 as Mat4 exposing (Mat4)
19
import Math.Vector2 as Vec2 exposing (Vec2, vec2)
20
import Math.Vector3 as Vec3 exposing (Vec3, vec3)
21
import Result
22
import Task
23
import WebGL
24
import WebGL.Texture as Texture
25
​
26
​
27
​
28
-- MAIN
29
​
30
​
31
main : Program () Model Msg
32
main =
33
  Browser.element
34
    { init = init
35
    , view = view
36
    , update = \msg model -> ( update msg model, Cmd.none )
37
    , subscriptions = subscriptions
38
    }
39
​
40
​
41
​
42
-- MODEL
43
​
44
​
45
type alias Model =
46
  { width : Float
47
  , height : Float
48
  , x : Float
49
  , y : Float