Code Snake Game in Python
HTML-код
- Опубликовано: 2 июл 2024
- Python snake game! How to code a snake game in Python for beginners! Learn how to create a game of snake in Python using tkinter graphics library. Throughout the tutorial, you will learn how to create a graphical user interface (GUI) to display the Snake game, create the game loop, listen for Key presses to move the snake, use a list to store the snake's segments, and check collision and out of bounds for game over.
Setup Python with Visual Studio Code:
• How to set up Python o...
Code: github.com/ImKennyYip/snake-p...
Website: www.kennyyipcoding.com/
Python Game Programming Projects Playlist:
• Python Game Programmin...
Java Game Programming Projects Playlist:
• Java Game Programming ...
JavaScript Game Programming Projects Playlist:
• JavaScript Game Progra...
Subscribe for more coding tutorials 😄!
My first game complete. Took me 4 days working on it after work every night. Thanks was fun
This was very useful, i took notes on how certain things work, and how to do them, it was so fun finally fixing a problem and then it working, i think I'm going to follow more of your tutorials
did the whole thing in about two hours with no python knowledge. was great fun, but sometimes it takes some time to figure out, what certain things mean or why the large or lower case actually matters. but great video, i think i will go on with other ones on your channel
Thanks! Interesting video and easy to follow 👍🏻
i kinda love that the tkinter symbol kinda fits
very usefull tutorial, thanks a lot
thx for the tutorial :D
your videos are great... really very helpfull
Code Snake Game in Java: ruclips.net/video/Y62MJny9LHg/видео.html
Code Snake Game in JavaScript: ruclips.net/video/baBq5GAL0_U/видео.html
thank u for the tutorial
how do you create the dimensions and squares that were already there?
Your explanations are always very clear and understandable. Do you plan on adding Python/Pygame game development in the future?
can u do the stick hero game next?
can you tell me how i can make the game restart using space when its game over?
at 25.22 it says to type a for command but now i cant run the code. im so confused??
how to really start learning programming with python ? no matter if i just like to make a game or try to change my future work etc
Amazing tutorial and everything worked out. I tried changing the background with a custom photo, I watched different kinds of tutorials but It just doesn't work. Can someone help please?
For some reason borderwidth had no effect for me, I was using windows 11 too so I would have expected it to work.
Everything was fine until the snake head and food! For some reason the snake head didn’t show up when I ran it, but there were no bugs, I said oh well and done the food too just to see if it would show then, no food and no snake head! Idk how
Check the completed code in the description to see what you’re missing.
why the background color isn't working for me? and centering the window too.
you have a typo somewhere or you missed something. I also have the completed code in the github link in the video description if you need a closer reference
I‘m currently at minute 28 but when my snake eats the food, it just stops moving and I can‘t get it to move anymore. The food disappears and appears somewhere else. Why does my snake stop?
Fixed it. I changed the color of the snake to blue because it didn’t let me use „lime_green“ somehow
it doesnt center for me even if i copied the code in github
how do i connect the strings_
?
no
idea
Good tutorial Im stuck here on moving the snake
im getting this error
'Event' object has no attribute 'keysym'
on the change_direction method
Could be a typo somewhere, I left the completed code link in the video description if you want to compare line by line
@@KennyYipCoding i get the error keysym unknown word.
and i re wrote it like 5 times and used ur code inplace and stil cant get passed it lol ^^^^^^^^^^^^^^^^
File "c:\Users\jeremy\snake.py", line 39, in change_direction
if (e.KeySym == "Up"):
^^^^^^^^
AttributeError: 'Event' object has no attribute 'KeySym'. Did you mean: 'keysym'?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\jeremy\AppData\L
AND YEs i tried even capitolizingi t. nothing makes a diference. all lower or capitolizing doesnt matter.
bro on the 28th row how do you make that
What do you mean?
cant code a reset... can anyone help?
you basically need to reset the variables to the original starting values and change game over boolean back to false
the time in the bottom right corner is 3:00am?!
Yesssir, working hard for you all 🙂👍🏻
bro that key move in my vscode is shit
why u doing this shit at 3:50 AM
i keep getting this error _tkinter.TclError: bad geometry specifier "625*625+455+119" when i try centering the window
should be x and not *
Thank you!