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

Building a game with Elixir and Elm

Avatar for Paulo Diniz Paulo Diniz
September 08, 2017

Building a game with Elixir and Elm

Building a game with Elixir and Elm

Avatar for Paulo Diniz

Paulo Diniz

September 08, 2017
Tweet

More Decks by Paulo Diniz

Other Decks in Programming

Transcript

  1. Couldn't apply my mental models directly ! Note: Javascript community

    ❤ Note2: Underscore.js ❤ Note3: Ramda ❤ Note4: React ❤
  2. updateFlappy : Game -> ( Game, Cmd Msg ) updateFlappy

    game = game |> gravity |> physics |> upperLimit |> checkPipeColision |> updatePipes |> updateScore
  3. updateScore : Game -> ( Game, Cmd Msg ) updateScore

    game = let score = game.pipes |> List.filter (\pipe -> pipe.passed == True) |> List.length |> (\x -> x // 2) in if (game.score == score) then ( game, Cmd.none ) else { game | score = score } |> update SendScore
  4. Wrapping up I'm not confortable with JS If you're also

    not, try other languages Make games, they're awesome https://paulodiniz.github.io/flappy-bird/