init
This commit is contained in:
12
props/plants/plant.gd
Normal file
12
props/plants/plant.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
class_name Plant extends Node
|
||||
|
||||
@onready var hitbox: Hitbox = $Hitbox
|
||||
|
||||
func _ready() -> void:
|
||||
hitbox.damaged.connect(take_damage)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
pass
|
||||
|
||||
func take_damage(_hurtbox: Hurtbox) -> void:
|
||||
queue_free()
|
||||
1
props/plants/plant.gd.uid
Normal file
1
props/plants/plant.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d2vgfhua60scb
|
||||
44
props/plants/plant.tscn
Normal file
44
props/plants/plant.tscn
Normal file
@@ -0,0 +1,44 @@
|
||||
[gd_scene format=3 uid="uid://b16l2ehf7hd1t"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d2vgfhua60scb" path="res://props/plants/plant.gd" id="1_nxykt"]
|
||||
[ext_resource type="Texture2D" uid="uid://3b5t47gfnrvn" path="res://props/sprites/Props.png" id="1_siw38"]
|
||||
[ext_resource type="PackedScene" uid="uid://cda6fr5vhb4ty" path="res://general/hitbox/hitbox.tscn" id="2_nxykt"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nxykt"]
|
||||
size = Vector2(29, 30)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5bg"]
|
||||
size = Vector2(24, 16)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5g5lq"]
|
||||
size = Vector2(24, 16)
|
||||
|
||||
[node name="Plant" type="Area2D" unique_id=492497178]
|
||||
script = ExtResource("1_nxykt")
|
||||
|
||||
[node name="sprite" type="Sprite2D" parent="." unique_id=373826636]
|
||||
texture = ExtResource("1_siw38")
|
||||
hframes = 16
|
||||
vframes = 3
|
||||
|
||||
[node name="Hitbox" parent="." unique_id=1876591880 instance=ExtResource("2_nxykt")]
|
||||
position = Vector2(0, 9)
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="Hitbox" unique_id=2005718804]
|
||||
position = Vector2(-0.5, -7)
|
||||
shape = SubResource("RectangleShape2D_nxykt")
|
||||
debug_color = Color(0.57204384, 0.5537644, 0.1232397, 0.41960785)
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="." unique_id=1955953887]
|
||||
position = Vector2(0, 9)
|
||||
shape = SubResource("RectangleShape2D_3p5bg")
|
||||
|
||||
[node name="body" type="StaticBody2D" parent="." unique_id=299359808]
|
||||
collision_layer = 16
|
||||
collision_mask = 0
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="body" unique_id=1831304255]
|
||||
position = Vector2(0, 9)
|
||||
shape = SubResource("RectangleShape2D_5g5lq")
|
||||
|
||||
[editable path="Hitbox"]
|
||||
Reference in New Issue
Block a user