diff options
author | bd <bdunahu@operationnull.com> | 2025-05-20 21:28:58 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-05-20 21:28:58 -0400 |
commit | ec10e5fe6222773fd59d7854ed172f5319dc9a4e (patch) | |
tree | 8c9f43fed503ef2f89e7313cd1869a398023ed5f | |
parent | eb5ea9d42ff3363c62f11dff1c33cff84f435f7e (diff) |
Add wyvern tower, (no projectiles)
-rw-r--r-- | project.godot | 5 | ||||
-rw-r--r-- | scenes/UI/cursor.gd | 1 | ||||
-rw-r--r-- | scenes/defenders/warlock.gd | 2 | ||||
-rw-r--r-- | scenes/defenders/warlock.tscn | 2 | ||||
-rw-r--r-- | scenes/defenders/wyvern.tscn | 37 | ||||
-rw-r--r-- | scenes/defenders/wyvern_animation_handler.gd | 6 | ||||
-rw-r--r-- | scenes/defenders/wyvern_animation_handler.gd.uid | 1 |
7 files changed, 52 insertions, 2 deletions
diff --git a/project.godot b/project.godot index 6366b7d..f9ff84c 100644 --- a/project.godot +++ b/project.godot @@ -53,6 +53,11 @@ place_warlock={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) ] } +place_wyvern={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) +] +} [rendering] diff --git a/scenes/UI/cursor.gd b/scenes/UI/cursor.gd index 7f9a7ae..cb0d0b4 100644 --- a/scenes/UI/cursor.gd +++ b/scenes/UI/cursor.gd @@ -19,6 +19,7 @@ func _ready(): max_y = 15 * tile_size towers["place_warlock"] = preload("res://scenes/defenders/warlock.tscn") + towers["place_wyvern"] = preload("res://scenes/defenders/wyvern.tscn") position = position.snapped(Vector2.ONE * tile_size) position += Vector2.ONE * tile_size / 2 diff --git a/scenes/defenders/warlock.gd b/scenes/defenders/warlock.gd index 0178382..724a081 100644 --- a/scenes/defenders/warlock.gd +++ b/scenes/defenders/warlock.gd @@ -3,7 +3,7 @@ extends "res://scenes/defenders/base_defender.gd" var projectile: PackedScene = preload("res://scenes/defenders/warlock_projectile.tscn") func _ready(): - damage = 200 + damage = 5 func _on_fire_timer_timeout(): if (curr != null): diff --git a/scenes/defenders/warlock.tscn b/scenes/defenders/warlock.tscn index 444db16..6c97d4a 100644 --- a/scenes/defenders/warlock.tscn +++ b/scenes/defenders/warlock.tscn @@ -7,7 +7,7 @@ size = Vector2(16, 16) [sub_resource type="CircleShape2D" id="CircleShape2D_rpypk"] -radius = 48.0 +radius = 64.0 [node name="Warlock" type="StaticBody2D"] script = ExtResource("1_rpypk") diff --git a/scenes/defenders/wyvern.tscn b/scenes/defenders/wyvern.tscn new file mode 100644 index 0000000..19a5302 --- /dev/null +++ b/scenes/defenders/wyvern.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=5 format=3 uid="uid://d37i2dwyynqdw"] + +[ext_resource type="Script" uid="uid://dvhqpgw6vhayu" path="res://scenes/defenders/warlock.gd" id="1_6c73s"] +[ext_resource type="Script" uid="uid://dl7a53e1auku7" path="res://scenes/defenders/wyvern_animation_handler.gd" id="2_6c73s"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_wu3n4"] +size = Vector2(16, 16) + +[sub_resource type="CircleShape2D" id="CircleShape2D_rpypk"] +radius = 48.0 + +[node name="Wyvern" type="StaticBody2D"] +script = ExtResource("1_6c73s") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_wu3n4") +disabled = true + +[node name="Aim" type="Marker2D" parent="."] +position = Vector2(6, -2) + +[node name="Tower" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Tower"] +shape = SubResource("CircleShape2D_rpypk") + +[node name="ProjectileContainer" type="Node" parent="."] + +[node name="FireTimer" type="Timer" parent="."] + +[node name="Sprite2D" type="Sprite2D" parent="."] +region_rect = Rect2(496, 16, 16, 16) +script = ExtResource("2_6c73s") + +[connection signal="body_entered" from="Tower" to="." method="_on_tower_body_entered"] +[connection signal="body_exited" from="Tower" to="." method="_on_tower_body_exited"] +[connection signal="timeout" from="FireTimer" to="." method="_on_fire_timer_timeout"] diff --git a/scenes/defenders/wyvern_animation_handler.gd b/scenes/defenders/wyvern_animation_handler.gd new file mode 100644 index 0000000..7e17256 --- /dev/null +++ b/scenes/defenders/wyvern_animation_handler.gd @@ -0,0 +1,6 @@ +extends "res://scenes/defenders/base_animation_handler.gd" + +func _ready(): + idle = Rect2(384, 160, 16, 16) + attack = Rect2(400, 160, 16, 16) + update_texture() diff --git a/scenes/defenders/wyvern_animation_handler.gd.uid b/scenes/defenders/wyvern_animation_handler.gd.uid new file mode 100644 index 0000000..5c8f57b --- /dev/null +++ b/scenes/defenders/wyvern_animation_handler.gd.uid @@ -0,0 +1 @@ +uid://dl7a53e1auku7 |