cannon wip

This commit is contained in:
2025-02-07 04:48:14 +01:00
parent c74f1102b2
commit 21356f23e6
3 changed files with 48 additions and 1 deletions

11
objects/cannon.tscn Normal file
View File

@@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=3 uid="uid://dstko446qydsc"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_6gptm"]
[node name="Cannon" type="Node2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_6gptm")
hframes = 12
vframes = 12
frame = 42

32
objects/laser_beam.tscn Normal file
View File

@@ -0,0 +1,32 @@
[gd_scene load_steps=5 format=3 uid="uid://c7ku0k8n55hjv"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_brnkm"]
[ext_resource type="Script" path="res://scripts/components/damage.gd" id="2_l84sa"]
[ext_resource type="Script" path="res://scripts/components/beam_component.gd" id="3_6pj0h"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ptfn7"]
size = Vector2(8, 16)
[node name="Laser Beam" type="Area2D"]
collision_layer = 0
collision_mask = 5
[node name="Sprite2D" type="Sprite2D" parent="."]
texture_repeat = 2
texture = ExtResource("1_brnkm")
region_enabled = true
region_rect = Rect2(176, 64, 16, 16)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ptfn7")
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d")]
script = ExtResource("2_l84sa")
area2d = NodePath("..")
[node name="BeamComponent" type="Node2D" parent="." node_paths=PackedStringArray("root", "sprite2d", "collision_shape")]
position = Vector2(0, -8)
script = ExtResource("3_6pj0h")
root = NodePath("..")
sprite2d = NodePath("../Sprite2D")
collision_shape = NodePath("../CollisionShape2D")