Code skill Generating the First Floor Tile

This piece of code creates a <canvas> element to draw on, creating the background of the world. You will need to create the floor tiles using a floor function and put this into a world object literal, and then draw the tiles on the world. A loop will count through each tile in the array. You will also add a tick function using setTimeout to call itself 60 times a second. You will need this for later game builds.

See the Pen GB 1 M4 by Walker Books UK (@walkerbooks) on CodePen.