
Snake and apple game in python pygame – 1. Intro and create surface | Python project tutorial
codebasics
Views: 28997
Like: 571
In this pygame tutorial we will build a snake and apple game. This python project for beginners is perfect for you to get exposure on how you can build end to end python project after learning basic tutorials. In this video we will build a pygame surface and draw a block that can be moved using up,down,left, right arrow keys.
Code:
Final code for complete game:
Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I’ve been using Kite and I love it!
Hindi playlist for this snake game: –
English playlist for this snake game:
Python tutorials (first 16):
Python Hindi tutorials (first 16):
Discord:
Website:
Facebook:
Twitter:
Linkedin:
DISCLAIMER: All opinions expressed in this video are of my own and not that of my employers’.
01.04.2022
Do you want to learn technology from me? Check https://codebasics.io/ for my affordable video courses.
BLOCK IMAGES KI LINK NHI HAI
I've been waiting for this since the date of announcement
Once you make the game, could you make an ai for it?
Waiting
Sir videos will be launched weekly ?
Yess finally
Love ❤️❤️❤️❤️
can you please tell me which technologies should i learn that would have more scope in future like after 5 6 years
Can I do that coding in Jupyter notebook to build same project
This is a nice video. You must have work really hard
That's awesome 💓🙂 many things to learn from your tutorial
Hi Dhawal 1st of all thank you for all of your hard ward which you are doing for us.. Just wanted to ask you that is this series would be helpful for people who is looking career in Data Analyst? Have watched your Power BI series which is absolutely amazing leant alot from it so wondering is this python series is also based on Data Analysis?
Sir how to get these images any link??
Can you please tell me which PC I build to web and app development to very low budget like 25000 thousand rupes
Thank you, Sir
Tutorial on how to teach to the game to play using tensorflow
How do I start to learn data science? First, I have to learn AI and ML, is that right………
I have learn python language and its libraries but not machine learning.. So plz. Upload more project simply on python language.. So that we can show it while applying for data analytics job
Thanks for this project… Sir
Hi, I am writing the code in spyder and the 'pygame window' is not responding. But if i try this its working, Can u help ,e understand the problem
import sys, pygame
screen = pygame.display.set_mode( (800,600))
while True:
screen.fill ( (255,255,255) )
pygame.display.flip()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
Thank you so much
I like the way you teach. The pace and explanation very clear. Keep them coming. Thanks
thx
You are awesome.your teaching style is superb
I Have'nt seen anyone in my life with this Patience 🙀🙂 Nice explanation 🚩
I love such practical course videos instead memorizing a ton of tutorials content
Hi Sir, Thanks for your effort.
This is my first Python project. I have entered the same code written until 7.40 min. When I ran the python file I am not getting any output (the program is continuously running). I have installed Pygame module for this project. When checked in the project folder it is seen as Pygame.iml (I doubt if this could be the reason for my problem. Can you please clarify on the same?
"this can be done by a grade 5 student, its dam easy"
And here I am, a 30 year old in Computer Engineering trying to figure out how the hell to get a dam pygame installed
sir i am not getting any block jpg can you pls give me the image
and sir how to add the image in pycharm
i am in love with this person
How to download pygame using pip install? I am using IDLE 3.9 for python, and don't know how to, anyone please help.
It is working fine untill the disabling surface.fill line in draw_block function.
But as I enable it, the screen closes after pressing any key. Why?
Can I do it in visual studio code???
Thank you very much for making this tutorial! Excellent work!
I am getting a error in line block = pygame.image.load("resources/block.jpg").convert() It is showing me the error = FileNotFoundError: No such file or directory. Pls Help
Hello!
I got the code to work up until the point where the block had to be 'drawn' on to the surface (the game window) using the 'surface.blit' function, I got the error : " TypeError: 'pygame.Surface' object is not callable"
I have been trying to fix the error but to no success,
Help would be greatly appreciated,
Thanks 🙂
Great video so far 🙂
apart from that error, all works fine for me 🙂
sir please provide description to mention in resume
its saying i dont have pygame
Sir urdu wala chanel kaa link send kar dain nahii mil raha please
Bro iam getting error to that block image bro how to slove iit
thanks bro
how to download pygame?
5:35
19:59
where can i find the resources
Where are the images, not found in git hub