Skip to content

[Claes Worm] - Flappy, an extended variant of the flappy-bird game in OCaml

Photo of Joakim Ahnfelt-Rønne
Hosted By
Joakim A. and 2 others
[Claes Worm] - Flappy, an extended variant of the flappy-bird game in OCaml

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

---

We have set up a collaboration with Prosa, who generously offered to provide a location for our regular meetups. Please see Prosa's Calendar for more details: Prosa Calendar (https://www.prosa.dk/kalender/hele-kalenderen/)

The ADA meeting room fits about 25 people and if we need more space, we can use the canteen (PASCAL), which has a capacity of at most 50 (fire regulation).

Regards,

Ramón and Joakim

Photo of Mødegruppe for F#unktionelle Københavnere group
Mødegruppe for F#unktionelle Københavnere
See more events
Prosa (ADA lokale)
Vesterfarimagsgade 37A · Copenhagen