title: ParseError and incorrect coordinates
body: <p>I'm having trouble with the game I'm creating in Turtle. Whenever I try and run the program I get a traceback error: <code>ParseError: bad input on line 69 in main.py</code>. But earlier (when the error didn't occur) my coordinates didn't work properly. I think I typed in the right ones, but it doesn't work. In the game you need to hit the fruit. So mainly the game goes like this: if you miss the fruit it should take one point from your score and one heart from your lives. At first it checks if you don't have a score of 0. If you hit the fruit you should get +1 point. But sadly, if I shoot anywhere in the left side of the window I get a +1 score. No matter the distance.</p>
  
  <p>The code in which I suspect the problem is:</p>
  
  <pre><code>def cannon_shooting():
    bullet1 = random.randint(1, 4)
    global live_score
    if live_score &gt;= 100:
      bullet1 = 5
    if bullet1 == 1:
      bullet.color('black')
    if bullet1 == 2:
      bullet.color('green')
    if bullet1 == 3:
      bullet.color('red')
    if bullet1 == 4:
      bullet.color('grey')
    if bullet1 == 5:
      bullet.color('white')
    bullet.goto(cannon_x, -30)
    bullet.showturtle()
    bullet.goto(cannon_x, 130)
    if bullet.ycor() == enemy.ycor() - 10:
      if not bullet.xcor() == enemy.xcor() - 10:
        if live_score == 0:
          if live_score == 100:
            score.color('white')
          live_score = 0
          score.clear()
          if live_score &gt;= 0:
            score.write("Your score: %s" % live_score, font=(None, 11, "bold"))
        else:
          if live_score == 100:
            score.color('white')
          live_score = live_score - 1
          score.clear()
          if live_score &gt;= 0:
            score.write("Your score: %s" % live_score, font=(None, 11, "bold"))
        move_speed = random.randint(1, 10)
        lives = lives - 1
      if bullet.xcor() = enemy.xcor() - 10:
        if live_score == 100:
          score.color('white')
        live_score = live_score + 1
        score.clear()
        if live_score &gt;= 0:
          score.write("Your score: %s" % live_score, font=(None, 11, "bold"))
        enemy1 = random.randint(1, 3)
        move_speed = random.randint(1, 10)
    if live_score == 100:
      score.clear()
      cannon.goto(0, -100)
      cannon.hideturtle()
      enemy.hideturtle()
      bullet.hideturtle()
      bullet.goto(0, -30)
      win.color('green')
      win.write("Congratulations!", font=(None, 20, "bold"))
      win.goto(-140, -40)
      win.write("You scored 100 points!", font=(None, 20, "bold"))
    if lives == 0:
      score.clear()
      cannon.goto(0, -100)
      cannon.hideturtle()
      enemy.hideturtle()
      bullet.hideturtle()
      bullet.goto(0, -30)
      game_over.color('red')
      game_over.write("Game Over", font=(None, 20, "bold"))
      game_over.goto(-140, -40)
      game_over.write("You scored %d points!" % live_score, font=(None, 20, "bold"))
    bullet.hideturtle()
  </code></pre>
  
  <p>Whole code:</p>
  
  <pre><code>import random
  import turtle
  
  #images
  image_coconut = "Coconut.png"
  image_banana = "Banana.png"
  image_pineapple = "Pineapple.png"
  image_cannon = "Cannon.png"
  
  #definitions
  live_score = 0
  screen = turtle.Screen()
  wn = turtle.Screen()
  cannon = turtle.Turtle()
  enemy = turtle.Turtle()
  score = turtle.Turtle()
  score1 = turtle.Turtle()
  background = turtle.Turtle()
  reset = turtle.Turtle()
  bullet = turtle.Turtle()
  overlay = turtle.Turtle()
  enemy_x = enemy.xcor()
  enemy_y = enemy.ycor()
  win = turtle.Turtle()
  game_over = turtle.Turtle()
  lives = 3
  cannon_x = 0
  cannon_x
  move_speed = 2
  enemy1 = 0
  score_goto = 0
  
  def cannon_shooting():
    bullet1 = random.randint(1, 4)
    global live_score
    if live_score &gt;= 100:
      bullet1 = 5
    if bullet1 == 1:
      bullet.color('black')
    if bullet1 == 2:
      bullet.color('green')
    if bullet1 == 3:
      bullet.color('red')
    if bullet1 == 4:
      bullet.color('grey')
    if bullet1 == 5:
      bullet.color('white')
    bullet.goto(cannon_x, -30)
    bullet.showturtle()
    bullet.goto(cannon_x, 130)
    if bullet.ycor() == enemy.ycor() - 10:
      if not bullet.xcor() == enemy.xcor() - 10:
        if live_score == 0:
          if live_score == 100:
            score.color('white')
          live_score = 0
          score.clear()
          if live_score &gt;= 0:
            score.write("Your score: %s" % live_score, font=(None, 11, "bold"))
        else:
          if live_score == 100:
            score.color('white')
          live_score = live_score - 1
          score.clear()
          if live_score &gt;= 0:
            score.write("Your score: %s" % live_score, font=(None, 11, "bold"))
        move_speed = random.randint(1, 10)
        lives = lives - 1
      if bullet.xcor() = enemy.xcor() - 10:
        if live_score == 100:
          score.color('white')
        live_score = live_score + 1
        score.clear()
        if live_score &gt;= 0:
          score.write("Your score: %s" % live_score, font=(None, 11, "bold"))
        enemy1 = random.randint(1, 3)
        move_speed = random.randint(1, 10)
    if live_score == 100:
      score.clear()
      cannon.goto(0, -100)
      cannon.hideturtle()
      enemy.hideturtle()
      bullet.hideturtle()
      bullet.goto(0, -30)
      win.color('green')
      win.write("Congratulations!", font=(None, 20, "bold"))
      win.goto(-140, -40)
      win.write("You scored 100 points!", font=(None, 20, "bold"))
    if lives == 0:
      score.clear()
      cannon.goto(0, -100)
      cannon.hideturtle()
      enemy.hideturtle()
      bullet.hideturtle()
      bullet.goto(0, -30)
      game_over.color('red')
      game_over.write("Game Over", font=(None, 20, "bold"))
      game_over.goto(-140, -40)
      game_over.write("You scored %d points!" % live_score, font=(None, 20, "bold"))
    bullet.hideturtle()
  
  
  #image adding
  screen.addshape(image_coconut)
  screen.addshape(image_banana)
  screen.addshape(image_pineapple)
  screen.addshape(image_cannon)
  
  def cannon_left():
    global cannon_x
    if cannon_x == -140:
      cannon_x = 140
      cannon.goto(cannon_x, -100)
    cannon_x = cannon_x - 10
    cannon.goto(cannon_x, -100)
    bullet.goto(cannon_x, -30)
  
  def cannon_right():
    global cannon_x
    if cannon_x == 140:
      cannon_x = -140
      cannon.goto(cannon_x, -100)
    cannon_x = cannon_x + 10
    cannon.goto(cannon_x, -100)
    bullet.goto(cannon_x, -30)
  
  #setup
  screen.bgcolor('white')
  
  game_over.hideturtle()
  game_over.speed(0)
  game_over.penup()
  game_over.goto(-100, 0)
  
  win.hideturtle()
  win.speed(0)
  win.penup()
  win.goto(-100, 0)
  
  bullet.hideturtle()
  bullet.speed(5)
  bullet.penup()
  bullet.shape('circle')
  bullet.goto(0, -140)
  bullet.left(90)
  
  enemy.speed(0)
  enemy.penup()
  enemy.hideturtle()
  enemy.goto(0, 140)
  screen.addshape(image_coconut)
  enemy.shape(image_coconut)
  enemy.showturtle()
  
  cannon.speed(0)
  cannon.penup()
  cannon.hideturtle()
  cannon.goto(0, -100)
  screen.addshape(image_cannon)
  cannon.shape(image_cannon)
  cannon.showturtle()
  cannon.left(90)
  
  score.speed(0)
  score.penup()
  score.hideturtle()
  score.goto(-45, -190)
  score.color('black')
  score.write("Your score: %s" % live_score, font=(None, 11, "bold"))
  
  #bindings
  wn.onkey(cannon_right, "D")
  wn.onkey(cannon_left, "A")
  wn.onkey(cannon_right, "Right")
  wn.onkey(cannon_left, "Left")
  wn.onkey(cannon_shooting, "SPACE")
  
  #movement
  enemy.forward(move_speed)
  if enemy.xcor() == 140:
    enemy.left(180)
    enemy.forward(move_speed)
  if enemy.xcor() == -140:
    enemy.right(180)
    enemy.forward(move_speed)
    if enemy1 == 1:
      screen.addshape(image_banana)
      enemy.shape(image_banana)
    if enemy1 == 2:
      screen.addshape(image_pineapple)
      enemy.shape(image_pineapple)
    if enemy1 == 3:
      enemy.shape(image_coconut)
  
  #others
  wn.listen()
  wn.mainloop()
  </code></pre>
  
  <p>Note: I'm creating the game in <code>Trinket.io</code>. To see the program in <code>Trinket</code>, click <a href="https://trinket.io/python/ed2c612824" rel="nofollow" title="Shooter game in Trinket.io">here</a>.</p>