Simple Python Turtle Graphics Game (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ม.ค. 2025

ความคิดเห็น • 138

  • @elyadk6836
    @elyadk6836 7 ปีที่แล้ว +3

    Hey Christian, the sole purpose of me coming here was to figure out how to move turtles using the arrow keys in 3.4! XD, and I realised that this is in an older version. If you could, it would be awesome for you to reply to this comment with a brief explanation and an example of how to move turtles with arrow keys.
    Regards

  • @arjunc2405
    @arjunc2405 5 ปีที่แล้ว

    I was very interested in making games of my own and you sir are the key to getting me on the right path! Do you have more tutorials?

  • @thomasfields2082
    @thomasfields2082 5 ปีที่แล้ว +1

    Where do you find the commands to type in? Is there a cheat sheet?
    Ex: Left, Right, Up, Down.

  • @vanguardgaming8435
    @vanguardgaming8435 9 ปีที่แล้ว +3

    Awesome Vid! I created a fourth function for the turtles navigation.
    ------------------------
    def decspeed():
    global speed
    speed -= 1
    ------------------------
    player.onkey(decspeed, "Down")
    ------------------------
    This code will slow down the turtle when you press the down arrow key.

  • @westonjustice9538
    @westonjustice9538 2 ปีที่แล้ว +2

    if your python project was crashing it might because you the did not setup the screen for some reason this fixes the problem hope this helps ;)

    • @TokyoEdTech
      @TokyoEdTech  2 ปีที่แล้ว

      Thanks for the help!

  • @arybis2466
    @arybis2466 4 ปีที่แล้ว

    Whenever I try to run the program, in IDLE, it shows that the program is not responding and in Spyder, nothing happens at all.

  • @hitarthpatel8352
    @hitarthpatel8352 3 ปีที่แล้ว +1

    Hey can you help me out with creating a Square hunt game on Python and turtle. Its very tough assignment for me

    • @TokyoEdTech
      @TokyoEdTech  3 ปีที่แล้ว

      Sorry - I don't really do requests.

  • @swastiksarkar
    @swastiksarkar 3 ปีที่แล้ว

    Why is my turtle moving with the updated speed as I press the up arrow. In your case when you are pressing the up arrow only then the speed increases and gets back to the normal speed after releasing the up arrow. In my case even after releasing the up arrow my speed is set to the current increased speed. Why is this happening?

    • @TokyoEdTech
      @TokyoEdTech  3 ปีที่แล้ว

      There is a link in the description labeled “NEED HELP?” Check that out and get back to me. Keep on codin’!

  • @TonyMacaroni69_
    @TonyMacaroni69_ 6 ปีที่แล้ว

    Hey, christian! Thanks for these awesome and helpful videos. So, i have a question: the code worked just fine up until the turning commands and so on. So what my turtle did was just moving forward as it was supposed to. But wehen i implemented the stuff with turning, my turtle just vanished. Don't waste to much time trying to answer this question but if you have an idea why this is happening i'd really appreciate an answer. Thank you

    • @TonyMacaroni69_
      @TonyMacaroni69_ 6 ปีที่แล้ว

      @@TokyoEdTech oh, i'm really sorry.
      So here's the pastebin link:
      pastebin.com/D0gVknNR
      And the error message:
      C:\Users\antho\AppData\Local\Programs\Python\Python37-32\python.exe C:/Users/antho/PycharmProjects/untitled5/random.py Traceback (most recent call last): File "C:/Users/antho/PycharmProjects/untitled5/random.py", line 3, in import random File "C:\Users\antho\PycharmProjects\untitled5
      andom.py", line 36, in player.forward(speed) File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 1637, in forward self._go(distance) File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 1605, in _go self._goto(ende) File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 3158, in _goto screen._pointlist(self.currentLineItem), File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 755, in _pointlist cl = self.cv.coords(item) File "", line 1, in coords File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 2466, in coords self.tk.call((self._w, 'coords') + args))] _tkinter.TclError: invalid command name ".!canvas" Process finished with exit code 1C:\Users\antho\AppData\Local\Programs\Python\Python37-32\python.exe C:/Users/antho/PycharmProjects/untitled5/random.py Traceback (most recent call last): File "C:/Users/antho/PycharmProjects/untitled5/random.py", line 3, in import random File "C:\Users\antho\PycharmProjects\untitled5
      andom.py", line 36, in player.forward(speed) File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 1637, in forward self._go(distance) File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 1605, in _go self._goto(ende) File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 3158, in _goto screen._pointlist(self.currentLineItem), File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", line 755, in _pointlist cl = self.cv.coords(item) File "", line 1, in coords File "C:\Users\antho\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 2466, in coords self.tk.call((self._w, 'coords') + args))] _tkinter.TclError: invalid command name ".!canvas" Process finished with exit code 1

  • @andreiarseni362
    @andreiarseni362 2 ปีที่แล้ว +1

    What IDE do you use?

    • @TokyoEdTech
      @TokyoEdTech  2 ปีที่แล้ว

      You're in luck - I have a video about this exact topic! th-cam.com/video/4bL-lCP2tec/w-d-xo.html

  • @muhammadmohsen8732
    @muhammadmohsen8732 7 ปีที่แล้ว +1

    great tutorials but i have question i am using python v3.6.0 and when i use onkey fuction it give me an error which says " 'Turtle' object has no attribute 'onkey' " can you please help me with that ? i want the turtle to turn right when i press right arrow thanks in advance

    • @muhammadmohsen8732
      @muhammadmohsen8732 7 ปีที่แล้ว

      i literally used your exact code in testing but i will post it :
      import turtle
      wn = turtle.Screen()
      wn.bgcolor("black")
      snake = turtle.Turtle()
      snake.color("blue")
      snake.shape('square')
      snake.penup()
      snake.speed(0)
      def turnleft():
      snake.left(90)
      def turnright():
      snake.right(90)
      snake.listen()
      snake.onkey(turnleft,"Left")
      speed = 1
      delay = input("press enter to finish")

    • @muhammadmohsen8732
      @muhammadmohsen8732 7 ปีที่แล้ว

      Christian Thompson but I already did try that and still got me the same error I will try again and tell youu thanks for the help

    • @yesveryprofesionalnameyes6055
      @yesveryprofesionalnameyes6055 6 ปีที่แล้ว

      Muhammad mohsen use wn.listen() and wn.onkey(fun, "key"). it works for me....

    • @utkarshjetly668
      @utkarshjetly668 6 ปีที่แล้ว

      same

    • @jonathanborisenko8982
      @jonathanborisenko8982 6 ปีที่แล้ว

      SkullMaster 1785 -Gaming And More Thanks.

  • @juliuscarvero1396
    @juliuscarvero1396 8 ปีที่แล้ว

    what idle you use ?

  • @wassimade6195
    @wassimade6195 6 ปีที่แล้ว

    Awesome video bro , thank u so much

  • @שיפרגון-י7כ
    @שיפרגון-י7כ 5 ปีที่แล้ว +1

    Onkey() and Listen() does not work anymore. Why?

    • @שיפרגון-י7כ
      @שיפרגון-י7כ 5 ปีที่แล้ว

      Please anyone who knows respond.

    • @שיפרגון-י7כ
      @שיפרגון-י7כ 5 ปีที่แล้ว

      Oh sorry for the bothering!
      I have already solved it.
      Thank you so much for listening to my comment!

    • @שיפרגון-י7כ
      @שיפרגון-י7כ 5 ปีที่แล้ว

      I really appreciate that.

    • @rosam5949
      @rosam5949 5 ปีที่แล้ว

      Hello, I am having the same problem, how did you solve it?

    • @שיפרגון-י7כ
      @שיפרגון-י7כ 5 ปีที่แล้ว +2

      ​@@rosam5949 Actually, My fail was here: I have wroted the turtle name that I want to control:
      p.listen()
      But instead I need to write "turtle"
      (Not the name of the turtle):
      turtle.listen()
      Then, I should write onkeypress() command:
      (New onkey() command form):
      turtle.onkeypress("put here your def",'Button')
      (The def must not have any "")
      (Button Left,Right,Down+any letter have to be with '(example)')
      In the def it must have to mention the turtle I want to control, Like this:
      def left():
      p.left(90)
      Ive just needed to give more attention to the video, Thats all.
      Thanks for reading.

  • @ective3083
    @ective3083 5 ปีที่แล้ว

    Is there a way you can hold the arrow keys instead of pressing them once every time? I am on python 3.7

    • @ective3083
      @ective3083 5 ปีที่แล้ว

      @@TokyoEdTech Thank you

  • @ryanrehman99
    @ryanrehman99 6 ปีที่แล้ว

    Hi, could you tell me why we use turtle.onkey(turnleft,"Left") instead of player.onkey((turnleft,"Left") ? On using player.onkey(turnleft,"Left") it shows the error - 'Turtle' object has no attribute 'onkey'

  • @spoiled_water8080
    @spoiled_water8080 7 ปีที่แล้ว +2

    AMAZING!!! DO MORE!!!

  • @luxurious0346
    @luxurious0346 7 ปีที่แล้ว

    Thank goodness
    *_I LIKE TURTLES_*

  • @Morrowindur
    @Morrowindur 9 ปีที่แล้ว

    Hey how do I make a character move while I'm holding down a key?

    • @Morrowindur
      @Morrowindur 9 ปีที่แล้ว

      Thanks man! Btw, amazing vids! Keep up the great work- you really helped me a ton!

  • @valizeth4073
    @valizeth4073 6 ปีที่แล้ว

    In C++ it's a really bad habit using global variables, such as speed in this case. We rather use classes with the variable as a private. Is global variables also bad in python?

    • @valizeth4073
      @valizeth4073 6 ปีที่แล้ว

      Ok, ty for the respond. I did not know that you could use classes in python.

    • @valizeth4073
      @valizeth4073 6 ปีที่แล้ว

      I'm learning python as my second language while C++ being my first, about 2-3 years ago. Allthough a very good tutorial :)

  • @thomasfields2082
    @thomasfields2082 5 ปีที่แล้ว

    My 7 year old is entertained, my 13 year old is talking smack. Family fun.

  • @blaze5120
    @blaze5120 4 ปีที่แล้ว

    Is this Python 3 ?

  • @shivanisingh5033
    @shivanisingh5033 7 ปีที่แล้ว

    Could anyone please elaborate the concept of "turtle.listen"?? At what places can we use this method?

  • @haniboutlat3711
    @haniboutlat3711 4 ปีที่แล้ว

    Wich ide do you use ?

    • @TokyoEdTech
      @TokyoEdTech  4 ปีที่แล้ว +1

      You’re in luck - I’ve made a video about this exact topic. Enjoy! th-cam.com/video/4bL-lCP2tec/w-d-xo.html

    • @haniboutlat3711
      @haniboutlat3711 4 ปีที่แล้ว

      @@TokyoEdTech 😁😅 Thanks

  • @sebastianwittrock5541
    @sebastianwittrock5541 8 ปีที่แล้ว

    I am having a problem with this code, for some reason my Python Interpreter does not recognize listen or onkey. Is there any suggestions about what I should do?

    • @sebastianwittrock5541
      @sebastianwittrock5541 8 ปีที่แล้ว

      Thank you for responding, I fixed the problem, I was using Python 3.5 which still had the Turtle module but apparently deleted some of the contents such as listen and onkey. I downloaded Python 2.7 and now it is working perfectly, thank you!

  • @ondrejk.3835
    @ondrejk.3835 5 ปีที่แล้ว

    Hey please help me. I am on python 3.8 and turtle.listen and turtle.onkey doesn't work. What command I should use ??

    • @ondrejk.3835
      @ondrejk.3835 5 ปีที่แล้ว

      @@TokyoEdTech Thank you so much.

    • @cezorgamingyt652
      @cezorgamingyt652 4 ปีที่แล้ว +2

      @@ondrejk.3835 can u please share the command

  • @Sovera-xb6cl
    @Sovera-xb6cl 9 หลายเดือนก่อน

    when i press the left arrow its not turning left

    • @TokyoEdTech
      @TokyoEdTech  9 หลายเดือนก่อน

      If you share your code I can take a look.

    • @zoki433
      @zoki433 9 หลายเดือนก่อน

      same

    • @TokyoEdTech
      @TokyoEdTech  9 หลายเดือนก่อน

      @@zoki433 Same - see my other comment in this thread.

  • @beeshepard
    @beeshepard 5 ปีที่แล้ว

    So, I would have thought a simpler way of changing the turtle's orientation would be to call the player.left() method from within the onkey() method - rather than calling the function you defined as "turnleft".
    like so: turtle.onkey(player.left(30), "Left")
    However that doesn't work. Is that a design restriction of Python, not allowing recursive method use? Or maybe I'm just not getting something... :-)

    • @beeshepard
      @beeshepard 5 ปีที่แล้ว

      @@TokyoEdTech The lambda trick worked, thanks for the tip! You are incredibly helpful with your videos and for you to respond to a comment like that is just above and beyond - well done!

    • @beeshepard
      @beeshepard 5 ปีที่แล้ว

      @Tech RK I just commented out the "player left" function, and used this line instead:
      turtle.onkey(lambda:player.left(30), "Left")

  • @Trxsharn
    @Trxsharn ปีที่แล้ว

    Hello nice series do you know how to control the speed of 2 turtles. The turtles are both using the global one so of i press up both of their speed goes up one. Please help me with this

    • @TokyoEdTech
      @TokyoEdTech  ปีที่แล้ว

      You can do:
      speed = 3
      speed2 = 5
      Adjust the rest of the code accordingly.

    • @Trxsharn
      @Trxsharn ปีที่แล้ว

      @@TokyoEdTech thank you for the fast answer! I didnt really think of that but doesnt that just change the animation speed?

    • @Trxsharn
      @Trxsharn ปีที่แล้ว

      @@TokyoEdTech I tried to do your game but with 2 turtles instead its a pretty big challenge

    • @TokyoEdTech
      @TokyoEdTech  ปีที่แล้ว

      @@Trxsharn Nope. The animation speed is player.speed(0).

    • @Trxsharn
      @Trxsharn ปีที่แล้ว +1

      @@TokyoEdTech oh yeah i forgot thank you very much! I will try it after im done eating

  • @jamestulk1722
    @jamestulk1722 5 ปีที่แล้ว

    Great video!!

  • @EVXDevelop
    @EVXDevelop 8 ปีที่แล้ว

    the window crashes when i run it :(

    • @EVXDevelop
      @EVXDevelop 8 ปีที่แล้ว

      No error message. Just when I run the program the window pops up and it stops responding

    • @bhavania9265
      @bhavania9265 6 ปีที่แล้ว

      same for me

  • @glode1726
    @glode1726 11 หลายเดือนก่อน

    ngl turtle is extremely east to learn

    • @TokyoEdTech
      @TokyoEdTech  11 หลายเดือนก่อน +1

      Indeed.

  • @quintinkuo3937
    @quintinkuo3937 4 ปีที่แล้ว +1

    while(Christian == 'help me a lot'):
    print("forever thank you!

    • @quintinkuo3937
      @quintinkuo3937 4 ปีที่แล้ว

      @@TokyoEdTech NO , thank you! :)

    • @Wakeem.Creations
      @Wakeem.Creations 4 ปีที่แล้ว +1

      christian = 'help me a lot'
      while Christian == "help me a lot'
      print("forever thank you\!

  • @knightmare6249
    @knightmare6249 7 ปีที่แล้ว +1

    My turtle doesn't move

    • @knightmare6249
      @knightmare6249 7 ปีที่แล้ว

      This is the code
      #Turtle graphics game
      import turtle
      #Set up screen
      wn = turtle.Screen()
      wn.bgcolor("Black")
      #Create player turtle
      player = turtle.Turtle()
      player.color("Blue")
      player.shape("triangle")
      player.penup()
      #Set speed variable
      speed = 1
      #Define functions
      def turnleft():
      player.left(30)
      def turnright():
      player.right(30)
      def increasespeed():
      global speed
      speed += 1
      #Set keyboard bindings
      turtle.listen()
      turtle.onkey(turnleft,"left")
      turtle.onkey(turnright,"right")
      turtle.onkey(increasespeed,"Up")
      while True:
      player.forward(speed)

  • @thefatkid12
    @thefatkid12 ปีที่แล้ว +1

    BRO THANK U SO MUCH

    • @TokyoEdTech
      @TokyoEdTech  ปีที่แล้ว +1

      You are quite welcome. Keep on codin'!

  • @osama4109
    @osama4109 3 ปีที่แล้ว

    turtle.listen()
    that didnt work out for ME... why?

    • @osama4109
      @osama4109 3 ปีที่แล้ว

      this is what i have done:
      #Turtle Graphics Game
      import turtle
      #set up screen
      wn = turtle.Screen()
      wn.bgcolor('lightgreen')
      #Create player turtle
      player = turtle.Turtle()
      player.color('blue')
      player.shape('triangle')
      player.penup()
      #Set speed variable
      speed = 1
      #Define functions
      def turnrigth():
      player.right(30)
      def turnleft():
      player.left(30)
      #Set keyboard bindings
      turtle.listen()
      turtle.onkey(turnleft, "Left")
      turtle.onkey(turnright, "Right")
      while True:
      player.forward(speed)
      delay = raw_input('Press Enter to finish.')
      exact code as you.

    • @TokyoEdTech
      @TokyoEdTech  3 ปีที่แล้ว

      Can you share the exact error message?

    • @Johainna
      @Johainna 2 ปีที่แล้ว

      @@TokyoEdTech AttributeError: '' object has no attribute 'listen' on line 16

    • @TokyoEdTech
      @TokyoEdTech  2 ปีที่แล้ว

      And the code?

    • @markbaradas5630
      @markbaradas5630 2 ปีที่แล้ว

      ​@@TokyoEdTech same problem😅
      This is the code👇👇
      #Turtle Graphics Game
      import turtle
      #set up screen
      wn = turtle.Screen()
      wn.bgcolor('lightgreen')
      #Create player turtle
      player = turtle.Turtle()
      player.color('blue')
      player.shape('triangle')
      player.penup()
      #Set speed variable
      speed = 1
      #Define functions
      def turnrigth():
      player.right(30)
      def turnleft():
      player.left(30)
      #Set keyboard bindings
      turtle.listen()
      turtle.onkey(turnleft, "Left")
      turtle.onkey(turnright, "Right")
      while True:
      player.forward(speed)
      delay = raw_input('Press Enter to finish.')

  • @kidnamedfinger5019
    @kidnamedfinger5019 5 ปีที่แล้ว +1

    The turnleft does not work. It tells me that is *invalid syntax (, line 24(turtle.onkey(turnleft "left")pylint (syntax-error)[24-1])*. Look at my good for a second please:
    import turtle
    #screen setup
    wn = turtle.Screen()
    wn.bgcolor('lightgreen')
    #create player turtle
    player = turtle.Turtle()
    player.color('blue')
    player.shape('triangle')
    player.penup()
    #set speed of player
    speed = 1
    #define functions
    def turnleft():
    player.left(30)
    #set keyboard stuff
    turtle.listen()
    turtle.onkey(turnleft "Left")
    #This line of code is giving me trouble!
    while True:
    player.forward(speed)
    delay = input("Press Enter To finish: ")

  • @mitchdg5303
    @mitchdg5303 6 ปีที่แล้ว

    i have read all the comments and have googled countless things but it just does not move when i press a key
    import turtle
    t = turtle
    wn = turtle.Screen()
    wn.bgcolor("black")
    player1 = t.Turtle()
    player1.color("white")
    player1.shape("triangle")
    player1.penup()
    while True:
    player1.fd(1)
    def turnleft():
    player1.left(30)
    t.onkey(turnleft, "left")
    t.listen()
    t.mainloop()

    • @joshabdill2047
      @joshabdill2047 6 ปีที่แล้ว

      The Daily Compilation try capitalizing the l in "Left"

    • @mitchdg5303
      @mitchdg5303 6 ปีที่แล้ว

      i got it sorted already thx

    • @Band.Caboose
      @Band.Caboose 6 ปีที่แล้ว +1

      @@mitchdg5303 How did you solve it? Can't get it to work

    • @hungrypenguino1827
      @hungrypenguino1827 4 ปีที่แล้ว

      @@Band.Caboose They changed it to onkeypress so try that

  • @deepakalai5884
    @deepakalai5884 4 ปีที่แล้ว

    while(creative=true):
    print ("prefect")

    • @akxyn5010
      @akxyn5010 4 ปีที่แล้ว +1

      Your code must actually be
      while creative==True:
      print('perfect')
      Nice thought btw :)

  • @bhavania9265
    @bhavania9265 6 ปีที่แล้ว

    *i have an error that turnleft is not recognised

  • @noobtimespronoobtimespro1379
    @noobtimespronoobtimespro1379 3 ปีที่แล้ว

    Traceback (most recent call last):
    File "C:/Users/HiHi/Documents/k.py", line 16, in
    turtle.onkeypress(turnleft, "left")
    NameError: name 'turnleft' is not defined
    my PROBLEM

    • @noobtimespronoobtimespro1379
      @noobtimespronoobtimespro1379 3 ปีที่แล้ว

      help me out

    • @TokyoEdTech
      @TokyoEdTech  3 ปีที่แล้ว

      Please would be nice.

    • @TokyoEdTech
      @TokyoEdTech  3 ปีที่แล้ว

      I’m happy to take a look, but I need to see the actual code. Please share your code via pastebin.com link so I can download and test it. To learn how, please watch this video and then get back to me: th-cam.com/video/L6AwVuu6O3Y/w-d-xo.html Keep on codin’!

  • @Theresalighthatentershouses
    @Theresalighthatentershouses 7 ปีที่แล้ว

    MY TURTLE WONT MOVE I AM ON PYTHON 3.6.1

    • @Theresalighthatentershouses
      @Theresalighthatentershouses 7 ปีที่แล้ว

      #Turtle Graphics Game
      import turtle
      #Set up screen
      wn = turtle.Screen()
      wn.bgcolor( "lightgreen" )
      #Create player turtle
      player = turtle.Turtle()
      player.color("blue")
      player.shape("circle")
      player.penup()
      #Set speed variable
      speed = ("10")
      #Define functions
      def turnleft():
      player.left(30)
      #set keyboard bindings
      turtle.listen()
      turtleonkey(turnleft, "Left")
      while True:
      player.foward(speed)
      delay = raw_input ("press Enter To Finish,")
      this is all of it so far :)

    • @knightmare6249
      @knightmare6249 7 ปีที่แล้ว

      My turtle won't moooovvee

    • @knightmare6249
      @knightmare6249 7 ปีที่แล้ว

      #Turtle graphics game
      import turtle
      #Set up screen
      wn = turtle.Screen()
      wn.bgcolor("Black")
      #Create player turtle
      player = turtle.Turtle()
      player.color("Blue")
      player.shape("triangle")
      player.penup()
      #Set speed variable
      speed = 1
      #Define functions
      def turnleft():
      player.left(30)
      def turnright():
      player.right(30)
      def increasespeed():
      global speed
      speed += 1
      #Set keyboard bindings
      turtle.listen()
      turtle.onkey(turnleft,"left")
      turtle.onkey(turnright,"right")
      turtle.onkey(increasespeed,"Up")
      while True:
      player.forward(speed)

    • @knightmare6249
      @knightmare6249 7 ปีที่แล้ว +1

      Cannot figure it out

    • @knightmare6249
      @knightmare6249 7 ปีที่แล้ว

      Traceback (most recent call last):
      File "C:/Users/Toshiba/Desktop/Goood.py", line 31, in
      turtle.onkey(turnleft,"left")
      File "", line 1, in onkey
      File "C:\Python33\lib\turtle.py", line 1386, in onkey
      self._onkeyrelease(fun, key)
      File "C:\Python33\lib\turtle.py", line 686, in _onkeyrelease
      self.cv.bind("" % key, eventfun)
      File "C:\Python33\lib\turtle.py", line 415, in bind
      self._canvas.bind(*args, **kwargs)
      File "C:\Python33\lib\tkinter\__init__.py", line 1039, in bind
      return self._bind(('bind', self._w), sequence, func, add)
      File "C:\Python33\lib\tkinter\__init__.py", line 994, in _bind
      self.tk.call(what + (sequence, cmd))
      _tkinter.TclError: bad event type or keysym "left"
      THis is the error help please!

  • @srujanpenikelapati6270
    @srujanpenikelapati6270 8 ปีที่แล้ว

    your trackpad for some reason triggers me

  • @cobra_yt7032
    @cobra_yt7032 4 ปีที่แล้ว

    import turtle
    back = turtle.Screen()
    back.bgcolour ('Blue')
    what I tried
    The error:
    back.bgcolour ('Blue')
    AttributeError: '_Screen' object has no attribute 'bgcolour'

    • @TokyoEdTech
      @TokyoEdTech  4 ปีที่แล้ว

      colour -> color :)

    • @dimdoodim3947
      @dimdoodim3947 4 ปีที่แล้ว +1

      Check spelling colour the American way, color

  • @bhargavpatel1673
    @bhargavpatel1673 8 ปีที่แล้ว

    Great Job..... Thanks For this

  • @ridgechang8131
    @ridgechang8131 5 ปีที่แล้ว

    ef is_collision(self, other):
    if (self.xcor() >= (other.xcor() - 20)) and \
    (self.xcor() = (other.ycor() - 20)) and \
    (self.ycor()

  • @yesveryprofesionalnameyes6055
    @yesveryprofesionalnameyes6055 6 ปีที่แล้ว

    dosent work in py 3?
    try to replace turtle.listen() whit player.listen() and turtle.onkey(turnleft, "Left") whit sc.onkey(turnleft, "Left")

    • @yesveryprofesionalnameyes6055
      @yesveryprofesionalnameyes6055 6 ปีที่แล้ว

      If player.listen() dosent work then try writing your screen variable name like mine is sc then i typed sc.listen() now there is no excuse for programm to not work i hope i fixed your program :D

    • @yesveryprofesionalnameyes6055
      @yesveryprofesionalnameyes6055 6 ปีที่แล้ว

      Christian Thompson can you look up my comment on part 5 plz... I have some bad errors and i typed all correct (variable names are diffrent and that is all)

  • @AmongUs-le7ce
    @AmongUs-le7ce 2 ปีที่แล้ว

    I don't understand this error
    raceback (most recent call last):
    File "/Users/Someone/Documents/Python Game L.py", line 32, in
    player.forward(speed)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/turtle.py", line 1638, in forward
    self._go(distance)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/turtle.py", line 1606, in _go
    self._goto(ende)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/turtle.py", line 3160, in _goto
    screen._pointlist(self.currentLineItem),
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/turtle.py", line 754, in _pointlist
    cl = self.cv.coords(item)
    File "", line 1, in coords
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 2795, in coords
    self.tk.call((self._w, 'coords') + args))]
    _tkinter.TclError: invalid command name ".!canvas"

    • @TokyoEdTech
      @TokyoEdTech  2 ปีที่แล้ว

      Does it happen when you close the window? If so, ignore it.