Forum Archive

don't see game when I hit run button

z9612

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

@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