Script clean up
parent
cbe36a2e8d
commit
bffaf5876d
|
@ -1,18 +1,10 @@
|
||||||
[gd_scene load_steps=8 format=2]
|
[gd_scene load_steps=7 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/misc/SimpleGunShot.png" type="Texture" id=1]
|
[ext_resource path="res://assets/misc/SimpleGunShot.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://assets/misc/Hitbox.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://assets/misc/Hitbox.tscn" type="PackedScene" id=2]
|
||||||
[ext_resource path="res://src/misc/SimpleGunShot.gd" type="Script" id=3]
|
[ext_resource path="res://src/misc/SimpleGunShot.gd" type="Script" id=3]
|
||||||
[ext_resource path="res://assets/misc/Hurtbox.tscn" type="PackedScene" id=5]
|
[ext_resource path="res://assets/misc/Hurtbox.tscn" type="PackedScene" id=5]
|
||||||
|
|
||||||
[sub_resource type="GDScript" id=3]
|
|
||||||
script/source = "extends Area2D
|
|
||||||
|
|
||||||
func _on_Hitbox_area_entered(area):
|
|
||||||
print(\"hit\")
|
|
||||||
queue_free() # remove myself
|
|
||||||
"
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 1.00781, 1.99957 )
|
extents = Vector2( 1.00781, 1.99957 )
|
||||||
|
|
||||||
|
@ -29,7 +21,6 @@ texture = ExtResource( 1 )
|
||||||
[node name="GunShotHitbox" parent="." instance=ExtResource( 2 )]
|
[node name="GunShotHitbox" parent="." instance=ExtResource( 2 )]
|
||||||
visible = false
|
visible = false
|
||||||
collision_mask = 20
|
collision_mask = 20
|
||||||
script = SubResource( 3 )
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" parent="GunShotHitbox" index="0"]
|
[node name="CollisionShape2D" parent="GunShotHitbox" index="0"]
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
Loading…
Reference in New Issue