Day 2 of my GameFromZero series — 50 playable mini-games in 50 days, all in the browser, all one HTML file.

Today: Pong. The simplest arcade game ever made and the one that teaches the game loop pattern that powers every game after it.

What you're going to learn

The game-loop pattern. Every action game in history is the same shape:

every frame (16ms ≈ 60 FPS):