title: Python 3 code not working as I expected it to
body: <p>I was working on a simple python turtle module game when I encountered a problem. The game's point was for you(a red square) to dodge an obstacle(blue circle). Every time the blue circle reached the bottom of the screen it was supposed to reset to the top. When this comes to happen, the circle resets for a second then teleports back down again. Here is my code </p>
  
  <pre><code>#Import modules
  import turtle
  import time
  import random
  
  #Create window
  screen = turtle.Screen()
  screen.title("Street Raiders")
  screen.bgcolor("black")
  screen.screensize(400, 400)
  
  #Draw border
  borderPen = turtle.Turtle()
  borderPen.color("white")
  borderPen.pensize(3)
  borderPen.speed(0)
  borderPen.penup()
  borderPen.hideturtle()
  borderPen.setposition(-100, -100)
  borderPen.pendown()
  
  for sides in range(4):
      borderPen.fd(200)
      borderPen.lt(90)
  
  #Create player
  playerCar = turtle.Turtle()
  playerCar.speed(0)
  playerCar.color("red")
  playerCar.shape("square")
  playerCar.setheading(90)
  playerCar.penup()
  playerCar.setposition(0, -75)
  playerX = playerCar.xcor()
  
  #Define player movement functions
  def move_left():
      global playerX
      if playerX &lt; -85 or playerX == -85:
          playerX = -75
          playerCar.setx(playerX)
      else:
          playerX -= 10
          playerCar.setx(playerX)
  
  def move_right():
      global playerX
      if playerX &gt; 85 or playerX == 85:
          playerX = 75
          playerCar.setx(playerX)
      else:
          playerX += 10
          playerCar.setx(playerX)
  #Allow player movement
  turtle.listen()
  turtle.onkey(move_left, "Left")
  turtle.onkey(move_right, "Right")
  
  #Create obstacles
  obstacleY = 75
  obstacle = turtle.Turtle()
  obstacle.speed(0)
  obstacle.shape("circle")
  obstacle.color("blue")
  obstacle.penup()
  obstacle.setposition(random.randint(-80, 81), obstacleY)
  
  #Move obstacles
  alive = True
  while True:
      if alive:
          obstacle.sety(75)
          obstacle.setx(random.randint(-80, 81))
          for moves in range(30):
              time.sleep(0.1)
              obstacleY -= 5
              obstacle.sety(obstacleY)
  else:
      print("GAME OVER... TRY AGAIN")
  </code></pre>
  
  <p>`</p>
  
  <p>If you know why it is not working please respond. Thanks!</p>