
Code a Snake Game with Python and Pygame - - Tutorial
video description
Date: 2022-03-14
Related videos
Comments and reviews: 10
Rafy-Ivan
Rafy-Ivan Morales-
0 seconds ago-
I'm a new student trying to learn, so I can become a programmer with python and I have a project on how to make a port scan.-
So far I already make a port scan with Python3, and it scans fine, give a date and everything working good so far. -
I see on your video tutorial, it is very good.-
I would like to ask for your advice if you can and guide me on how I will add this 3 -
in a Python script, I have:-
2. System should look for all the ports between the range of 1 to 1025 -
3. If the Ports is open, it should create a file and add an entry for port number -
4. In case of any exception for instance -host is not available-, -host name could not be resolved- or -
due to any other error, you need to write that exception into the same file.-
Thank you and Merry Christmas.
reply
Rafy-Ivan Morales-
0 seconds ago-
I'm a new student trying to learn, so I can become a programmer with python and I have a project on how to make a port scan.-
So far I already make a port scan with Python3, and it scans fine, give a date and everything working good so far. -
I see on your video tutorial, it is very good.-
I would like to ask for your advice if you can and guide me on how I will add this 3 -
in a Python script, I have:-
2. System should look for all the ports between the range of 1 to 1025 -
3. If the Ports is open, it should create a file and add an entry for port number -
4. In case of any exception for instance -host is not available-, -host name could not be resolved- or -
due to any other error, you need to write that exception into the same file.-
Thank you and Merry Christmas.
reply
Vlad
hey
After i finished the program i tested it several times and it worked with no issues, but now the game logic doesnt function properly, no changes to the code or files used inside it were made, yet still it doesnt work
I even tried copying the code of the author of this tutorial from github and it had the same game logic issue,
It would be of great help if you could help me solve this issue.
reply
hey
After i finished the program i tested it several times and it worked with no issues, but now the game logic doesnt function properly, no changes to the code or files used inside it were made, yet still it doesnt work
I even tried copying the code of the author of this tutorial from github and it had the same game logic issue,
It would be of great help if you could help me solve this issue.
reply
Guchi
To complete this excelent tutorial, I want to leave my contribution for make limits in our display, if snake touch this limits then game will be over
In class Game, make a new def named -limit- ---- def limit(self, x1, x2, y1, y2):
then define a condition : if x1 >= x2 or x1 < 0 or y1 >= y2 or y1
reply
To complete this excelent tutorial, I want to leave my contribution for make limits in our display, if snake touch this limits then game will be over
In class Game, make a new def named -limit- ---- def limit(self, x1, x2, y1, y2):
then define a condition : if x1 >= x2 or x1 < 0 or y1 >= y2 or y1
reply
itech
Nice tutorial, thank you very much:) I have a problem with the step where I add sounds. I did everything exactly as in the tutorial, but my game just exits whenever the snake eats the apple. If I delete the lines with pygame.mixer everything works normally. Anybody knows what might cause the issue?
reply
Nice tutorial, thank you very much:) I have a problem with the step where I add sounds. I did everything exactly as in the tutorial, but my game just exits whenever the snake eats the apple. If I delete the lines with pygame.mixer everything works normally. Anybody knows what might cause the issue?
reply
Dipankar
Hi, thanks for your valuable video. but how can i copy the score. my following score is not work although i have follow every steps of you:
score = font.render(f--Score: self.snake.length--, True, (255, 255, 255))
kindly inform me.
thanks a lot
reply
Hi, thanks for your valuable video. but how can i copy the score. my following score is not work although i have follow every steps of you:
score = font.render(f--Score: self.snake.length--, True, (255, 255, 255))
kindly inform me.
thanks a lot
reply
Premsanity
very confused, I had an issue where eating the apple was giving me a game over... so I went and took his exact code and it is still giving me game over after consuming the apple. very odd and incredibly confusing
reply
very confused, I had an issue where eating the apple was giving me a game over... so I went and took his exact code and it is still giving me game over after consuming the apple. very odd and incredibly confusing
reply
Omkar
In the starting when you were just creating a window in my desktop it did not do anything even I did it on PyCharm Community Edition
Is it because of different Python or PyGame version?
reply
In the starting when you were just creating a window in my desktop it did not do anything even I did it on PyCharm Community Edition
Is it because of different Python or PyGame version?
reply
Max
Does anyone know how to make the score counter go up by more than one when the snake eats the apple? My snake just instantly dies once I change the values in increase_length (Class snake).
reply
Does anyone know how to make the score counter go up by more than one when the snake eats the apple? My snake just instantly dies once I change the values in increase_length (Class snake).
reply
Jaskaran
Why didn't you just wrote this instead?
def is_collision(self,x1,y1,x2,y2):-
if x1==x2 and y1==y2:-
return True-
return False
reply
Why didn't you just wrote this instead?
def is_collision(self,x1,y1,x2,y2):-
if x1==x2 and y1==y2:-
return True-
return False
reply
Priscan792
i have an error, when my snake collects the apple, i get an index error saying -list index out of range-.
can you help me troubleshoot?
reply
i have an error, when my snake collects the apple, i get an index error saying -list index out of range-.
can you help me troubleshoot?
reply
Add a review, comment
Other channel videos















