Two Scoreboards

Happily, the Scoreboard code that we use is an object, which makes our job of adding two scoreboards easier—yay! The code that adds the one scoreboard should be below where we create launcher1 and launcher2. It should look something like the following:

​ ​var​ scoreboard = ​new​ Scoreboard();
​ scoreboard.countdown(60);
​ scoreboard.score(0);
​ scoreboard.help(
​  ​'Use right and left arrow keys to point the launcher. '​ +
​  ​'Press and hold the down arrow key to power up the launcher. '​ +
​  ​'Let go of the down arrow key to launch. '​ +
​  ​'Watch out for the wind!!!'​
​ );
​ scoreboard.onTimeExpired(timeExpired);
​ ​function​ timeExpired() {
​  scoreboard.message(​ ...

Get 3D Game Programming for Kids, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.