omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    don't see game when I hit run button

    Pythonista
    run program tutorial
    2
    2
    1288
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • z9612
      z9612 last edited by

      I'm following a tutorial from codeacademy: https://www.youtube.com/watch?v=XGf2GcyHPhc

      When I hit the play button to run in Pythonista nothing happens, in the tutorial the black screen for the "pong" game appears

      can anyone help?

      my code is:

      import turtle

      wn = turtle.Screen()
      wn.title("pong by zach")
      wn.bgcolor("black")
      wn.setup(width=800,height=600)
      wn.tracer(0)

      main game loop

      while True:
      wn.update()

      stephen 1 Reply Last reply Reply Quote 0
      • stephen
        stephen @z9612 last edited by

        @z9612

        im not familier with turtle but i assume with the code you provided this is expected.. after addingba coupe lines and removing the assuming unneeded call to update and getting the current screen instead of making a new one i got it o draw.

        
        import turtle
        
        wn = turtle.getscreen()
        wn.title("pong by zach")
        wn.bgcolor("black")
        wn.setup(width=800,height=600)
        wn.tracer(0)
        
        
        t=turtle.Turtle()
        t.color('#23ff00')
        
        live=1
        while live:
            t.forward(10)
            if t.position()[0] > 150:
                live=0
        
        
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Powered by NodeBB Forums | Contributors