Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Learn basic concepts shared by all programming languages — values, variables, functions and control structures. Learn how changing values can change how a program works by experimenting with a JavaScript game.
Downloading and Running the Project Files
Because of how the Phaser.JS library handles files, you need to be running a web server locally to view a working copy of this project. You can't just open the index.html file in your web browser as you might a basic HTML page. There are several simple ways to get a web server up and running on your computer:
- Launch a local development server with the Live Server VS Code extension
- Launch a simple development http server with atom-live-server
Concepts
-
Syntax — a programming languages vocabulary and grammar. Every programming language has its own syntax. For example, JavaScript has special keywords like
var
,if
, andfunction
that all do different things to in a program. -
Values — the data in your program. For example, a number like
375
is a numeric value; a logical value liketrue
, orfalse
is called a boolean value; and a collection of letters inside of quote marks are called a string:'Hello there!'
. -
Variables — variables hold values. They are like boxes you store information in like the current score in a game, or the name of the player. For example, to create a variable and store a number 0 in it, you could write this JavaScript code:
var currentScore = 0
- Control structures — control the flow of the program: what happens and when it happens. For example, if you're playing a game and your character dies, the game ends. The flow of the program is controlled by actions that happen in the program.
- Commands (functions) — the commands we ask a program to complete, like adding two numbers together or validating a person's email address.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Christopher Torlone
50 Points1 Answer
-
vamosrope14
14,932 Points1 Answer
-
Ed G
1,763 Points2 Answers
-
Russ Perry
13,418 Points1 Answer
-
Tyrone Cartwright
4,023 Points1 Answer
-
PLUS
akan sam
Courses Plus Student 870 Points1 Answer
-
Jose Luis Ocaña
3,746 Points6 Answers
-
Adam Brougher
963 Points0 Answers
-
Ricardo Redd
1,675 Points2 Answers
-
lakewriter
1,539 Points2 Answers
-
derek loureiro
3,239 Points0 Answers
-
Abdallah El Kabbany
2,042 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up