From 47cb2021818be14bdfc023a1b9c71a2333869b04 Mon Sep 17 00:00:00 2001 From: kleph Date: Thu, 12 May 2016 23:42:38 +0200 Subject: [PATCH] Add seed number (not well tested) --- 02_dynamic_bsp_rooms.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/02_dynamic_bsp_rooms.py b/02_dynamic_bsp_rooms.py index 40faa14..146a9ab 100644 --- a/02_dynamic_bsp_rooms.py +++ b/02_dynamic_bsp_rooms.py @@ -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 = []