Files
kicking-high/proto3/godot/city/spaces_building_gen_2d.gd
2020-04-19 04:20:13 +03:00

36 lines
727 B
GDScript3

extends Node2D
var graph = {
"entry": ["corridoor", "stairs"],
"corridoor": ["corridoor", "flat-door"]
}
var grid = []
var spaces = []
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
var space_color = []
var xdim = 10
var ydim = 10
func _ready():
$Camera2D.current = true
grid.resize(10 * 10)
for e in graph.keys():
for k in [e] + graph[e]:
if !k in spaces:
spaces.push_back(k)
space_color.push_back(Color(randf(), randf(), randf(), 1))
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _draw():
draw_rect(Rect2(-10, -10, 20, 20), Color(1, 0, 0, 1))