Code tutorial – Dodge Lasers (JavaScript game) walkthrough

Game development walkthrough/tutorial of the JavaScript/Phaser game “Dodge Lasers”. Preliminary development before training a neural network to beat this game. Like, comment, subscribe.


0:00 – MrMultiMediator
0:05 – Intro/description of the project goal
0:45 – Broad overview of project files and libraries used
3:18 – Coding the ‘game.js’ file (configures the global game settings).
7:15 – Coding the ‘Scene1.js’ file (‘intro screen’. Does nothing except preload assets)
11:38 – Beginning of ‘Scene2.js’, the bread and butter. The bulk of the content.
12:02 – Beginning of the ‘create’ function. Initializations before the main loop of the scene. Create the player, the background, enable keyboard input, etc.
18:30 – Beginning of the ‘update’ function – the main game loop. Scroll background, enable gravitational acceleration.
20:00 – High level overview of functions that will be called in game loop: move player, generate lasers, delete lasers, display settings, check if player is dead.
21:00 – Move player function implementation.
23:27 – Display settings function implementation.
24:00 – Laser generation function implementation.
32:37 – Laser deletion function implementation.
39:00 – Check dead function implementation.
39:30 – ‘Scene3.js’ implementation – passing data between scenes explained.
41:20 – Testing the game and debugging the numerous mistakes made during the coding session.
44:40 – Closing remarks.

I think in the future, the coding will be truly ‘live’, in the sense that I will not have a pre-written code that I am rewriting. It will be better for the learners if I am coding a fresh version of a code I’ve never written, to help everyone follow my thought processes that I go through while coding. Also, this will force me to do more testing as I go, rather than having to debug several errors at the end.

Check out the song on my soundcloud:

GitHub link:

Post Author: hatefull