Spicy Yoghurt tutorials

Recent tutorials

A murmuration of starlings
JavaScript | 6 November 2026

Simulate a flock of birds with boids in JavaScript

Simulate a flock of birds in JavaScript with the boids algorithm. Code the three rules of flocking one by one, with a live demo for each step. Then add obstacles and a predator, and give the boids a field of view. By the end of this tutorial, you'll have a flock of thousands of boids running smoothly in your browser.

A container ship
HTML5 game | 5 November 2026

Finish and publish your HTML5 game

Learn how to publish your HTML5 game on the web, on game portals, in the app stores and on Steam. But first, look back at the bee game you've built in this tutorial series and play a more polished version of it, complete with source code.

Sound effects and music for your game
HTML5 game | 5 November 2026

Add sound effects and music

Learn how to add sound effects and music to your JavaScript game with the Web Audio API. Play several sounds at once, control their volume and panning, make a sound a little different every time it plays and create your own sound effects in code. By the end of this tutorial, the bee game from this series will have sound effects and its own music.

HTML5 game development tutorials
HTML5 game | 5 November 2026

How to make an HTML5 game

Learn how to make an HTML5 game with JavaScript, step by step and for free. Find out how a browser game works, what you need to get started and when a game engine helps. Then follow the series and build each part of your own game.

A handheld game console
HTML5 game | 4 November 2026

Manage game states with a simple state machine

Learn how to add game states to your JavaScript game, from the start screen to game over. Build a simple state machine without a game engine, pause the game and restart it cleanly. By the end of this tutorial, you'll have a real game with a score, lives and a high score to beat.

Highlighted tutorials

Action and reaction in physics
HTML5 game | 30 October 2026

Collision detection and physics

Learn JavaScript collision detection for your canvas game. Check if rectangles and circles overlap, and make objects bounce off each other with simple physics. By the end of this tutorial, you'll have a small physics simulation with mass, gravity and restitution. Along the way, you can try every step in a live demo.

A loop in a roller coaster
HTML5 game | 31 October 2026

Create a proper JavaScript game loop

Build a smooth JavaScript game loop for the canvas with requestAnimationFrame. Learn about delta time and fixed timesteps, and measure fps with live demos. By the end of this tutorial, you'll have a complete game loop ready to use in your own game.

Tutorial series

Create your own HTML5 game

HTML5 game
Learn how to create a game in HTML5 and JavaScript with this tutorial series. Start with a blank canvas and work through the core principles of game development.

Development tools

Easing functions

For JavaScript and CSS

Easing makes things speed up and slow down as they move, so they don't look stiff. Find the right easing for your animation or game. Use our easing tool to see each easing function in action and make your project come to life.

Folder Compare

Spot the differences between folders

Compare two folders and see right away which files were added, changed or removed. Your files never leave your computer. Handy for checking your builds, backups and asset folders.

All tutorials

A murmuration of starlings
JavaScript | 6 November 2026

Simulate a flock of birds with boids in JavaScript

Simulate a flock of birds in JavaScript with the boids algorithm. Code the three rules of flocking one by one, with a live demo for each step. Then add obstacles and a predator, and give the boids a field of view. By the end of this tutorial, you'll have a flock of thousands of boids running smoothly in your browser.

A container ship
HTML5 game | 5 November 2026

Finish and publish your HTML5 game

Learn how to publish your HTML5 game on the web, on game portals, in the app stores and on Steam. But first, look back at the bee game you've built in this tutorial series and play a more polished version of it, complete with source code.

Sound effects and music for your game
HTML5 game | 5 November 2026

Add sound effects and music

Learn how to add sound effects and music to your JavaScript game with the Web Audio API. Play several sounds at once, control their volume and panning, make a sound a little different every time it plays and create your own sound effects in code. By the end of this tutorial, the bee game from this series will have sound effects and its own music.

HTML5 game development tutorials
HTML5 game | 5 November 2026

How to make an HTML5 game

Learn how to make an HTML5 game with JavaScript, step by step and for free. Find out how a browser game works, what you need to get started and when a game engine helps. Then follow the series and build each part of your own game.

A handheld game console
HTML5 game | 4 November 2026

Manage game states with a simple state machine

Learn how to add game states to your JavaScript game, from the start screen to game over. Build a simple state machine without a game engine, pause the game and restart it cleanly. By the end of this tutorial, you'll have a real game with a score, lives and a high score to beat.

An arcade joystick
HTML5 game | 1 November 2026

Build game controls for keyboard, mouse and touch

Learn how to add keyboard, mouse and touch controls to your JavaScript game. Move a player smoothly with the arrow keys or WASD, drag objects with pointer events and build a virtual joystick for phones. By the end of this tutorial, you'll be flying your own bee through a swarm of other bees.

Create Conway's Game of Life on the HTML5 canvas
JavaScript | 31 October 2026

Create Conway's Game of Life in JavaScript

Create Conway's Game of Life in JavaScript on the HTML5 canvas. Learn the rules, check which cells live or die each generation and draw your own cells with the mouse. Load famous patterns like the glider gun, and get the complete code in a single HTML file.

Prepare a blank canvas
HTML5 game | 31 October 2026

Set up an HTML5 canvas game

Set up an HTML5 canvas for your game with JavaScript. Learn how to scale the canvas to fit any screen, without blurry graphics. By the end of this tutorial, you'll have a canvas template to start every game with, and your first graphics on the screen.

Dice, the oldest random number generator
JavaScript | 31 October 2026

Generate random numbers in JavaScript

Generate random numbers in JavaScript with Math.random(). Get a random integer between two numbers, a random boolean or a random item from an array. Build your own random number generator, shuffle an array, give rare loot a small chance and get the same random numbers again with a seed.

Store data
JavaScript | 31 October 2026

Store data with HTML5 local storage

Learn how to use HTML5 local storage to store data in the browser with JavaScript. Store and read strings, numbers and entire objects with setItem() and getItem(), and remember settings and progress between visits. Find out about the limits, the pitfalls and when to use sessionStorage instead.

Motion blur
HTML5 game | 31 October 2026

Create a smooth canvas animation

Create a smooth canvas animation with JavaScript. Learn how to clear the canvas, add motion trails and easing, and keep it sharp on every screen. By the end of this tutorial, you'll be able to create a basic animation with JavaScript.

A loop in a roller coaster
HTML5 game | 31 October 2026

Create a proper JavaScript game loop

Build a smooth JavaScript game loop for the canvas with requestAnimationFrame. Learn about delta time and fixed timesteps, and measure fps with live demos. By the end of this tutorial, you'll have a complete game loop ready to use in your own game.

Draw on a canvas
HTML5 game | 31 October 2026

Draw lines, shapes and text

Draw lines, shapes, curves, paths and text on the HTML5 canvas with JavaScript. Try every example in the live playground and save your drawing as an image. By the end of this tutorial, you'll be able to draw your own game graphics and text, with colors, gradients and shadows.

Frame-by-frame animation
HTML5 game | 30 October 2026

Draw images and sprite animations

Learn how to draw images on the HTML5 canvas with drawImage(), and turn a sprite sheet into a JavaScript sprite animation. By the end of this tutorial, you'll have a swarm of animated bees buzzing around your game, each with its own hitbox and direction.

Action and reaction in physics
HTML5 game | 30 October 2026

Collision detection and physics

Learn JavaScript collision detection for your canvas game. Check if rectangles and circles overlap, and make objects bounce off each other with simple physics. By the end of this tutorial, you'll have a small physics simulation with mass, gravity and restitution. Along the way, you can try every step in a live demo.

Vector potion bottles drawn with Inkscape
Inkscape | 29 October 2026

Draw vector potion bottles

Learn how to draw a potion bottle in Inkscape, step by step. You'll draw a round glass bottle with a cork, add shadows and highlights, and fill it with a colorful potion. Along the way, you'll learn the basics of vector drawing in Inkscape.