PyGame Snake Beginner Tutorial in Python - PART 3 | ADDING FOOD!

preview_player
Показать описание
In this Python Snake Tutorial I cover adding food for the snake to eat!

Рекомендации по теме
Комментарии
Автор

The line; food[0] = cell_size * random.randint(0, (SCREEN_WIDTH / cell_size) - 1) threw and error for me because in Python 3 dividing two ints will convert to a float, which doesnt work for random ints. I wrote the line with '//' instead which solved the problem.

Allieope
Автор

If you found the video useful, please support the channel by *_LIKING_* and *_SUBSCRIBING_* . Thanks, Russ :)

CodingWithRuss
Автор

I realize this is long after the fact, (and please correct me if I'm wrong) but everything from 6:00 to 7:21 is unnecessary and can be removed without changing the functionality at all. You're directly placing the new segment, but the very next time the snake moves, that segment's position is being automatically copied from the next piece when you move the snake.

sb...
Автор

Thank you for sharing all these tips! I'm better at Pygame bacuse of your tutorials.

nadaali
Автор

Loving this tutorial, quick question though, when adding a new piece to the snake, why do you have to make snake_pos a list?? Isn't it already one??

marcosnovelli
Автор

I keep getting "module random has no attribute randint", can somebody help with that?
I am using PyCharm for this project.
EDIT: I figured it out, nevermind

Slap
visit shbcf.ru