From a76fa2b2467bb5da42009c5f23c9597874c208e3 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 3 Apr 2022 08:20:03 +0200 Subject: [PATCH] :wrench: Make the player `Damageable` --- src/entities/Player.tscn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/entities/Player.tscn b/src/entities/Player.tscn index c9d0654..dd660bd 100644 --- a/src/entities/Player.tscn +++ b/src/entities/Player.tscn @@ -1,13 +1,15 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://src/mechanics/White.png" type="Texture" id=1] [ext_resource path="res://src/entities/behaviours/PlayerMovement.tscn" type="PackedScene" id=2] [ext_resource path="res://src/entities/behaviours/BulletSpawn.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/entities/behaviours/Damageable.tscn" type="PackedScene" id=4] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 16, 16 ) [node name="Player" type="KinematicBody2D"] +collision/safe_margin = 0.02 [node name="Shape" type="CollisionShape2D" parent="."] shape = SubResource( 1 ) @@ -18,3 +20,7 @@ texture = ExtResource( 1 ) [node name="PlayerMovement" parent="." instance=ExtResource( 2 )] [node name="BulletSpawn" parent="." instance=ExtResource( 3 )] + +[node name="Damageable" parent="." instance=ExtResource( 4 )] +health = 5 +max_health = 5