17 lines
500 B
GDScript
17 lines
500 B
GDScript
var root
|
|
|
|
func create_map(_root):
|
|
root=_root
|
|
poolcircle(Vector2(0,0),200,16,100,100,100)
|
|
|
|
func poolcircle(pos: Vector2, radius, count, r,g,b):
|
|
for n in range(1,count+1):
|
|
var new_pool: Pool = load("res://pool.tscn").instantiate()
|
|
var t=(float(n)/count)*3.141*2
|
|
new_pool.position = pos + (Vector2(sin(t),cos(t))*radius)
|
|
new_pool.mana_r=r
|
|
new_pool.mana_g=g
|
|
new_pool.mana_b=b
|
|
new_pool.get_node("StaticBody2D/CollisionShape2D2").disabled=true;
|
|
root.call_deferred("add_child",new_pool)
|