a package for building games in WebGL
# ( 👇 this command won't work unless I publish this! )
elm install ryannhg/elm-2d
module Examples.Shapes exposing (main)
import Elm2D exposing (Html)
import Elm2D.Color
main : Html msg
main =
Elm2D.view
{ background = Elm2D.Color.fromRgb255 ( 0, 0, 100 )
, size = ( 800, 600 )
}
[ Elm2D.rectangle
{ color = Elm2D.Color.fromRgb255 ( 200, 200, 0 )
, position = ( 350, 250 )
, size = ( 100, 100 )
}
]
You can see more interesting examples in this project's examples
folder. Clone this repo and run:
cd examples/
elm reactor
The examples will be available at http://localhost:8000
An example of how to render images from a file, instead of just colors and shapes.
An example of how to use more advanced features like selecting multiple tiles in a spritesheet.
An example of how to use Elm2D.Spritesheet.Animation
to make characters bounce and run around.
An example with keyboard support, where players can move something you've rendered.
An example of creating a dungeon from a tileset.