
Master your JavaScript game development skills by learning, building, and applying JavaScript to interactive game projects and challenges, including two popular projects, with starter formats and included source code.
Install Node.js and npm to run JavaScript on the server, serve content before it reaches the browser, and use npm to manage libraries for your game development projects.
Install Visual Studio Code, set up the editor as your go-to IDE, open project folders, and test your web games in a chosen browser using provided boilerplate code.
Learn how to use the script tag to embed JavaScript, compare inline and external scripts, and link a separate .js file via the src attribute for cleaner debugging.
Learn the basics of declaring variables in JavaScript, using var or omitting it, understand dynamic typing, and recognize case sensitivity and optional semicolon usage while testing in a browser console.
Explore how to clear the console using a function named clear, and learn that JavaScript ignores extra white spaces. See how single-line and multi-line comments provide information about the code.
Identify core data types in JavaScript—strings, numbers, and booleans. Strings use single or double quotes; numbers cover integers and decimals; booleans enable conditional logic.
Learn how JavaScript objects store multiple key-value data using object literals or constructors, access members with this and dot notation, and create methods like get full name, including nested objects.
Learn JavaScript array types, including brackets-based arrays and the new Array constructor, indexing to access elements, and for loops with console.log; understand homogeneous and mixed arrays.
Learn how null and undefined represent absence or lack of value in JavaScript primitives, with examples of variables, DOM checks, and function return behavior.
Master JavaScript functions by defining a block of code, calling it, and passing parameters. Grasp function scope, return, and examples like sum and alert, notes on dynamic typing and TypeScript.
Learn how to use if, else, and else if conditional statements to control program flow in JavaScript, with practical examples showing true and false conditions and default cases.
Explore switch statements in JavaScript, comparing them to if-else, and learn to execute code blocks based on the value of an expression using cases, defaults, and break with name examples.
Master the JavaScript for loop to execute code repeatedly using initialization, condition, and update, including printing array elements with console.log and using array.length for dynamic loops.
See how a while loop repeats code until a condition is met. Recognize it needs only the condition, unlike a for loop with initialization and iteration.
Explore JavaScript strict mode, compare dynamic typing with tighter rules, enforce variable declarations with var, prevent reserved words as identifiers, and apply strict mode inside functions for robust code.
Explore how the this keyword in JavaScript points to the calling context, differentiating global window scope from object instances, and show how each object gets its own copy of properties.
TypeScript is a JavaScript superset that adds features and static types. It compiles to JavaScript for browser execution.
Discover why TypeScript enhances JavaScript by demonstrating typed inputs, explicit type casting, and preventing string concatenation in a two-number add program, then compile TypeScript to JavaScript for browser execution.
Explore core TypeScript types, including number, string, and boolean, learn type annotations, const vs let, and how compile-time checks catch errors before runtime.
Explore type inference in TypeScript: const values are inferred as their data types; uninitialized variables require explicit type annotations to avoid any type; mismatched assignments cause immediate errors.
Explore the object type in TypeScript by creating a const person with key-value attributes, accessing members with the dot operator, and converting to JavaScript to log the age.
Explore array types in TypeScript and JavaScript, including homogeneous and heterogeneous arrays, nested arrays, and using any to mix data types with examples of friends and marks.
Compare const, let, and var in JavaScript and TypeScript. Learn that const is a not reassignable constant, let has block scope, and var has global or function scope.
Explore es6 arrow functions as a concise alternative to the function keyword, showing how to declare with parameters, use single-statement returns, and apply them to events and the DOM.
Explore closures in JavaScript, where an inner function accesses outer variables even after the outer function returns, and how TypeScript is converted for the browser.
Discover how classes and objects enable reusable components in object-oriented programming, with properties and methods defined in constructors, and how TypeScript introduces class-based structure to JavaScript via compilation.
Define an employee class in TypeScript with properties employee code and employee name, use a constructor to set them, and create objects with new to access them via dot notation.
Learn how a class serves as a blueprint with properties and attributes, and how a constructor initializes an object's employee code and employee name using the this keyword.
Learn how classes define properties and constructor initialization, then create and use methods to manipulate those attributes. Explore get salary and increasing employee code as examples of object oriented programming.
Explore inheritance in TypeScript by extending a base person class to an employee class, using constructor and super to access the name property, and relate it to phaser library.
Discover how webpack reduces HTTP requests by bundling JavaScript and assets, improving web app load times, latency, and performance for beginner game development projects.
Discover how webpack bundles code to reduce http requests, optimize performance, and provide a dev server with automatic live reload for TypeScript game development.
Learn phaser and facer library for game development by setting up a phaser project, installing npm dependencies with npm install, and organizing assets, scenes, and objects in a webpack workflow.
Learn to configure a game with the Phaser library by setting width, height, background color, and scale, then build and run to generate dist JavaScript.
Preload scene loads all assets, including images and audio, using the phaser library, before using them in the game, and requires adding the scene to the game configuration.
Load assets in the preload scene, then start the main scene to display the rocket. Import and instantiate the rocket in the center using the game width and height.
learn to make a rocket interactive by listening for pointer down events and adjusting its alpha to 0.5 for a little transparency.
Make a rocket game object move by updating its velocity inside the update loop, using velocity.x and velocity.y with arcade physics, gravity, and optional debug visuals.
Discover how to move a rocket with tweens, setting duration, y position, and alpha, using on complete handlers and scene scope to regenerate a new rocket at center and repeat.
Learn to animate a walking mummy in phaser by loading assets, configuring arcade physics, and building the project with npm install and npm run build.
Learn to load assets in the preload scene, focusing on sprite sheets versus single images. Specify frame width and height to extract a mummy frame from a spreadsheet for animation.
Create and play looping mummy animation in the main scene by defining the work animation with frames and a mummy sprite, then enable repeat and move along the x axis.
Apply tweens to a game object by choosing a target and a spread, then set the final x (and optional y) position and a duration with a linear ease.
Add audio to your JavaScript game by preloading the audio asset with a key, ensuring browser compatibility, and playing the sound on pointer up for interactive feedback.
Install and configure the Phaser arcade physics engine to enable gravity, velocity, and movement in your game, using the physics object in the config and optional debug mode.
Learn to preload assets, then add a physics-enabled apple sprite, position it, and configure gravity to see it fall or rise, with optional debug boxes.
Add a collider between the apple and ground, make the ground immovable, and tune gravity and bounce using the physics library to create realistic interactions.
Use input events to control a game object’s motion with velocity: on pointer down, set the apple’s Y velocity to jump, and adjust X velocity to move horizontally under gravity.
Learn how to preload and load a tile map json and tileset image in Phaser, and implement a camera that follows the player to create a scrolling game environment.
Create a bounded camera, load environment dimensions from JSON, and render a tile map using a tile set by connecting preload and main scenes with a key.
Learn to create a player sprite from a texture key and configure the camera module to follow the player within world bounds, with zoom and pixel rounding.
Drive the player ship with cursor keys and enable the camera to follow the ship, using Phaser arcade physics, velocity and angle updates to control movement.
Launch a platformer game project using the provided starting code and assets from the resource section. Open the folder in Visual Studio Code to begin building with JavaScript.
Explore the game project structure in Visual Studio Code, focusing on package.json, the Phaser library, webpack bundling, and the crc starting code with indexed.html and game.ts.
Open the terminal and run npm install to install all required libraries for the game, creating a folder that contains the dependencies your game needs to run.
Run npm install to create the node module with all required dependencies, fix deprecated modules using npm audit fix, then write code to create your first phaser game.
Organize your game project with game, scenes, and components folders and define height and width in the game file. Use assets and tiles to render scenes and a player.
Configure and load the spine webgl plugin to enable spine assets and animations, import the plugin, and render spine objects in the game scene.
Learn to load and use the spine webgl plugin to render spine-based assets and atlas data, including player motion and facial parts, by importing the plugin and configuring the scene.
Define the game environment with components and tiles, create player objects inside scenes, and connect scenes to the game file to render players, environment, and enemies.
Create a single tile class in TypeScript for a Phaser arcade physics scene, wiring textures, positions (x, y), and static physics to build a scalable tile-based environment.
Export a single class across the project using export default to access it from anywhere, ensuring reusable code across folders.
Create a tile group by importing the single tile class, looping through tile configs, and exporting the group as default for instantiation in the scene.
Create a player class in Phaser with arcade physics, add it to the scene, and initialize attributes like isDead, halt, and map size via the constructor.
Create a scalable game map by adding a map piece file and separate levels and labels files within the components, defining the environment and level data.
Create maps teaches building tile-based levels in JavaScript by defining level labels, using left, middle, and right tiles, and rendering the player, enemy, coin, and goal.
Create and label tiles and levels, build level one using symbols, and encode the map so the player is rendered at the correct positions.
Create and organize game components as objects (player, enemy, levels, map) inside preload and main scenes, while preloading all assets, images, and sprites with phaser.
Set the path in the pre load scene to locate the spine folder and assets like boy.json and boy.atlas. Load the path and spine, then enter the main scene.
Create the main scene by importing the map and components, instantiate the map, tile group, and player, set camera bounds and physics world bounds, and handle input and updates.
Convert TypeScript code to JavaScript and serve it in the browser to run a game. Create a player with a walk animation and keyboard controls using components, scenes, and preload.
Learn to implement spine-based player animation in a JavaScript game, handling keyboard input, creating a spine-driven player class, and managing animation transitions, skins, and attachments.
Take input to move the player with left and right keys, jump with space or up, apply horizontal velocity, flip the sprite, and handle boundaries, death, camera shake, and restart.
Create a goal sprite in a Phaser game that acts as a door to advance levels, using arcade physics collision to trigger level loading and a next level workflow.
Create the goal sprite in the main scene from the map data, then use a physics overlap to detect player collision with the goal and trigger the next level.
Test multiple levels in a JavaScript game from level zero to five, with automatic redirection after the max level and a loading screen during asset preload to avoid blank screens.
Add a loading screen to a JavaScript game by using getElementById to access the HTML element, make it transparent after 2 seconds, then remove it to reveal the game.
Add a background component using a Phaser tile sprite, with a texture key and parallax to move with the camera, centered to cover the screen.
Create a resize function to center and scale the background, apply it to the camera with the game size, and demonstrate a centered, scrolling background as you move the player.
Render the coin sprite with phaser arcade physics. Create a coin single and group to place coins, add a spinning animation, and tween to destroy the coin.
Render coins with a coin group by filtering map tiles for coin elements (symbol o) and placing coins at positions, triggering collision with the player to collect and increase score.
Create an enemy class extending Phaser physics with a protected dead property, getters and setters, and death handling that stops animations, zeroes velocity, and triggers removal.
Create a bee enemy class that extends the base enemy, enables physics and animation, and implements movement and a fade-out kill sequence before removal.
Export and import sprite and enemy classes, filter tile config to spawn B sprites on a 96x96 tile map, and build a flexible enemy group for future types.
Import the bee sprite and enemy group, create an enemies group in the main scene, instantiate it, and update the group to render and move the bee enemy under gravity.
Add a collider in the main scene to connect the player and the enemies group, then test with bees to observe pieces falling as they move left to right.
Update the collider logic to keep the B enemy moving only within tiles, preventing it from going beyond tiles; it will fall if there are no tiles.
Update bee enemies to patrol by checking tile presence and ground detection; reverse velocity and flip the sprite when they reach empty tiles, ensuring continuous horizontal movement.
Learn to handle collisions between the player and the bee enemy using overlap, kill the enemy from the top, or kill the player on side hits, and advance levels.
Add a slime enemy by extending the existing enemy class, implementing crawl animation and physics, and setting a velocity of -60 to crawl across the scene.
Learn to render a Phaser JavaScript game in full screen using a resize function with mean max normalization and min max normalization, and explore smooth vs. fit scaling.
Nowadays, JavaScript can be used to make games, it brings the question of how good it is to use it for such tasks?.
Yes Indeed! JavaScript is a great language for game development, depending on the type of game you want to create. JavaScript is best for web-based and mobile games. It’s also a great language for beginners to learn because it’s generally easy to understand and has plenty of libraries and modules available.
JavaScript games can be played in the browser or mobile phone, so, if that’s your goal, it’s an excellent option. Using platforms and tools can help create both 2D and 3D games that can run directly in your browser. Aside from only web-based games, JavaScript has been increasing in popularity in mobile game development.
Many popular online games were built using JavaScript. Students who want to create JavaScript game coding can start building one taking examples from one of the following:
Tower Building: is a great way to get started with JavaScript games.
Bejeweled was created as an in-browser game in the early 2000s. It’s similar to Candy Crush where you have to match three jewels in a row to score points.
2048 is an addicting game that allows you to use your arrow keys to move tiles around in a grid. The idea is to merge tiles until they equal 2048.
Polycraft is a 3D game that is playable in your browser. Polycraft is full of adventure, exploration, base-building, gathering, crafting, and even fighting. It’s an excellent example of how you can move past 2D games with Javascript.
Words With Friends 2 is a mobile app game that uses React Native, a framework that utilizes JavaScript to create mobile applications. They chose to use React Native for its ability to create a game that can be played on multiple platforms using JavaScript with one code-base.
See, how fun and rewarding it can be using JavaScript for building games, Let us look at some projects we are going to build in this course:
1. Hill climbing game: Famous android game but its idea of making vehicle move in hills is never old when it comes to web. We uses different concepts such as webpack, and physics module from phaser library to make this game.
2. Platformer 2D: we will have detail idea about sprites and how to use them in our games. We will create map (environment) and players from scratch. Different levels will be made and triggers/colliders will be added to make player change from one level to another.
3. Basics of Phaser library: Different programs to load images, follow camera, loading animations will be created.
I really enjoyed creating this course. Hope you will also have fun learning. See you at the class!