
Travel back to age of arcade games by building a browser space shooter with HTML, CSS, and JavaScript, featuring unlockable weapons, waves of enemies, and a boss with 2D art.
Implement three weapon types—basic attack, long range laser, and super laser—against armored enemies and a mutating projectile foe, in a JavaScript project with no frameworks and sprite sheets.
Set up a vanilla JavaScript canvas project by creating index.html, linking CSS and the script, and centering a bordered canvas while organizing code into player, projectile, enemy, and game classes.
Build a canvas game with a main game object and a 600 by 800 canvas; render loop updates and draws the player, clearing the canvas at 60 frames per second.
Master keyboard controls in a JavaScript game by handling keydown and keyup events, tracking arrow key presses, and updating the player's speed and position within horizontal boundaries.
Use an object pool of ten projectiles to optimize memory and performance, reusing objects with start and reset methods, drawing and updating only when active, and triggering via keyboard input.
Create waves of enemies arranged in a 3x3 grid that move as a single unit with left-right bouncing and downward steps, spawning off-screen and floating into view.
Use axis-aligned rectangle collision detection to determine when a projectile hits an enemy, destroy the enemy, and return the projectile to the object pool with a reusable check collision method.
Explore how to display dynamic status text (score, waves, lives) in a canvas game, manage game over and restart logic, and implement scalable waves with collision and scoring.
Implement a custom player restart to center the player, reset lives to three, and restore game properties and a 2x2 enemy grid; trigger restart with r after game over.
Implement the beetlemorph enemy class in a JavaScript retro game, a single-life space bug that explodes on projectile hit, using a sprite sheet, canvas drawImage, and extends and subclassing.
Learn sprite animation with the drawImage method to crop and draw individual frames from a sprite sheet, control frame speed, and create varied beetle morph visuals responsive to in-game events.
Explore how requestAnimationFrame adapts to refresh rates and provides timestamps for delta time. Use delta time and a sprite timer to update sprite frames every 500 ms for smooth animation.
Animate the player using a sprite sheet and separate jets, controlling frame X and source X to react to independent movement and attack inputs for responsive, layered gameplay.
Design and implement a unique armored enemy for a 2d space shooter, exploring how behavior, properties, and visuals create varied challenges, then crack their shells with calibrated lasers.
Create the rhino morph enemy class by linking four lives to sprite sheet frames, swapping frames as health changes, and override the hit method with math.floor to clamp max lives.
Boss battles demand raw firepower and long-range tactics against an unknown creature with tellurium polymer armor, while avoiding these massive delirium claws to preserve shields.
Create a boss class that spawns a 200 by 200 pixel boss centered at the top with randomized horizontal movement, increasing lives per wave, and a sprite sheet for animation.
Demonstrates boss movement and collision in a canvas game: bounce off edges, animate sprite frames, respond to hits, manage lives, trigger explosions, remove defeated bosses, and award points.
Coordinate boss and player collision to trigger game over only when the boss has lives and is fully visible, while waves rise in difficulty with more boss health.
Upgrade the reactor with plutonium to unleash superweapons by focusing energy into a powerful light column that burns through swarms of enemies while managing heat to avoid overheating.
implement resource management with a rechargeable energy bar and render two weapons: the long range laser and the super laser, via a parent laser class and two subclasses.
Implement laser damage mechanics by applying per-tick collision checks between lasers, enemies, and bosses, tune small and big lasers, and throttle damage timing for consistent play across devices.
Implement a resource management system by adding an energy bar, laser energy costs, cooldown mechanics, and automatic recharge to balance laser usage and prevent overheating.
Implement eagle morph enemies from sprite sheet. Create a wave with 80% eagle morphs, 10% rhino morphs, and 10% beetle morphs, and add a projectile pool to shoot back.
Pull from the enemy projectiles pool, spawn from the enemy center, animate mutated projectiles with a sprite sheet, limit to four shots, and recycle off-screen projectiles.
Show how enemy projectiles collide with the player, reset to the pool, and reduce lives to trigger game over. Include basic and laser interactions, with eagle morphs ignoring lasers.
Add enemy types with flexible sprite sheets, including squid morph inflatable enemies that absorb projectiles, inflate, and pop, and run waves at 25% squid, 25% rhino, 20% eagle, 30% beetle.
Split the lobster morph by hitting it to create clones, then target the copies; reuse a sprite sheet, manage max frames and lives, and balance enemy variety for strategy.
Now that we understand the basics of JavaScript game development, let's build another project. It's another space game, but this time with a twist!
Define a planet class with x, y, radius and a draw method using arc for a circle. Create a game class to render and pass the game reference to planet.
Bind a mouse move listener in the game class constructor using an ES6 arrow function, capture offsetX and offsetY, and render a planet-to-mouse line with a canvas animation loop.
Create the player class to manage visuals, behaviour, and controls. Use render loop and a radius 40 hitbox to move, draw a circle and image, and attach to the mouse.
Implement calc aim to compute 2d distance and direction between the planet and the mouse, using Pythagoras, returning an array with horizontal and vertical values to rotate the player.
Rotate the player spaceship to face the mouse by translating the rotation center to the player, then applying canvas rotate in radians while using save and restore to isolate changes.
Implement key up event listeners to toggle a debug mode with the D key, log events, and conditionally draw hitboxes for the player and planet in the draw method.
Implement an object pool to reuse laser projectiles, reducing garbage collection and boosting performance, while firing toward the mouse cursor using start, reset, draw, and update methods.
Build a reusable projectile pool that automatically resets off-screen projectiles, ensuring continuous firing. Calculate direction with a calc method to launch from the spaceship tip toward the mouse or planet.
Create an enemy object pool in JavaScript with a 20-item pool and a free flag, start/reset activate/deactivate, draw/update only when active, and move enemies toward the planet using aim.
Remake retro games with JavaScript teaches a reusable circle collision check for circular hitboxes, using center distances, hypotenuse, and radii sums, returning true or false and resetting objects on collision.
Learn to spawn enemies periodically every second using delta time and requestAnimationFrame, pulling from an object pool and handling off-screen entry and projectile collisions.
Create an asteroid enemy class by extending the parent enemy class, using a sprite sheet with draw and crop techniques, and toggle collision circles in debug mode with D.
Animate sprites with a sprite sheet by selecting frames via frame x and frame y, and randomizing asteroid variations. Manage lives, hits, and explosions with timed sprite updates and pooling.
Create a Lobster Morph enemy with eight lives, sprite-sheet animation, and object-pool integration; rotate each enemy toward the planet using atan2 and canvas translate-rotate for correct rendering.
Render score, lives, and game over messages on the canvas with font and alignment. Award points only when enemies are shot and define a winning score.
Implement player lives, render life indicators as rectangles, handle collisions to reduce lives, and use score and winning score to trigger game over or victory, featuring asteroid and lobster morphs.
Import and adapt Battlemorph sprite sheets to create the Beetle Morph enemy class, then use an enemy pool and simple random logic to spawn Beetle Morph, asteroid, and Lobster Morph.
Create a rhino morph enemy type for a JavaScript Space Invaders clone, using a new sprite sheet, four lives, and a randomized spawn into the enemy pool.
Build a mobile game by writing core logic, then add graphics, animations, and sounds for a fullscreen, touch-based cartoon space horror playable on any device; reuse boilerplate for multiple games.
Set up an index.html with a canvas, add a global reset and centered layout, apply a cover background, and implement fullscreen and reset controls styled with the Google font Bangers.
Develop the core game logic in JavaScript, use a canvas 2d context, and build a responsive game that resizes with the window via an ES6 class and arrow-function resize handler.
Create an enemy class in a separate Nmjs file and connect it to the main game to render and animate a swarm of enemies on the canvas.
Turn enemies into object pool members, activating with start and deactivating with reset, updating and drawing only active enemies for improved performance.
Activate enemies periodically using a 1000 ms timer with delta time from requestAnimationFrame, reusing an object pool and updating and drawing active enemies.
Create a custom mouse object with x, y, and pressed to track mouse and touch input, use an ES6 arrow function for mouse down, and share coordinates across the codebase.
Build a reusable axis-aligned rectangle collision detector and apply it to detect collisions between the mouse and enemies, reset objects on collision, manage lives, and support responsive and touch interactions.
Use a single mouse object to handle both mouse and touch events, mapping touchstart to mouse down and touchend to mouse up, and read coordinates from event.changedTouches[0].pageX and pageY.
Learn to render game status text in a JavaScript canvas by separating drawing into methods, displaying left-aligned score and centered enemy lives, and handling game over with single trigger messages.
Start and restart the retro game via the reset button or enter and r, wiring the start method to user input and resetting score, lives, and enemies from the pool.
Toggle full screen in your JavaScript games using a simple if-else toggle, with spacebar or F on desktop and touch gestures on mobile, and integrate controls, reset, and game loop.
Adapt your game to different screen orientations by loading images from a hidden assets container and rendering player lives as crew sprites with canvas drawImage.
Demonstrate a JavaScript enemy system with a base enemy class and Beetle Morph, using a state design pattern, shared and unique properties, and update and collision handling.
Draw and crop sprite sheets using the nine-argument draw image method, control frame x and y, and vary enemy sprites with randomized frames to create animated explosions and variations.
Use delta time based sprite timer to control frame jumps. Improve enemy order so top enemies update and destroy first, and apply random size modifiers to scale sprites.
Implement a toggleable debug mode in the game class to display collision boxes and enemy lives, toggle with the D key, and prototype complex enemies using a state design pattern.
Explore enemy variety using 100x100 sprite sheets, multiple morphs (lobster and beetle), and frame-based animation; compare simple if-else implementation with the state design pattern and discuss one-time actions in updates.
Randomize the space crew by assigning each member a sprite sheet frame (frame x and y) from humanoid and robotic assets, cropping frames for 15 lives and defending against aliens.
Explore implementing the state design pattern to drive phantom morph enemies with solid and invisible phases, timing hits, bounce movement, and audio-visual feedback through sprite animation and sounds.
Leverage the state design pattern to manage a phantom morph enemy across flying, phasing, and imploding states, using per-state start and update logic and shared game access.
Learn to manage game audio in a JavaScript remake using HTML audio, an audio control class, and a replay method for sounds like boom and slide tied to gameplay.
Old is gold. Let's get inspired by the classic games from the 80's and add our own graphics and game features. Explore the interstellar void and use 3 different weapon types to burn through swarms of space bugs of different types, some larger than the others.
We will start with a game loosely inspired by the classic Space Invaders arcade and we will experiment with different additional features such as boss battles, super weapons and different enemy types.
Let's explore object oriented programming with JavaScript and implement a useful set of basic 2D game development techniques such as object pool design pattern, sprite animation, timing and staggering techniques using timestamps and much more.
Don't forget to download all the bonus gifts. Students of this course will get a pack of premium quality 2D game art, this time in a sci-fi space theme. You can also download the source code from multiple stages of the project, as we gradually add more features.
We will implement multiple enemy types:
Beetlemorph - basic enemy, 1 hit is enough
Rhinomorph - armored enemy, multiple lives, multiple damage states
Mantismorph - massive boss size enemy, increasing pool of lives
Eaglemorph - when hit, it will sacrifice a body segment and it will spit it back
Squidmorph - unknown alien bug, use everything we learned to implement your own unique enemy type
and more ...
Have fun!