From the course: Building the Classic Snake Game with Python
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Adding the snake head to the game - Python Tutorial
From the course: Building the Classic Snake Game with Python
Adding the snake head to the game
Now, we're going to add a head to our snake using the snake head image. So a couple of preliminaries. In the last video, I forgot to adjust food size to the exact dimensions of the image, which was actually 32 by 32, so I'm doing that now. And now, we're going to add a constant for snake size. And again, this was to be the dimensions of the actual image we're using, which is a square image. So it's 20, the image is 20 by 20. Then we need to make use of this constant in a couple of places in our code. So the first one is in our offsets and I'm doing this so that we can have a different image if we want, and the code will actually accommodate a different snake size, which we define as a constant. The other place we need to update this is in our reset function. So instead of assuming that it's 20, we're going to adjust that to use the snake size. So this is snake size times two and this one is snake size times three. Okay. So that's the preliminaries. And then for our stamper, we're…