summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/PathRenderer.gd13
-rw-r--r--components/button.tscn1
-rw-r--r--scenes/levels/base_level.tscn26
3 files changed, 40 insertions, 0 deletions
diff --git a/components/PathRenderer.gd b/components/PathRenderer.gd
new file mode 100644
index 0000000..75c7163
--- /dev/null
+++ b/components/PathRenderer.gd
@@ -0,0 +1,13 @@
+extends Node2D
+
+onready var path : Path2D = $Path2D
+onready var points = path.curve.get_baked_points()
+
+func _draw():
+ var last_point = 0
+ for point in points:
+ if last_point is int:
+ last_point = point
+ continue
+ draw_line(last_point, point, Color.brown, 6, false)
+ last_point = point
diff --git a/components/button.tscn b/components/button.tscn
index 6248b45..f7d0cea 100644
--- a/components/button.tscn
+++ b/components/button.tscn
@@ -48,6 +48,7 @@ __meta__ = {
[node name="Hitbox" type="CollisionShape2D" parent="."]
shape = SubResource( 3 )
+
[connection signal="input_event" from="." to="." method="_on_ButtonTest_input_event"]
[connection signal="mouse_entered" from="." to="." method="_on_ButtonTest_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_ButtonTest_mouse_exited"]
diff --git a/scenes/levels/base_level.tscn b/scenes/levels/base_level.tscn
new file mode 100644
index 0000000..ab8e820
--- /dev/null
+++ b/scenes/levels/base_level.tscn
@@ -0,0 +1,26 @@
+[gd_scene load_steps=4 format=2]
+
+[ext_resource path="res://textures/backgrounds/background_blue.png" type="Texture" id=1]
+[ext_resource path="res://components/PathRenderer.gd" type="Script" id=2]
+
+[sub_resource type="Curve2D" id=1]
+_data = {
+"points": PoolVector2Array( 0, 0, 0, 0, -214.33, -262.484, 0, 0, 0, 0, 449.67, -270.484, 0, 0, 0, 0, 425.67, -534.484, 0, 0, 0, 0, -134.33, -790.484, 0, 0, 0, 0, -358.33, -630.484, 0, 0, 0, 0, -214.33, -262.484, 0, 0, 0, 0, 585.67, -902.484 )
+}
+
+[node name="BaseLevel" type="Node2D"]
+position = Vector2( 486.33, -65.5159 )
+
+[node name="Camera2D" type="Camera2D" parent="."]
+position = Vector2( -46.33, -438.484 )
+current = true
+
+[node name="background_blue" type="Sprite" parent="Camera2D"]
+scale = Vector2( 0.667, 0.667 )
+texture = ExtResource( 1 )
+
+[node name="PathRenderer" type="Node2D" parent="."]
+script = ExtResource( 2 )
+
+[node name="Path2D" type="Path2D" parent="PathRenderer"]
+curve = SubResource( 1 )