So here is the code I have, is there a way to code so that when the ISS and rocket meet (at the same position) destory the window and create a new Tkinter window?
from turtle import *
def move(thing, distance):
thing.circle(250, distance)
def main():
rocket = Turtle()
ISS = Turtle()
rocket.speed(10)
ISS.speed(10)
counter = 1
title("ISS")
screensize(750, 750)
ISS.hideturtle()
rocket.hideturtle()
ISS.penup()
ISS.left(90)
ISS.fd(250)
ISS.left(90)
ISS.showturtle()
ISS.pendown()
rocket.penup()
rocket.fd(250)
rocket.left(90)
rocket.showturtle()
rocket.pendown()
while counter == 1:
move(ISS, 3)
move(rocket, 4)
Thank You!!
http://docs.python.org/2/library/turtle.html#turtle.position
“Return the turtle’s current location (x,y) (as a Vec2D vector).”
However, due to floating point errors, you should consider them overlapping even if they are very slightly apart, e.g.
If you want to pretend they are circles and ISS has a radius of r1 and the rocket has a radius of r2, then you can measure distance like:
If this is true, they are overlapping circles.