Moved godot files into a directory to keep things clean
This commit is contained in:
11
project/small_tree/small_tree.gd
Normal file
11
project/small_tree/small_tree.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Area2D
|
||||
|
||||
var _durability: int = 3
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is Character:
|
||||
_durability -= 1
|
||||
body.repel_collision(self)
|
||||
if _durability <= 0:
|
||||
Inventory.add_item(Inventory.Wood.new())
|
||||
queue_free()
|
||||
1
project/small_tree/small_tree.gd.uid
Normal file
1
project/small_tree/small_tree.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://clxosihgty8t5
|
||||
BIN
project/small_tree/small_tree.png
Normal file
BIN
project/small_tree/small_tree.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
40
project/small_tree/small_tree.png.import
Normal file
40
project/small_tree/small_tree.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bfyw8l1ubdnsj"
|
||||
path="res://.godot/imported/small_tree.png-cf75decf0f8c1df0d335279ecd86f789.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://small_tree/small_tree.png"
|
||||
dest_files=["res://.godot/imported/small_tree.png-cf75decf0f8c1df0d335279ecd86f789.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
21
project/small_tree/small_tree.tscn
Normal file
21
project/small_tree/small_tree.tscn
Normal file
@@ -0,0 +1,21 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d2re5mee0xayj"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bfyw8l1ubdnsj" path="res://small_tree/small_tree.png" id="1_1ao6o"]
|
||||
[ext_resource type="Script" uid="uid://clxosihgty8t5" path="res://small_tree/small_tree.gd" id="1_brd4x"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vb5bs"]
|
||||
size = Vector2(32, 32)
|
||||
|
||||
[node name="Tree" type="Area2D"]
|
||||
script = ExtResource("1_brd4x")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_1ao6o")
|
||||
offset = Vector2(16, 16)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(16, 16)
|
||||
shape = SubResource("RectangleShape2D_vb5bs")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
Reference in New Issue
Block a user