How to change the backdrop colour in WoofJS

2D Game Design with WoofJS

🕑 This lesson will take about 2 minutes

In this lesson, you will learn how to change the backdrop colour of a game in WoofJS (so you can use a colour instead of an image for the backdrop). To specify a colour, you will need to use a hexadecimal (hex) value that represents a particular colour. Hexadecimal values are 6 characters long and are made up of numbers between 0 and 9, and letters between A and F. Hexadecimal values are used to define the mix of red, green and blue that makes up a colour. There are millions of colours that can be represented in hexadecimal. You can read more about how this works here.

Create a new project at woofjs.com and add the following code to your game project. Read the comments in the code that explain how it works.