Tutorials
JavaScript
The coding basics behind every game: variables, loops, functions, and more.
1
2
3
4
5
6
7
8
9
10
11
12
What is a variable?
A named box that remembers a value you can change.
Numbers
Counting, positions, and arithmetic with + - * /.
Strings
Text, joining with +, and turning numbers into text.
Strings: more
length, upper/lower case, includes, and split.
Booleans
true / false, comparisons, and yes-or-no facts.
If statements
Make decisions with if, else, and else if.
Loops
Repeat work with for and while.
Functions
Package code you reuse, with parameters and return values.
Arrays
Hold many things — bullets, enemies, tiles — in one list.
Arrays: more power
forEach, map, and filter — do things to a whole list at once.
Objects
Group related values (x, y, speed) into one thing.
Import and export
Split a game across files and share code between them.