
Install Visual Studio Code and Node.js to set up your development environment for modern JavaScript, verify installation with node -v, and prepare terminal access in the editor.
Here is how you get additional help if you get stuck!
Set up a Node.js project with npm init, install Express, and build a simple web server that responds with hello world on localhost port 3000.
Learn to set up a Phaser game with arcade physics using a CDN, create a 640x640 game space, and serve it via Express with static files.
This lecture builds a Phaser main scene for a snake game, defining a main scene class that extends scene, includes a constructor and update loop, and shows module exports/imports.
Build a Phaser snake prototype using Snake class, render a 16 by 16 red rectangle, grow the body as boxes, and control movement with arrow keys to a direction vector.
Implement smooth, time-based snake movement in Phaser by moving the snake at a defined interval measured in milliseconds rather than every frame, enabling speed control.
Learn to keep the snake's body following the head by using array indices, length minus one, and a backwards for loop to copy and assign previous positions for each segment.
Place a green apple in the snake game and ensure it spawns on a 16-pixel grid. Align the snake and apple to the grid using tile size and integer math.
Learn how to make the snake eat the apple in Phaser by comparing the head’s next position to the apple, then grow the body and reposition the apple.
Trigger a snake death in Phaser when the head exits any screen boundary, then restart the scene to reset start conditions after testing left, right, top, and bottom bounds.
Master the phaser snake: implement a death condition by detecting head-to-tail collisions using array slicing, and test with tail.some to detect when the head matches a tail segment.
Clean up code and enforce safe movement in Phaser by setting a 100 move interval, preventing reversing direction with if statements, and avoiding self-collision after tail eating in snake game.
Create a playable javascript snake game using modern techniques like classes, array methods, and modules, and celebrate finishing the course.
Ever wanted to learn Javascript, Node.js & Express.js but found traditional courses a little boring & long?
Jump straight in by coding a snake game and learn the fun way!
You will get experience using:
Javascript
ES6
Classes
Arrays
Functions
Objects
Phaser 3
Node.js
Express.js
Phaser 3
Snake is a nice, simple game that includes many fundamental elements that you will find in many games. It is the ideal first game to code.
The game includes:
Movement
Input handling
Power ups
Randomisation
Collision detection
Game over handling
I hope you enjoy the course!