-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRoom.gd
More file actions
50 lines (40 loc) · 1.36 KB
/
Room.gd
File metadata and controls
50 lines (40 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
tool
extends TileMap
export var occupies := [Vector2(0, 0)]
export var left := 0
export var right := 0
export var top := 0
export var bottom := 0
var decos := []
var source := []
#func _ready():
# if not Engine.editor_hint:
# for i in get_children():
# if i.is_in_group("Vases"):
# var no = i.get_node_or_null("End")
# if no != null:
# var pos = i.position
# while pos.x < no.position.x + i.position.x:
# if Items.WorldRNG.randf() < 0.15:
# var n := preload("res://Elements/Vase.tscn").instance()
# n.position = pos - Vector2(0, 3)
# add_child(n)
# pos.x += 17 + Items.WorldRNG.randf()*8
func _process(_delta):
if Engine.editor_hint:
update()
else:
set_process(false)
func _draw():
if Engine.editor_hint:
for i in get_tree().get_nodes_in_group("Vases"):
var n = i.get_node_or_null("End")
if n != null:
draw_rect(Rect2(i.position, Vector2(i.get_node("End").position.x, -8)), ColorN("blue",0.2))
draw_rect(Rect2(0,0,66*8,33*8), ColorN("white"), false)
draw_rect(Rect2(0,0,3*8,(29-5)*8), ColorN("white"), false)
draw_rect(Rect2((66-3)*8,0,3*8,(29-5)*8), ColorN("white"), false)
draw_rect(Rect2(0,0,22*8,3*8), ColorN("white"), false)
draw_rect(Rect2(44*8,0,22*8,3*8), ColorN("white"), false)
draw_rect(Rect2(0,30*8,22*8,3*8), ColorN("white"), false)
draw_rect(Rect2(44*8,30*8,22*8,3*8), ColorN("white"), false)