Skip to content
Snippets Groups Projects
Commit 54fa5305 authored by seba's avatar seba
Browse files

use config with 1 step size

parent b36a70f3
No related branches found
No related tags found
No related merge requests found
__pycache__
File deleted
......@@ -20,7 +20,7 @@ with open("piece_variables.json", encoding="utf-8") as infile:
PIECE_VARIABLES = json.load(infile)
CONFIG = {"width": 4.0, "height": 4.0, "move_step": 0.5, "prevent_overlap": False}
CONFIG = {"width": 4.0, "height": 4.0, "move_step": 1, "prevent_overlap": False}
OBJS = {
"bridge": {
"id_n": 0,
......@@ -67,6 +67,18 @@ COLORS = {
}
def name_generator():
"""
make sure objects are placed with increasing id
"""
n = 0
while True:
yield n
n += 1
NAME_GEN = name_generator()
@socketio.on('click')
def sample_preview_board(config):
golmi_server = f'http://{current_app.config["golmi_host"]}:{current_app.config["golmi_port"]}'
......@@ -90,7 +102,7 @@ def sample_preview_board(config):
obj["x"] = x #- len(obj["block_matrix"][0]) // 2
obj["y"] = y #- len(obj["block_matrix"]) // 2
id_n = str(len(state["objs"]))
id_n = str(next(NAME_GEN))
obj["id_n"] = id_n
state["objs"][id_n] = obj
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment