Quiz

quiz.jpg

  1. What is LameLCD? What is LameGFX?

  2. What happens when you try to draw graphics off the screen?

  3. How can you draw a sprite in multiple places on the screen?

  4. In this tutorial, we used the following command to draw the snake’s head:

    gfx.Sprite(@dot_gfx, snakex[0], snakey[0], 0)

    What happens if @dot_gfx is replaced with zero? Why?

  5. When we were setting the boundaries of the screen, we used the code constant(128-2) and constant(64-2) for the right and bottom edges.

    1. Why are we subtracting 2 from the right and bottom edges, but not from the top or left edges?

    2. What does the constant() keyword appear to do?

      constant(128 * 2 - 2)
  6. Without changing the graphics, how could you start the game as a snake instead of a dot?

  7. List two possible ways to speed up the snake (they don’t have to be good ways):

  8. When you start the game, and when you eat a food pellet, a new one is randomly generated anywhere on the map.

    1. What would happen if the food appeared where the snake already was?

    2. What could you do to prevent that from happening?

  9. We wrote code so that the snake dies when it overlaps itself. We also made it so the snake couldn’t go off-screen. However, we never wrote any code that would kill the snake when touching the edge of the screen, but somehow that’s what happens. Why do you think that is?

results matching ""

    No results matching ""