Skip to content

Details

This talk is based on the codebase of 'Flappy' - an extended variant of the flappy-bird game written in OCaml.

The game was written as an example of how to write simple and purely functional games in OCaml - with an architecture resembling that of Elm's. It then also became a playground for tackling some common problems in game programming and FP; subtyping of entities and referencing entities from entities.

The focus of the talk will be:

  • The Elm architecture in OCaml, or how to write a simple purely functional game in OCaml with the browser as backend
    -- The details of the architecture - what is needed
    -- What was my experience programming Flappy this way?
  • How OCaml enables a unique form of typesafe subtyping of game-entities, using polymorphic variants.
  • Referencing game-entities recursively in a purely functional program
    -- How entity-referencing is solved in Flappy
    -- Discussion of the problem in general, including pros and cons of solutions.
  • Discussion of advantages and limitations of pure functional programming for games

The code can be found at GitHub: https://github.com/rand00/flappy

Members are also interested in