Exemple #1
0
import opengl.cubes as cubes
import opengl.chunker as chunker
import game_global as gg
import huffman
import scene_draw
import opengl.image_manip as image_manip
from huffman_generator import generate_huffman_decoder, generate_huffman_encoder
import client_core
import net

assert gg.M == cubes.m
assert gg.N == cubes.n

save_imgs = True # to save images generated for training as bmp

cubes.cubes_init()

# 'display_args.pkl' is generated by running client.py
# with opengl rendering and environment variable
# LOG_RENDER_ARGS=1
try:
    with open('display_args.pkl', 'rb') as f:
        v = pickle.load(f)
except IOError:
    print("cannot read 'display_args.pkl'.")
    print("maybe try to regenerate it, by running one client like")
    print("$ LOG_RENDER_ARGS=display_args.pkl python3 client.py localhost player")
    raise

## Add more variety in states
gs = client_core.ClientGameState()
 def __init__(self, hw_interface):
     self.hw_interface = hw_interface
     cubes.cubes_init()