RBS CODE · QUICK REFERENCE
JavaScript Skills Map
One page. What you know, what JS3 adds, and what unlocks later.
JS3 is a game-skills map, not a giant lesson. You already know movement from JS2. JS3 adds the rules that turn movement into a game.
JS1 · THINK
JavaScript 1
Work with values and decisions.
<script> — start JavaScriptalert() — show a messagelet — remember a value"text" — stringsprompt() — ask a questionNumber() — make a number+ - * / — mathsif / else — choose what happens== != < > <= >= — compare valuesJS2 · CONTROL
JavaScript 2
Control real things on the page.
function — name instructionsonclick — run code on clickgetElementById() — find an element.value — read an input.innerText — change text.style — change CSS.style.left / top — move an objectx / y — remember positionnumber + "px" — CSS positionJS3 · GAME RULES
JavaScript 3
Turn movement into a real game.
parameters — give a function informationreturn — get an answer backkeydown / event.key — keyboard controlsgetBoundingClientRect() — object edges&& — BOTH rules must be true|| — EITHER rule can be true!= and ! — not equal / NOTcollision — are two objects touching?
boundaries — stay inside the game
score / health / gold — change numbers
Math.random() — random positionsconsole.log() — see what is happeningUNLOCK LATER
Only when a project needs it
Timers
automatic movement
setInterval()automatic movement
Arrays
inventory, walls, bullets
[]inventory, walls, bullets
Loops
check many objects
forcheck many objects
Smooth controls
hold keys down
keydown + keyuphold keys down
Platformer movement
jump and land
ySpeed + gravityjump and land
Create objects
bullets / new enemies
createElement()bullets / new enemies
Objects
bundle game data
{ }bundle game data
Save progress
keep data
localStoragekeep data
Memory trick: JS1 thinks → JS2 controls the page → JS3 adds game rules.