< Back
Page 8 of 8
This chapter is from the book
1.8 Exercises
- Use a different image for the background.
- Draw the runner at different locations in the canvas.
- Draw the background at different locations in the canvas.
- In the draw() function, draw the runner first and then the background.
- Remove the width and height attributes from the snailbait-game-canvas element in index.html and add width and height properties—with the same values of 800px and 400px, respectively—to the snailbait-game-canvas element in the CSS file. When you restart the game, does it look the same as before? Can you explain the result?
< Back
Page 8 of 8