G'day,
I've worked on your code Vegaseat and have come up with the following rough sketch of how my game will look in the end:
# using geometry manager Tkinter.Place for layouts
# tested with Python24 vegaseat 28apr2007
import Tkinter as tk
import random as rn
#help('Tkinter.Place')
root = tk.Tk()
# window geometry is width x height + x_offset + y_offset (no spaces!)
root.geometry("400x300+30+30")
# create 5 labels with a loop
texts = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']
labels = range(10)
for k in range(10):
# create hex random color string acceptable to Tkinter eg. #ff0507
rcolor = '#' + "".join(["%02x"%rn.randrange(256) for x in range(3)])
# anchor='nw' is default, can set width and height in pixels
labels[k] = tk.Label(root, text=texts[k], bg=rcolor)
labels[k].place(x=0, y=(k)*25, width=100, height=20)
# more labels ...
labela=tk.Label(root, text='unsolved')
labelb=tk.Label(root, text='SOLVED!!!')
label25=tk.Label(root, text="Enter your number here:")
label30=tk.Label(root, text="Countdown: 23 turns left")
label1 = tk.Label(root, text='[No.1]', fg='red')
label2 = tk.Label(root, text='[No.2 = 174]', fg='red', bg='white')
label3 = tk.Label(root, text='[No.3 = 391]', fg='red', bg='white')
label4 = tk.Label(root, text='[No.4]', fg='red')
label5 = tk.Label(root, text='[No.5]', fg='red')
label6 = tk.Label(root, text='[No.6]', fg='red')
label7 = tk.Label(root, text='[No.7]', fg='red')
label8 = tk.Label(root, text='[No.8 = 802]', fg='red', bg='white')
label9 = tk.Label(root, text='[No.9]', fg='red')
label10 = tk.Label(root, text='[No.10]', fg='red')
# middle labels...
label11 = tk.Label(root, text='**CLUE No.1**', fg='red', bg='yellow')
label12 = tk.Label(root, text='**CLUE No.2**', fg='red', bg='yellow')
label13 = tk.Label(root, text='**CLUE No.3**', fg='red', bg='yellow')
label14 = tk.Label(root, text='**CLUE No.4**', fg='red', bg='yellow')
label15 = tk.Label(root, text='**CLUE No.5**', fg='red', bg='yellow')
# position these two lables at points x, y
# (x=0, y=0 is upper left corner of root area)
# x= means the lower the No. the more to the left it goes
# placement of Entry etc
labela.place(x=605, y= 0)
labelb.place(x=430, y= 0)
label25.place(x=0, y= 250)
label30.place(x=0, y= 500)
label1.place(x=610, y= 20, width=40, height=15) #height is the fatness of yellow colour
label2.place(x=420, y= 40, width=80, height=15)#y=means the higher the No. the lower the...
label3.place(x=420, y= 60, width=80, height=15) #...label is.
label4.place(x=610, y= 80, width=40, height=15)
label5.place(x=610, y= 100, width=40, height=15)
label6.place(x=610, y= 120, width=40, height=15)
label7.place(x=610, y= 140, width=40, height=15)
label8.place(x=420, y= 160, width=80, height=15)
label9.place(x=610, y= 180, width=40, height=15)
label10.place(x=610, y= 200, width=40, height=15)
# placement of middle labels
label11.place(x=450, y= 320, width=100, height=10)
label12.place(x=450, y= 340, width=100, height=10)
label13.place(x=450, y= 360, width=100, height=10)
label14.place(x=450, y= 380, width=100, height=10)
label15.place(x=450, y= 400, width=100, height=10)
print "________________________________________________________________________________________"
root.mainloop()
I can forsee a problem that'll develop, i.e. as each frame passes the "clues" will change, sometimes there'll be zero clues and at other times there'll be up to 7 or 8 (the clues are completely randomised and may come up at the same number in counting down) which will mean the frame will be stretched and will throw out all the pixels numbers. As this'll be a scrolling type game how does one adjust the pixels to the frame? Or is this an "update" frame thing as I've seen in other code? Another slight problem is the print "_____" at the bottom of the code did not work at all:@ , but this is needed as a dividing line between frames, i.e. one puts in an "educated guess" as to what the number might be then enters that number and a new and different frame comes up stretched or squeezed by the amount of randomised clues. Is there a way to overcome these problems:?:.
Thanking you for your help...:)
fredzik.