Snake Game Python Tutorial - playproduction.de

Snake Game Python Tutorial

freeCodeCamp.org
Views: 518150
Like: 5554
Learn to code a snake game using Python and Pygame.

This is suited for intermediate level programmers with some experience but anyone is welcome to follow along.

If you are unsure about how to install/download pygame checkout this link:

Download the code:

Tutorial from Tech With Tim.
Check out Tim’s channel:

Learn to code for free and get a developer job:

Read hundreds of articles on programming:

213 Comments

  1. anyone getting the "'NoneType object is not subscriptable" error in the draw method in the cube class?

  2. ! stupid question warning !
    Is it possible to program the playing field as an object too? That way everything could have been included in classes. If possible, why doing otherwise?

  3. SyntaxError: unexpected character after line continuation character

  4. Python: I'm a snake… I'm a slithering snake

    Snake: Eat some apples

  5. hippity hoppity ur code is now my propety boi.

  6. not gonna lie (i am not his friend or anything i am random person) this was dea helpful tysm
    subscribed and liked

  7. if i copy this code on pycharm it seys error why????

  8. File "C:Usersmariosnake2.py", line 198
    print('Score: ', len(s.body))
    SyntaxError: unexpected character after line continuation character

    pls help

  9. I have a question how to make
    Snake enter To the other side and appear on the other side thank yo

  10. after creating a game in python how to make it to exe file and then play it?

  11. Can anyone tell me which algorithms are used in this CSP snake game??????? Urgent

  12. I have the same code but my window won’t open on pycharm. No errors, does anyone know why the window won’t open?

  13. 34:24: When I tried to run it, the snake would move toward the right, but as soon as I hit an arrow key, it displays this error:

    self.turns[self.head.pos[:]] = [self.dirnx, self.dirny]
    TypeError: 'tuple' object does not support item assignment

    I gained an understanding of most of the tutorial by giving verbose, meaningful names to all of the variables, but that error seems to be a show-stopper.

  14. Don't Copy of other youtubers (Tech With Tim)

  15. in drawGrid() why are we using 'w', instead of 'width'

  16. I have trouble downloading Pygame… I tried all the ways online to download it, but there is no way…

  17. Hey, Tim! I love your tutorials, but it's realy hard to understand what's going on, when u don't have HALF of code(
    When you don't have cube class and all it's functions, but still using them
    It made me cry, please don't make me cry next time!
    I'll appreciate it

  18. raceback (most recent call last):

    line 5, in <module>

    import pygame

    ModuleNotFoundError: No module named 'pygame'

  19. hey! so I've tried to recreate and follow your video but when I try to run it, the game window doesn't show up to me. Is there any possibility for you to help me? Thanks!

  20. very nice keyboard 🙂 love mechanical shiz, it doesnt sound lubed tho and its 2 years after post remember to lube 🙂

  21. this is literally the only tutorial on the internet that works

  22. ModuleNotFoundError: No module named 'pygame'?

  23. Ok first time doing Python for me. TBH I didnt understand at all how movement is handled. Yes it works but really I dont like much the explanations. (saying hum yea that's how i's done, is not a valid explanation imo)

  24. Not a good teacher.
    Thanks for trying though.

  25. Why does the controls sometimes seem unresponsive?

  26. In the code in the def main(): section it keeps saying while is a syntax error. Plus someone help me

  27. My pygame doesn't work on my laptop and I can't run the game to see if I'm following along correctly

  28. Even after getting to 32:23 its still showing me no grid, nor a red square, please help:)

  29. I understand that it was in 2018, but don't try in PyCharm in 2022. Naming is terrible, one is redrawWindow, other is message_box 🙁 , classes are low case. Anyway, I will try to finish the project just for fun working with pygame

Leave a Reply

Your email address will not be published.