Skip to content

Instantly share code, notes, and snippets.

View mrn-aglic's full-sized avatar

Marin mrn-aglic

View GitHub Profile

A playful introduction to Rx

Learning Rx does not have to be boring or painful working your way through theoretical sermons about esoteric concepts like category theory and duality. Life is too short for that kind of abstract nonsense.

So what is a better way to spend a hot summer day with an ice-cold drink, or dually, a cold winter night with a piping hot drink, than to learn Rx by writing an awesome platform game. In this talk, I will walk you through many of the features of Rx by way of scripting a friendly bug to run across a lavish grass meadow and jump for the stars. In just a few tens of lines of code, we will leverage operators like map, flatMap, filter, scan, and many more to react to the keyboard, animate jumps, and perform collision detection. We will even use a test scheduler to make the game run at a speed we determine so we can easily debug and test our game.

We will use RxScala and IntelliJ to develop the game, but since Rx is language and platform agnos