scroll/zoom
This commit is contained in:
11
maps/map_tools.gd
Normal file
11
maps/map_tools.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Node2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
32
maps/sections.gd
Normal file
32
maps/sections.gd
Normal file
@@ -0,0 +1,32 @@
|
||||
extends Node2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
poolcircle(Vector2(0,0),200,32,100,0,0)
|
||||
poolcircle(Vector2(600,0),200,32,0,100,0)
|
||||
poolcircle(Vector2(1200,0),200,32,0,0,100)
|
||||
|
||||
poolcircle(Vector2(0,600),200,32,0,50,50)
|
||||
poolcircle(Vector2(600,600),200,32,50,0,50)
|
||||
poolcircle(Vector2(1200,600),200,32,50,50,0)
|
||||
|
||||
poolcircle(Vector2(600,200),2000,100,1000,1000,1000)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
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
|
||||
print(t)
|
||||
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;
|
||||
get_tree().root.get_node("Sim").call_deferred("add_child",new_pool)
|
6
maps/sections.tscn
Normal file
6
maps/sections.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bkapistmqmur8"]
|
||||
|
||||
[ext_resource type="Script" path="res://maps/sections.gd" id="1_ihwvy"]
|
||||
|
||||
[node name="Map" type="Node2D"]
|
||||
script = ExtResource("1_ihwvy")
|
Reference in New Issue
Block a user