0
Why is this my program not working? That is in my discription
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 changes(x,y): aim.x = x aim.y = y def inside(head): return-200<head.x<190 and -200 <head.y <190 def move(): head = snake [-1].copy() head.move(aim) if not inside(head) or head in snake: square(head.x,body.y,9,'green') square(food.x,body.y,9,'red') update() ontimer(move, 100) hideturtle() tracer(false) listen() onkey(lambda:changes(10,0),'Right') onkey(lambda:changes(-10,0),'Left') onkey(lambda:changes(0,10),'Up') onkey(lambda:changes(0,-10),'Down') move() done()
5 odpowiedzi
0
please use code playground to share code. also, for future reference, tags for this would be: turtle, python, tkinter, error
meanwhile, i will try the code and see what i get, as i am only semi-familiar with turtle. bon voyage...
edit: what is freegames?
0
Thanks! But I think you dont know more about freegame, python, turtle etc.
0
i am unfamiliar with freegame, and know fairly less about turtle than some, but i know basic python very well. if you can tell me where you got the freegame module i will try it out (i am used to livewires modified)
0
this is the module "freegames" that works in your laptop or any pc easily. No mention bro, You're very well! Nice to meet you
0
where did you get it? is it in the pip repository?