Home > Articles > Web Development

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

1.8 Exercises

  1. Use a different image for the background.
  2. Draw the runner at different locations in the canvas.
  3. Draw the background at different locations in the canvas.
  4. In the draw() function, draw the runner first and then the background.
  5. 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?
  • + Share This
  • 🔖 Save To Your Account