Add seed number (not well tested)

This commit is contained in:
kleph 2016-05-12 23:42:38 +02:00
parent 767789458c
commit 47cb202181

View file

@ -177,10 +177,13 @@ def draw_tree(t):
# init random
# TODO add seed mode (how ?)
random.seed()
seed = random.randint(0, sys.maxsize)
print("Using seed: " + str(seed))
random.seed(seed)
label = pyglet.text.Label('Plop World', x=window.width*5/6, y=window.height*5/6, anchor_x='center', anchor_y='center')
label_txt = 'Plop World seed: ' + str(seed)
label = pyglet.text.Label(label_txt, x=window.width*5/6, y=window.height*5/6, anchor_x='center', anchor_y='center',
multiline=True, width=window.width - window.width*5/6)
# load images
tiles = []