
| How to create a Snake game using python | | AK python |
We are using three libraries to create this epic game that is turtle, random and freegames
Snake game is an epic game. And it provides so many past moments to you
Download freegames:
* If You get impressed with my work Then Buy me a cup of coffee:
If you want the source code then subscribe our telegram channel :
Ask your doubts :
keep support me to get 10K subscribers❤
Thanks for watching ..!
Tags:
#snakegame #snakegamecode #python #akpython
All the videos, songs, images, and graphics used in the video belong to their respective owners and I or this channel does not claim any right over them.
Copyright Disclaimer under section 107 of the Copyright Act of 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research. Fair use is a use permitted by copyright statute that might otherwise be infringing.”
It is saying that there is no module named "freegames"..?🥵
why does it says No module named 'freegames'
How to add freegames module…..?
Pls help😔
Bro have all done but when I click runmondule the turtle graphics is not comming
Plz tell me solution
Hey man i cant start the code becouse it say "No module named 'freegames'" and this is my first game so please answer soon
thanks
which phyton is used make this
Which softwares to be download for this??
Please telme course outcome
Everything is done but there is much errors
I try to copy your comment and paste it in vs code but same errors occurred.
Please help me 🥺
Mere m ye run nhi hi ra h plz help
When i run it it is giving unindent does not match any outer indention level so what i do ☹️
I’ll try it right now
No work code invalid
Module not found error no model named free games please give solution
You can make an application for me
from freegames import square, vector
Please give me the solution. i faced a error in this line
Sir this codes are working(compile) but I cant able to see the output(no run)
What can I do now….
Very good and basic, easy to understand the basics of coding.
Hi, i wanted to know if there is a way i can make a score counter for this.
Can you help me for this?
Thank you bro
I have a problem, I typed everything excatly the same but when pressing 'run' it says
ModuleNotFoundError: No module named 'freegames'
What to do?
python version please
im sorry to bother you but it says no module freegames
I'm trying to do it with Google colab, but it does not recognize the module freegames (the other two modules have no problem). Any idea? thank you
I'm getting error, on second line, it's showing , no module named 'random' what does it means, plzzz help
Code is not running, it's writing no module named freegames
Thanks for upload your video
Unable to import freegames.package.
I cant install freegames module what can i do
i have followed every step but when i run the code nothing happens
Kuch bhi clr nhi dikh raha or yeh kaise start kiya yeh toh btaya hi nhi I mean kon si application mai open kiya hua hai
@AK Python NameError: name 'false' is not defined how to fix that ???
@AK Python NameError: name 'false' is not defined how to fix that
NameError: name 'false' is not defined how to fix that
NameError: name 'false' is not defined how to fix that plzz ????
from freegames import square,vector
ImportError: No module named freegames
there is no source like freegames what are you trying to do here
Still an error sir….Name error name 'head' is not defined…… Why..? it's already defined toh na…..
AK bro help me at hideturtle() it says "unindent does not meet outer indentation level"
Good bro
Hi Bro the code ran successfully but how to start and control the game. The control key??
Hey there AK! Would you mind using Tkinter in a video next time? (This is just a video request and not a demand)
And at the end I realized I don't have that freegames module🤦♀️🤦♀️🤦♀️
An error is showing that there is module name "freegames" exit.
What should I do now ?
error is 'return' is outside what can do
when i run it it it says vector not defined
Thanks man, the code worked perfectly!
Full code:
from turtle import *
from random import randrange
from freegames import square, vector
food = vector(0, 0)
snake = [vector(10, 0)]
aim = vector(0, -10)
def change(x, y):
"Change snake direction."
aim.x = x
aim.y = y
def inside(head):
"Return True if head inside boundaries."
return -200 < head.x < 190 and -200 < head.y < 190
def move():
"Move snake forward one segment."
head = snake[-1].copy()
head.move(aim)
if not inside(head) or head in snake:
square(head.x, head.y, 9, 'red')
update()
return
snake.append(head)
if head == food:
print('Snake:', len(snake))
food.x = randrange(-15, 15) * 10
food.y = randrange(-15, 15) * 10
else:
snake.pop(0)
clear()
for body in snake:
square(body.x, body.y, 9, 'green')
square(food.x, food.y, 9, 'red')
update()
ontimer(move, 100)
hideturtle()
tracer(False)
listen()
onkey(lambda: change(10, 0), 'Right')
onkey(lambda: change(-10, 0), 'Left')
onkey(lambda: change(0, 10), 'Up')
onkey(lambda: change(0, -10), 'Down')
move()
done()