gfx.Sprite(@dot_gfx, snakex[0], snakey[0], 0)
Quiz
-
What is LameLCD? What is LameGFX?
-
What happens when you try to draw graphics off the screen?
-
How can you draw a sprite in multiple places on the screen?
-
In this tutorial, we used the following command to draw the snake’s head:
What happens if
@dot_gfx
is replaced with zero? Why? -
When we were setting the boundaries of the screen, we used the code
constant(128-2)
andconstant(64-2)
for the right and bottom edges.-
Why are we subtracting 2 from the right and bottom edges, but not from the top or left edges?
-
What does the
constant()
keyword appear to do?constant(128 * 2 - 2)
-
-
Without changing the graphics, how could you start the game as a snake instead of a dot?
-
List two possible ways to speed up the snake (they don’t have to be good ways):
-
When you start the game, and when you eat a food pellet, a new one is randomly generated anywhere on the map.
-
What would happen if the food appeared where the snake already was?
-
What could you do to prevent that from happening?
-
-
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?