Today, I’m adding controller support to Centipede. (See the first controller commit.)
Controls Code Cleanup First, the location of the controls currently doesn’t make a lot of sense, so I’m moving them to a new file, controls.js. On load, controls.addEventListeners will execute. There are no dependencies, so the script load order doesn’t matter. Previously these were on the gameArea object because that’s where the keys tracker was stored, but the keys tracker can just live in the controls object.