Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Game development in Elm: From Zero to Gamejam

Game development in Elm: From Zero to Gamejam

Games are fun to play and fun to make! Elm is a great way to get started building games. We’ll take a whistlestop tour of 2d-game math, visuals, dealing with time, common data modeling solutions, and more. You will be equipped with the knowledge to participate in a game jam and turn your ideas into a playable game.

Joël Quenneville

June 28, 2019

More Decks by Joël Quenneville

Other Decks in Technology


  1. SAFE TEA Puzzle game where user attempts to find the

    optimal tower placement to prevent the pirate(s) from arriving at their goal.
  2. PATH TO SUCCESS 1. Place tower 2. Pirates move towards

    goal 3. Towers shoot pirate 4. Win if pirate is hit 5. Lose if pirate arrives at destination
  3. OBVIOUS THINGS WE CAN CUT > Multiple tower types >

    Multiple levels > Tower upgrades > Waves of pirates

    Cannonball collision detection > Multiple towers, multiple pirates
  5. USE Msg TO DRIVE YOUR LOOP type Msg = UserInitiatedDiceRoll

    | RandomDiceRollComplete Int | UserEndedTurn
  6. type Msg = SelectDeck Card.Deck | StartPlaying GameState | PlayCard

    Int Card | SelectCard Int | PlayCardToSlot Int Card GameSlot | EndTurn
  7. DOWN THE RIVER type Msg = Tick Float | Move

    Game.YDirection | NewSection Section | StartGame
  8. TYPE SAFETY AROUND DISTANCES module Measurement exposing (Feet, Pixels, PixelsPerFoot)

    type Feet = Feet Int type Pixels = Pixels Int type PixelsPerFoot = PixelsPerFoot Int
  9. module Cordinate exposing (World, Screen, Viewport) -- OTHER CODE type

    alias Viewport = { position : World , width : Pixels , height : Pixels , zoom : PixelsPerFoot }
  10. SUBSCRIBE TO DELTAS subscriptions : Model -> Sub Msg subscriptions

    model = Browser.Events.onAnimationFrameDelta Tick
  11. When you’re stuck on a programming problem, the best way

    to get unstuck is often to try to express the problem in a different medium.
  12. case region map (TileNumber tileNumber) of NorthWestCorner -> ... NorthEastCorner

    -> ... SouthWestCorner -> ... SouthEastCorner -> ... NorthEdge -> ... WestEdge -> ... EastEdge -> ... SouthEdge -> ... Middle -> ...