O'Reilly logo

TypeScript: Modern JavaScript Development by Ivo Gabe de Wolff, Vilic Vane, Remo H. Jansen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Designing the framework

We will design the framework based on functional programming. The framework will do all non-pure work, so that the rest of the application can be built with pure functions (except for Math.random).

Tip

Strictly speaking, Math.random is not a pure function. Given that Math.random() is not always equal to Math.random(), that function will update some internal state. In pure functional languages, such a function can still exist. That function takes a state and returns a random number and a new state. Since every call to random will get a different state, it can return different random values.

A game consists of an event loop. The amount of iterations that this loop does per second is called FPS or frames per second. Every step ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required