From b580dfd65ec11687face5744282e6644ea57be24 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 29 Apr 2024 05:48:14 +0200 Subject: [PATCH] Implement trees Co-authored-by: Maxim Lobovsky --- entities/tree.tscn | 36 ++++++++++++++++++++++++++++++++++++ entities/tree1.png | 3 +++ entities/tree1.png.import | 34 ++++++++++++++++++++++++++++++++++ entities/tree2.png | 3 +++ entities/tree2.png.import | 34 ++++++++++++++++++++++++++++++++++ scenes/game/main_game.tscn | 18 +++++++++++++++++- 6 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 entities/tree.tscn create mode 100644 entities/tree1.png create mode 100644 entities/tree1.png.import create mode 100644 entities/tree2.png create mode 100644 entities/tree2.png.import diff --git a/entities/tree.tscn b/entities/tree.tscn new file mode 100644 index 0000000..c2441ae --- /dev/null +++ b/entities/tree.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=4 format=3 uid="uid://db246fkcf452d"] + +[ext_resource type="Texture2D" uid="uid://13au54xlwvd8" path="res://entities/tree1.png" id="1_yk0t0"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_rvj5w"] +size = Vector2(36, 36) + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_0arkv"] +radius = 34.5 +height = 91.0 + +[node name="Tree" type="Node2D"] +y_sort_enabled = true + +[node name="Sprite" type="Sprite2D" parent="."] +y_sort_enabled = true +position = Vector2(0, -48) +scale = Vector2(2, 2) +texture = ExtResource("1_yk0t0") + +[node name="Lower" type="StaticBody2D" parent="."] +collision_layer = 8 +collision_mask = 0 + +[node name="Shape" type="CollisionShape2D" parent="Lower"] +position = Vector2(0, -8) +shape = SubResource("RectangleShape2D_rvj5w") + +[node name="Upper" type="StaticBody2D" parent="."] +collision_layer = 16 +collision_mask = 0 + +[node name="Shape" type="CollisionShape2D" parent="Upper"] +position = Vector2(0, -68) +shape = SubResource("CapsuleShape2D_0arkv") +debug_color = Color(0, 0.294118, 0.345098, 0.419608) diff --git a/entities/tree1.png b/entities/tree1.png new file mode 100644 index 0000000..8603a46 --- /dev/null +++ b/entities/tree1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cdd122bab586b4b331c2f3aded7318cbcaecfca4f3fc4498bc6c002394500f9 +size 1549 diff --git a/entities/tree1.png.import b/entities/tree1.png.import new file mode 100644 index 0000000..a9da029 --- /dev/null +++ b/entities/tree1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://13au54xlwvd8" +path="res://.godot/imported/tree1.png-ef3002ca9d87ddc7dc3e90987eec8b21.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entities/tree1.png" +dest_files=["res://.godot/imported/tree1.png-ef3002ca9d87ddc7dc3e90987eec8b21.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/entities/tree2.png b/entities/tree2.png new file mode 100644 index 0000000..e67e904 --- /dev/null +++ b/entities/tree2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f080d2aabbeb46ad07b312310961dcf73e5eb163f3c1d2b41a8fa2bf190f0fab +size 1442 diff --git a/entities/tree2.png.import b/entities/tree2.png.import new file mode 100644 index 0000000..6a0adb6 --- /dev/null +++ b/entities/tree2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://gd267dpdvsea" +path="res://.godot/imported/tree2.png-e4aee889ebb890b4e2608d75a5b3e9c6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entities/tree2.png" +dest_files=["res://.godot/imported/tree2.png-e4aee889ebb890b4e2608d75a5b3e9c6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/scenes/game/main_game.tscn b/scenes/game/main_game.tscn index 62cced2..53f4a01 100644 --- a/scenes/game/main_game.tscn +++ b/scenes/game/main_game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=3 uid="uid://cxj5aud02f40j"] +[gd_scene load_steps=25 format=3 uid="uid://cxj5aud02f40j"] [ext_resource type="Script" path="res://scenes/game/main_game.gd" id="1_wiglu"] [ext_resource type="PackedScene" uid="uid://dm068vaseh45n" path="res://scenes/game/game_camera.tscn" id="2_db5xs"] @@ -17,6 +17,7 @@ [ext_resource type="PackedScene" uid="uid://dnjtduk0hla3f" path="res://entities/watcher.tscn" id="14_8rumi"] [ext_resource type="PackedScene" uid="uid://gl4umoff474y" path="res://entities/cthulhu.tscn" id="15_k41qf"] [ext_resource type="PackedScene" uid="uid://cgpwig0rd08vh" path="res://entities/summoning_circle_pentagram.tscn" id="16_nhsrb"] +[ext_resource type="PackedScene" uid="uid://db246fkcf452d" path="res://entities/tree.tscn" id="18_r8twr"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_058kb"] texture = ExtResource("2_o7bg5") @@ -967,3 +968,18 @@ position = Vector2(189, 171) [node name="Cthulhu" parent="DefaultSpawnParent" instance=ExtResource("15_k41qf")] position = Vector2(226, -137) + +[node name="Tree" parent="." instance=ExtResource("18_r8twr")] +position = Vector2(424, 68) + +[node name="Tree2" parent="." instance=ExtResource("18_r8twr")] +position = Vector2(385, 104) + +[node name="Tree3" parent="." instance=ExtResource("18_r8twr")] +position = Vector2(341, 143) + +[node name="Tree4" parent="." instance=ExtResource("18_r8twr")] +position = Vector2(341, 247) + +[node name="Tree5" parent="." instance=ExtResource("18_r8twr")] +position = Vector2(379, 292)