one more question about my assignment.
I have it working but would like to change the labels to be printed along
the side with a line pointing to each object as it moves.
This is in python3
so I have the following functions:
Code:
def draw_label(x,y,name,i):
#print commands to draw labels in quickdraw window
#print name along the left side of the quickdraw window
# and i*50 pixels from the top of the quickdraw window
print('text' name, 700,i*50)
#print line from the name to the centre of the object
print('line' , 700,i*50, x,y)
(the next is very similar to the on in my previous post but I will shorten it
to some pseudo code here)
Code:
def draw_system(x,y,solar,t,i=0): #if i has no value set it to 0
#do a bunch of calculations to x and y
x = x*trig functions
y = y* trig functions
i = i +1
#print the object to quick draw
print('fillcircle', x,y, radius)
#call the draw label function
draw_label(x,y,object name,i)
#some loops to draw orbits
for loop
do stuff
for loop #loop to get next object to be printed
print(stuff)
solar[rootobject]=[next root object]
#recursive function call
draw_system(x,y,solar,t,i) #should be i+=1
When I use my small sample (Sun, earth, moon)it prints the solar
system okay and the labels seem to be okay
when I use my large sample it prints the solar system okay the sun label is
okay but further down there is a bunch of labels printed on top of each
other and further down another mess of labels.
Example:
Sun
jumbled mess1
jumbled mess2
I can't make anything out in each jumbled mess but my guess is
the first is planet names and second is moon names.
What am I missing to get each name printed 50pixels from each other?