Added in editor warnings when weapons are missing components (Audioplayer, Shot spawn location, projectile PackedScene)

Added functionality for weapons to fire projectiles.
This commit is contained in:
KingGurke 2025-04-03 12:26:41 +02:00
parent 9621323983
commit 40ffbb84cd
8 changed files with 135 additions and 17 deletions

19
scenes/shot.tscn Normal file
View file

@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://b2ly0rd4mua6i"]
[ext_resource type="Script" uid="uid://8y2wqva60nom" path="res://scripts/projectile.gd" id="1_cupcd"]
[ext_resource type="Texture2D" uid="uid://dau0wpg7gfg3y" path="res://sprites/pew.png" id="2_r6d4o"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ctx4p"]
size = Vector2(12, 1)
[node name="Projectile" type="Area2D"]
input_pickable = false
script = ExtResource("1_cupcd")
metadata/_custom_type_script = "uid://8y2wqva60nom"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(3, 0)
shape = SubResource("RectangleShape2D_ctx4p")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_r6d4o")