diff --git a/core/Cursor.gd b/core/Cursor.gd index 5a23098..24ff43d 100644 --- a/core/Cursor.gd +++ b/core/Cursor.gd @@ -46,11 +46,11 @@ func pointcast(): #region Fill hoveredColliders for _object in CastResult: if(_object.collider.input_pickable == true): - hoveredColliders.append(_object.collider) #Get the object that have the collision + hoveredColliders.append(_object.collider) #endregion if (hoveredColliders.size() > 0): if (hoveredColliders.size() >= 2): - sortByPosY(hoveredColliders,false) + hoveredColliders = sortByPosY(hoveredColliders,false) if (hoveredColliders[0] != hoveredCollider): $GrabTimer.stop() if (hoveredCollider and hoveredCollider.has_method("on_unhover")): @@ -81,14 +81,24 @@ func resetCast(bFull = false): ## Sort objects by parent's Y position func sortByPosY(objects: Array, ascending_order: bool = true): var _tempArray :Array + var _tempStickerArray :Array _tempArray = objects - # Inline comparison function - _tempArray.sort_custom(comparePosY) + #filter stickers + for _collider in _tempArray: + if _collider is Sticker: + _tempStickerArray.append(_collider) + if _tempStickerArray.size() > 0: + _tempStickerArray.sort_custom(compareNodeOrder) + _tempArray = _tempStickerArray + else: + _tempArray.sort_custom(comparePosY) # Reverse if descending order is required if not ascending_order: _tempArray.reverse() - objects = _tempArray - + return _tempArray + +func compareNodeOrder(a, b): + return a.get_parent().get_index() < b.get_parent().get_index() func comparePosY(a, b): #print("Compare ",a," at ",a.position.y, " and ",b," at ",b.position.y ) return a.get_parent().position.y < b.get_parent().position.y #Sticker are always at 0, so we need parent position @@ -115,7 +125,9 @@ func grab_start(): func grab_end(): if (grabbedStickerNode.has_method("on_released")): + grabbedStickerNode.on_unhover() grabbedStickerNode.on_released() + print("stopg grabbin at ",query.position ) DebugDraw.points.append(query.position) diff --git a/core/Sticker.gd b/core/Sticker.gd deleted file mode 100644 index b870887..0000000 --- a/core/Sticker.gd +++ /dev/null @@ -1,92 +0,0 @@ -@tool -@icon("res://textures/stickers/icon_sticker2.svg") -class_name Sticker extends Area2D -## Handle all the sticker-relative gameplay. -## -## Sticker node expect to be a child of a Node2D, who serve as a root for -## all the fonctionnalities. You need to assign nodes for the stickerdetection -## and for the sprites. - -@export_group("Nodes") -## The look of the object. If it's multiple sprites, they should be under one main sprite -@export var WorldSprite:Sprite2D -## Optional - The look of the object when grabbed. If empty, OutlineMat will be applied to WorldSprite -@export var StickerSprite:Sprite2D -@export_group("Material") -@export var OutlineMat:ShaderMaterial = preload("res://shaders/shaderMaterial_Outline.tres") -@export var Foiled:bool #TODO: Foil material and logic - -var meta:PackedStringArray = ["sticker"] - -func _init(): - collision_layer = 2 - collision_mask = 0 - set_meta("tags",meta) - monitoring = false - -func _enter_tree(): - set_meta("tags",meta) - if (get_parent() is Sprite2D and WorldSprite == null): - WorldSprite = get_parent() - - -func _ready(): - if (get_parent() == get_tree().root): - printerr("stickers should always have a parent") - breakpoint - - - -func _process(delta): - pass - -## When the sticker is released -func on_released(CastResult:Array=[]): - print(self," released") - #TODO: Need a traceresult to know if it should stay in the stickerstate or be released in the world - get_parent().top_level = false - get_parent().reparent(MapManager.current_scene.get_child(0)) - disable_ChildNodes_collisions(false) - update_ChildNodes_visibilty(true) - - -func on_click(): - print(self," clicked") - -func redraw(): - if (StickerSprite != null): - StickerSprite.queue_redraw() - if (WorldSprite != null): - WorldSprite.queue_redraw() - -func on_hover(): - if (StickerSprite != null): - WorldSprite.visible = false - StickerSprite.visible = true - elif (WorldSprite != null): - WorldSprite.material = OutlineMat - redraw() - - -func on_unhover(): - if (StickerSprite != null): - StickerSprite.visible = false - if (WorldSprite != null): - WorldSprite.material = null - WorldSprite.visible = true - redraw() - -func on_grab(_offset:Vector2=Vector2(0.0,0.0)): - get_parent().top_level = true - get_parent().reparent(get_tree().root) - update_ChildNodes_visibilty(false) - -func update_ChildNodes_visibilty(_visible:bool=true): - for _childNode in get_parent().get_children(): - if(_childNode != WorldSprite): - _childNode.visible = _visible - -func disable_ChildNodes_collisions(_disable:bool=true): - for _childNode in get_parent().get_children(): - _childNode.set_deferred("disabled",_disable) - diff --git a/core/bridgeNode.tscn b/core/bridgeNode.tscn index 033b8ed..d0da5d2 100644 --- a/core/bridgeNode.tscn +++ b/core/bridgeNode.tscn @@ -1,40 +1,8 @@ [gd_scene load_steps=2 format=3 uid="uid://clqvgh6qmglue"] -[sub_resource type="GDScript" id="GDScript_8d33s"] -resource_name = "bridge" -script/source = "extends Area2D +[ext_resource type="Script" path="res://core/bridgenode.tres.gd" id="1_tp7pv"] -var wallObjects : Array - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(_delta): - pass - - -func _on_body_entered(object): - print(\"Entered %d\",object) - if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" and wallObjects != null ): - for _object in wallObjects: - if (_object != null): - _object.process_mode = Node.PROCESS_MODE_DISABLED - else: - wallObjects.append(object) - - -func _on_body_exited(object): - if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" and wallObjects != null ): - for _object in wallObjects: - if (_object != null): - _object.process_mode = Node.PROCESS_MODE_INHERIT -" - -[node name="BridgeNode" type="Area2D"] -script = SubResource("GDScript_8d33s") - -[connection signal="body_entered" from="." to="." method="_on_body_entered"] -[connection signal="body_exited" from="." to="." method="_on_body_exited"] +[node name="Bridge" type="Area2D"] +collision_layer = 4 +collision_mask = 9 +script = ExtResource("1_tp7pv") diff --git a/core/bridgenode.tres.gd b/core/bridgenode.tres.gd new file mode 100644 index 0000000..cefafd1 --- /dev/null +++ b/core/bridgenode.tres.gd @@ -0,0 +1,31 @@ +@tool +class_name Bridge extends Area2D +## Disable the collisions when player enter + +var wallObjects : Array + +func _init(): + collision_layer = 4 + collision_mask = 25 +# Called when the node enters the scene tree for the first time. +func _ready(): + body_entered.connect(_on_body_entered) + body_exited.connect(_on_body_exited) + + + +func _on_body_entered(object): + print("Entered %d",object) + if (object.has_meta("Type") and object.get_meta("Type") == "Player" and wallObjects != null ): + for _object in wallObjects: + if (_object != null): + _object.process_mode = Node.PROCESS_MODE_DISABLED + else: + wallObjects.append(object) + + +func _on_body_exited(object): + if (object.has_meta("Type") and object.get_meta("Type") == "Player" and wallObjects != null ): + for _object in wallObjects: + if (_object != null): + _object.process_mode = Node.PROCESS_MODE_INHERIT diff --git a/core/player.tscn b/core/player.tscn index 4183729..84f5ece 100644 --- a/core/player.tscn +++ b/core/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=3 uid="uid://0m1hk2nu4bps"] +[gd_scene load_steps=23 format=3 uid="uid://0m1hk2nu4bps"] [ext_resource type="Script" path="res://core/player.gd" id="1_whhfc"] [ext_resource type="Texture2D" uid="uid://5pmqr3y62guu" path="res://textures/player/currentCloth.tres" id="2_w1l4c"] @@ -499,11 +499,8 @@ node_connections = [&"output", 0, &"WalkRun"] [sub_resource type="CanvasTexture" id="CanvasTexture_2b3h6"] diffuse_texture = ExtResource("6_3ryww") -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_8drh2"] -radius = 130.0 -height = 550.0 - [node name="Player" type="CharacterBody2D"] +collision_mask = 17 motion_mode = 1 script = ExtResource("1_whhfc") CurrentSkin = ExtResource("2_w1l4c") @@ -551,23 +548,25 @@ parameters/WalkRun/3/TimeScale/scale = 0.3 position = Vector2(17, 0) [node name="BootL" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(-93.6914, -35.1428) -rotation = 0.413206 +position = Vector2(40.7995, -40.9482) +rotation = -0.517457 +scale = Vector2(1, 1) texture = ExtResource("2_w1l4c") region_enabled = true region_rect = Rect2(896, 768, 128, 128) metadata/Type = "Skin" [node name="BootR" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(40.2865, -41.1666) -rotation = -0.671407 +position = Vector2(-70.0154, -47.9395) +rotation = 0.481493 +scale = Vector2(1, 1) texture = ExtResource("2_w1l4c") region_enabled = true region_rect = Rect2(896, 768, 128, 128) metadata/Type = "Skin" [node name="Body" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(51, -234.374) +position = Vector2(51, -242.313) texture = ExtResource("2_w1l4c") offset = Vector2(-15, 0) region_enabled = true @@ -591,7 +590,7 @@ metadata/Type = "Skin" [node name="Tail" type="Sprite2D" parent="Skeleton2D/Body"] show_behind_parent = true -position = Vector2(44, 104.374) +position = Vector2(44, 112.313) rotation = 0.153589 texture = ExtResource("2_w1l4c") offset = Vector2(70, 0) @@ -600,8 +599,8 @@ region_rect = Rect2(768, 640, 256, 128) metadata/Type = "Skin" [node name="Head" type="Sprite2D" parent="Skeleton2D"] -position = Vector2(-40, -407.374) -rotation = 0.0767937 +position = Vector2(-40, -415.313) +rotation = 0.000647508 scale = Vector2(1, 1) texture = ExtResource("2_w1l4c") offset = Vector2(0, -168) @@ -690,9 +689,3 @@ z_index = -1 position = Vector2(42, -381) scale = Vector2(1.89731, 1.89731) texture = SubResource("CanvasTexture_2b3h6") - -[node name="DetectionArea" type="Area2D" parent="."] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectionArea"] -position = Vector2(0, -266.265) -shape = SubResource("CapsuleShape2D_8drh2") diff --git a/core/sceneInstance.gd b/core/sceneInstance.gd index 6cb775e..0b328ba 100644 --- a/core/sceneInstance.gd +++ b/core/sceneInstance.gd @@ -10,6 +10,13 @@ extends Node2D #@onready var scene_transition = $ScreenTransition/AnimationPlayer var player:Object +func scene_clean(scene): + if (scene != null and scene.get_child_count() > 0): + scene.get_child(0).queue_free() + +func _init(): + scene_clean(current_scene) + scene_clean(next_scene) func _process(_delta): if($CurrentScene.get_child_count() >0): @@ -67,7 +74,6 @@ func _on_animation_player_animation_finished(anim_name): current_scene.position = Vector2(0,0) if (next_scene.get_child_count() > 0): next_scene.get_child(0).reparent(current_scene) - if (next_scene.get_child_count() > 0): - next_scene.get_child(0).queue_free() + scene_clean(next_scene) print("level unloaded") await get_tree().create_timer(1).connect("timeout",Callable(self,"on_travel_end")) diff --git a/core/stickernode.gd b/core/stickernode.gd new file mode 100644 index 0000000..34ba61f --- /dev/null +++ b/core/stickernode.gd @@ -0,0 +1,164 @@ +@tool +@icon("res://textures/stickers/icon_sticker2.svg") +class_name Sticker extends Area2D +## Handle all the sticker-relative gameplay. +## +## Sticker node expect to be a child of a Node2D, who serve as a root for +## all the fonctionnalities. You need to assign nodes for the stickerdetection +## and for the sprites. + +#region Exported variables +@export var Sticker_mode:bool = false +@export_group("Nodes") +## The look of the object. If it's multiple sprites, they should be under one main sprite +@export var WorldSprite:Sprite2D +## Optional - The look of the object when grabbed. If empty, OutlineMat will be applied to WorldSprite +@export var StickerSprite:Sprite2D +## Optional - The detection zone, if not the same as the sticker area +@export var DetectionArea:Area2D: + set(new_area): + if(new_area != self): + DetectionArea = new_area + else: + printerr("DetectionArea cannot be the sticker itself") +@export_group("Material") +@export var OutlineMat:ShaderMaterial = preload("res://shaders/shaderMaterial_Outline.tres") +@export var Foiled:bool #TODO: Foil material and logic +@export var CreateShape:bool: + set(value): + var test = CollisionShape2D.new() + test.set_name("StickerShape") + add_child(test) + test.set_owner(get_tree().get_edited_scene_root()) + test = null +#endregion + +var meta:PackedStringArray = ["sticker"] +var detected_solids:Array +var detected_zones:Array +var Grabbed:bool = false + +#region Functions +func _get_configuration_warnings(): + if (get_parent() == get_tree().get_edited_scene_root()): + return ["This node should have a parent"] + return [] + +func _init(): + collision_layer = 2 + # TODO: Stickerzone maybe will not need to check everything, and detection will be on the zone detection area only. maybe we want a fallback if sticker area and detection area are the same shape + collision_mask = 61 + set_meta("tags",meta) + monitoring = true + if Engine.is_editor_hint(): + update_configuration_warnings() + +func _enter_tree(): + set_meta("tags",meta) + if (get_parent() is Sprite2D and WorldSprite == null): + WorldSprite = get_parent() + if Engine.is_editor_hint(): + update_configuration_warnings() + +func _ready(): + if (get_parent() == get_tree().root): + printerr("stickers should always have a parent") + breakpoint + if (DetectionArea != null): + DetectionArea.area_entered.connect(_on_area_entered) + DetectionArea.area_exited.connect(_on_area_exited) + DetectionArea.body_entered.connect(_on_body_entered) + DetectionArea.body_exited.connect(_on_body_exited) + DetectionArea.collision_mask = 61 + else: + area_entered.connect(_on_area_entered) + area_exited.connect(_on_area_exited) + body_entered.connect(_on_body_entered) + body_exited.connect(_on_body_exited) + +# TODO : Solids and interactive zone detection area should not be the same as the sticker area. +# IDEA: Need to export a child Area2D +func _on_body_entered(body:Node2D): + print("body entered",body) + detected_solids.append(body) +func _on_body_exited(body:Node2D): + print("body exited",body) + detected_solids.erase(body) + if(Sticker_mode and Grabbed and detected_solids.size() == 0): + print("Can be released in object mode") +func _on_area_entered(area:Area2D): + print("area entered",area) + #TODO:Filter by type + detected_zones.append(area) +func _on_area_exited(area:Area2D): + print("area exited",area) + detected_zones.erase(area) + +func _process(_delta): + pass + + +## When the sticker is released +func on_released(_CastResult:Array=[]): + print(self," released") + Grabbed = false + #Need a traceresult to know if it should stay in the stickerstate or be released in the world + if(detected_solids.size()==0): + get_parent().top_level = false + disable_ChildNodes_collisions(false) + update_ChildNodes_visibilty(true) + Sticker_mode = false + on_unhover() #security,but i don't like it + get_parent().reparent(MapManager.current_scene.get_child(0)) + + + +func on_click(): + print(self," clicked") + +func redraw(): + if (StickerSprite != null): + StickerSprite.queue_redraw() + if (WorldSprite != null): + WorldSprite.queue_redraw() + +func on_hover(): + if (Sticker_mode == false): + if (StickerSprite != null): + WorldSprite.visible = false + StickerSprite.visible = true + elif (WorldSprite != null): + WorldSprite.material = OutlineMat + redraw() + + +func on_unhover(): + if (Sticker_mode == false): + if (StickerSprite != null): + StickerSprite.visible = false + if (WorldSprite != null): + WorldSprite.material = null + WorldSprite.visible = true + redraw() + + +func on_grab(_offset:Vector2=Vector2(0.0,0.0)): + Sticker_mode = true + + get_parent().top_level = true + get_parent().reparent(MapManager) + update_ChildNodes_visibilty(false) + disable_ChildNodes_collisions(true) + Grabbed = true + +func update_ChildNodes_visibilty(_visible:bool=true): + for _childNode in get_parent().get_children(): + if(_childNode != WorldSprite and _childNode != StickerSprite): + _childNode.visible = _visible + +func disable_ChildNodes_collisions(_disable:bool=true): + for _childNode in get_parent().get_children(): + if (_childNode != self): + _childNode.process_mode = Node.PROCESS_MODE_DISABLED if _disable else Node.PROCESS_MODE_ALWAYS + +#endregion diff --git a/maps/map1.tscn b/maps/map1.tscn index a038b55..7f1bf8d 100644 --- a/maps/map1.tscn +++ b/maps/map1.tscn @@ -1,58 +1,53 @@ -[gd_scene load_steps=27 format=3 uid="uid://wlqsvbqpcbh"] +[gd_scene load_steps=33 format=3 uid="uid://wlqsvbqpcbh"] [ext_resource type="Texture2D" uid="uid://cacwy4tka88k1" path="res://maps/map1.tres" id="1_pt5vq"] +[ext_resource type="Texture2D" uid="uid://bm2nsrfle5nsd" path="res://textures/sprites/floor_door_grass_right1.tres" id="2_0jvyl"] +[ext_resource type="Script" path="res://core/Door.gd" id="3_384sx"] +[ext_resource type="Texture2D" uid="uid://bfnbnuclg8ab0" path="res://textures/sprites/props_wood_bridge1.tres" id="3_k46hy"] +[ext_resource type="Texture2D" uid="uid://dggavne4ueche" path="res://textures/sprites/Tree_Field_01_SPRT.png" id="4_74dki"] +[ext_resource type="Texture2D" uid="uid://b2nhenx3l2uww" path="res://textures/sprites/floor_door_grass_up1.tres" id="4_f0vha"] [ext_resource type="PackedScene" uid="uid://do65rgg0p2plt" path="res://core/Door.tscn" id="4_lwk0u"] [ext_resource type="Texture2D" uid="uid://ddajgcwn5ip4c" path="res://textures/sprites/plants_bush1.tres" id="4_m2p3o"] [ext_resource type="PackedScene" uid="uid://bddcriwo55x8k" path="res://prefab/prefab_woddenbridge.tscn" id="4_okpsn"] +[ext_resource type="Script" path="res://core/stickernode.gd" id="5_ek34p"] [ext_resource type="Texture2D" uid="uid://ciyh3rnoo4uk" path="res://textures/atlas/SimpleParticles_All_01_SPRT.png" id="6_0dctx"] +[ext_resource type="Texture2D" uid="uid://1qfjbuyf5aq5" path="res://textures/sprites/props_log1.tres" id="6_8yowd"] [ext_resource type="Texture2D" uid="uid://dcgjlblm2rpy4" path="res://textures/2d_lights_and_shadows_neutral_point_light.webp" id="7_4swoj"] -[ext_resource type="Script" path="res://core/sticker.gd" id="8_c6p5e"] +[ext_resource type="Texture2D" uid="uid://cup0xru4j84wj" path="res://textures/sprites/rocks_rock2.tres" id="7_mbwmw"] +[ext_resource type="Texture2D" uid="uid://c6acjgu8jnrkl" path="res://textures/sprites/rocks_rock1.tres" id="8_bhcew"] +[ext_resource type="PackedScene" uid="uid://kvjctagkwivk" path="res://prefab/prefab_bush1.tscn" id="8_tag7x"] [ext_resource type="Texture2D" uid="uid://dnomlcslicb3k" path="res://textures/sprites/props_fire1.tres" id="10_2ugv3"] +[ext_resource type="Texture2D" uid="uid://qsse8uwt06ns" path="res://textures/sprites/plants_bush2.tres" id="11_dibxq"] +[ext_resource type="Texture2D" uid="uid://51ntd0qmjw5j" path="res://textures/sprites/props_woodbarrer.tres" id="14_n4lnm"] +[ext_resource type="Texture2D" uid="uid://xx3dwpwk467v" path="res://textures/sprites/stickers_fire1.png" id="19_d8hr8"] -[sub_resource type="AtlasTexture" id="AtlasTexture_gnudx"] -region = Rect2(252, 16, 108, 256) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_yeof8"] +size = Vector2(202.667, 60.3336) -[sub_resource type="AtlasTexture" id="AtlasTexture_ex6vq"] -region = Rect2(0, 16, 228, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2wdar"] -region = Rect2(384, 64, 288, 224) +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_dqo8w"] +resource_name = "TreeShape" +radius = 70.0 +height = 512.0 [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_lfx7b"] radius = 80.0 height = 254.0 -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_dqo8w"] -radius = 70.0 -height = 512.0 - -[sub_resource type="AtlasTexture" id="AtlasTexture_rn40i"] -region = Rect2(736, 96, 224, 160) - [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_b3366"] radius = 65.0 height = 184.05 -[sub_resource type="AtlasTexture" id="AtlasTexture_vun1v"] -region = Rect2(288, 256, 192, 160) - [sub_resource type="RectangleShape2D" id="RectangleShape2D_4cdlc"] size = Vector2(133.06, 62.73) -[sub_resource type="AtlasTexture" id="AtlasTexture_wpoj4"] -region = Rect2(1440, 1376, 256, 256) - [sub_resource type="RectangleShape2D" id="RectangleShape2D_hk5e3"] size = Vector2(201.89, 146.45) -[sub_resource type="AtlasTexture" id="AtlasTexture_w86nr"] -region = Rect2(544, 32, 160, 192) - [sub_resource type="RectangleShape2D" id="RectangleShape2D_tss3y"] size = Vector2(127.875, 25.5) -[sub_resource type="AtlasTexture" id="AtlasTexture_4j533"] -region = Rect2(1356, 1216, 192, 80) +[sub_resource type="CircleShape2D" id="CircleShape2D_8byel"] +radius = 54.91 [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jw3i8"] lifetime_randomness = 0.2 @@ -68,8 +63,9 @@ gravity = Vector3(0, -20, 0) atlas = ExtResource("6_0dctx") region = Rect2(0, 0, 128, 160) -[sub_resource type="CircleShape2D" id="CircleShape2D_5wedp"] -radius = 42.25 +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_b176g"] +radius = 25.0 +height = 85.0 [sub_resource type="CircleShape2D" id="CircleShape2D_wkggp"] radius = 72.88 @@ -78,7 +74,7 @@ radius = 72.88 z_as_relative = false y_sort_enabled = true -[node name="Floors05Sprt" type="Sprite2D" parent="."] +[node name="Floor" type="Sprite2D" parent="."] z_index = -10 z_as_relative = false scale = Vector2(6, 6) @@ -86,39 +82,52 @@ texture = ExtResource("1_pt5vq") region_rect = Rect2(0, 0, 1024, 992) metadata/_edit_lock_ = true -[node name="StaticBody2D" type="StaticBody2D" parent="Floors05Sprt"] +[node name="StaticBody2D" type="StaticBody2D" parent="Floor"] +collision_layer = 16 metadata/_edit_lock_ = true -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Floors05Sprt/StaticBody2D"] +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Floor/StaticBody2D"] polygon = PackedVector2Array(-450, 68.3333, -446.167, 162.667, 194.833, 162.667, 211.833, 162.667, 208.167, -35.3333, 462.667, -31.5, 458.833, -131.5, 191.167, -129.667, 191.167, 66.5) -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Floors05Sprt/StaticBody2D"] +[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Floor/StaticBody2D"] visible = false build_mode = 1 polygon = PackedVector2Array(-448, -432.5, 458, -430.833, 456.667, 147.667, 529.5, 143.167, 526.167, 348.5, 452.167, 349.5, 456.167, 411, 104.751, 409.64, 97.6667, 474, -99.5, 470.333, -104.305, 408.83, -448, 407.5, -448.5, -154.333, -519.833, -163.833, -524.667, -363.5, -448, -365.152) -[node name="Door" type="Sprite2D" parent="Floors05Sprt"] +[node name="Door" type="Sprite2D" parent="Floor"] z_index = -1 position = Vector2(491.833, 269.333) -texture = SubResource("AtlasTexture_gnudx") +texture = ExtResource("2_0jvyl") +script = ExtResource("3_384sx") +Travel = 1 -[node name="Door2" type="Sprite2D" parent="Floors05Sprt"] +[node name="Area2D" type="Area2D" parent="Floor/Door"] +input_pickable = false +monitorable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor/Door/Area2D"] +position = Vector2(5.32, -22.732) +rotation = -1.5708 +shape = SubResource("RectangleShape2D_yeof8") + +[node name="Door2" type="Sprite2D" parent="Floor"] z_index = -1 position = Vector2(-481.833, -238.667) -texture = SubResource("AtlasTexture_gnudx") +texture = ExtResource("2_0jvyl") flip_h = true -[node name="Door4" type="Sprite2D" parent="Floors05Sprt"] +[node name="Door4" type="Sprite2D" parent="Floor"] position = Vector2(14.3333, -456.333) -texture = SubResource("AtlasTexture_ex6vq") +texture = ExtResource("4_f0vha") flip_h = true -[node name="WoodenBridge" parent="Floors05Sprt" instance=ExtResource("4_okpsn")] +[node name="WoodenBridge" parent="Floor" instance=ExtResource("4_okpsn")] position = Vector2(325.833, -87.5) scale = Vector2(0.95216, 0.95216) +texture = ExtResource("3_k46hy") metadata/Tags = ["bridge"] -[node name="Door3" parent="Floors05Sprt" instance=ExtResource("4_lwk0u")] +[node name="Door3" parent="Floor" instance=ExtResource("4_lwk0u")] position = Vector2(-1.5, 455) NextScene = "res://maps/map2.tscn" Travel = 3 @@ -130,88 +139,85 @@ top_level = true position = Vector2(78, -148) scale = Vector2(6.15, 6.15) -[node name="Bush1" type="Sprite2D" parent="."] -position = Vector2(-2161, 1140) -scale = Vector2(3.80334, 3.95089) -texture = SubResource("AtlasTexture_2wdar") -centered = false -offset = Vector2(-161.055, -179.785) -metadata/tags = ["sticker"] - -[node name="Area2D" type="Area2D" parent="Bush1"] -collision_layer = 2 -collision_mask = 0 -monitoring = false - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Bush1/Area2D"] -position = Vector2(-4.46976, -71.6294) -rotation = 1.6 -shape = SubResource("CapsuleShape2D_lfx7b") - -[node name="Tree1" type="Sprite2D" parent="."] -position = Vector2(1592, 606) -scale = Vector2(3.80334, 3.95089) -centered = false -offset = Vector2(-251.145, -512) -metadata/tags = ["sticker"] - -[node name="Area2D" type="Area2D" parent="Tree1"] -collision_layer = 2 -collision_mask = 0 -monitoring = false - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree1/Area2D"] -position = Vector2(0, -253.27) -rotation = 0.01 -shape = SubResource("CapsuleShape2D_dqo8w") +[node name="Bush1" parent="." instance=ExtResource("8_tag7x")] [node name="Tree2" type="Sprite2D" parent="."] position = Vector2(-2399, -55) scale = Vector2(3.80334, 3.95089) +texture = ExtResource("4_74dki") centered = false offset = Vector2(-251.145, -512) metadata/tags = ["sticker"] -[node name="Area2D" type="Area2D" parent="Tree2"] +[node name="Sticker" type="Area2D" parent="Tree2" node_paths=PackedStringArray("WorldSprite")] collision_layer = 2 -collision_mask = 0 -monitoring = false +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") -[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree2/Area2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree2/Sticker"] position = Vector2(0, -253.27) rotation = 0.01 shape = SubResource("CapsuleShape2D_dqo8w") -[node name="Tree3" type="Sprite2D" parent="."] -position = Vector2(-763, -2021) +[node name="Tree5" type="Sprite2D" parent="."] +position = Vector2(1592, 606) scale = Vector2(3.80334, 3.95089) +texture = ExtResource("4_74dki") centered = false offset = Vector2(-251.145, -512) metadata/tags = ["sticker"] -[node name="Area2D" type="Area2D" parent="Tree3"] +[node name="Sticker" type="Area2D" parent="Tree5" node_paths=PackedStringArray("WorldSprite")] collision_layer = 2 -collision_mask = 0 -monitoring = false +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") -[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree3/Area2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree5/Sticker"] position = Vector2(0, -253.27) rotation = 0.01 shape = SubResource("CapsuleShape2D_dqo8w") +[node name="Tree6" type="Sprite2D" parent="."] +position = Vector2(-774, -2011) +scale = Vector2(3.80334, 3.95089) +texture = ExtResource("4_74dki") +centered = false +offset = Vector2(-251.145, -512) +metadata/tags = ["sticker"] + +[node name="Sticker" type="Area2D" parent="Tree6" node_paths=PackedStringArray("WorldSprite")] +collision_layer = 2 +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree6/Sticker"] +position = Vector2(0, -253.27) +rotation = 0.01 +shape = SubResource("CapsuleShape2D_dqo8w") +metadata/_edit_lock_ = true + [node name="Tree4" type="Sprite2D" parent="."] position = Vector2(2365, -2258) scale = Vector2(3.80334, 3.95089) +texture = ExtResource("4_74dki") centered = false offset = Vector2(-251.145, -512) metadata/tags = ["sticker"] -[node name="Area2D" type="Area2D" parent="Tree4"] +[node name="Sticker" type="Area2D" parent="Tree4" node_paths=PackedStringArray("WorldSprite")] collision_layer = 2 -collision_mask = 0 -monitoring = false +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") -[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree4/Area2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree4/Sticker"] position = Vector2(0, -253.27) rotation = 0.01 shape = SubResource("CapsuleShape2D_dqo8w") @@ -226,9 +232,8 @@ metadata/tags = ["sticker"] [node name="Sticker" type="Area2D" parent="Bush6" node_paths=PackedStringArray("WorldSprite")] collision_layer = 2 -collision_mask = 0 -monitoring = false -script = ExtResource("8_c6p5e") +collision_mask = 61 +script = ExtResource("5_ek34p") WorldSprite = NodePath("..") metadata/tags = PackedStringArray("sticker") @@ -240,16 +245,15 @@ shape = SubResource("CapsuleShape2D_lfx7b") [node name="Bush7" type="Sprite2D" parent="."] position = Vector2(712, 293) scale = Vector2(3.80334, 3.95089) -texture = SubResource("AtlasTexture_2wdar") +texture = ExtResource("4_m2p3o") centered = false offset = Vector2(-161.055, -179.785) metadata/tags = ["sticker"] [node name="Sticker" type="Area2D" parent="Bush7" node_paths=PackedStringArray("WorldSprite")] collision_layer = 2 -collision_mask = 0 -monitoring = false -script = ExtResource("8_c6p5e") +collision_mask = 61 +script = ExtResource("5_ek34p") WorldSprite = NodePath("..") metadata/tags = PackedStringArray("sticker") @@ -258,76 +262,43 @@ position = Vector2(-4.46976, -71.6294) rotation = 1.6 shape = SubResource("CapsuleShape2D_lfx7b") -[node name="Bush9" type="Sprite2D" parent="."] -position = Vector2(1004, -2257) +[node name="Bush11" type="Sprite2D" parent="."] +position = Vector2(2203, 2322) scale = Vector2(3.80334, 3.95089) -texture = SubResource("AtlasTexture_2wdar") +texture = ExtResource("4_m2p3o") centered = false offset = Vector2(-161.055, -179.785) metadata/tags = ["sticker"] -[node name="Area2D" type="Area2D" parent="Bush9"] +[node name="Sticker" type="Area2D" parent="Bush11" node_paths=PackedStringArray("WorldSprite")] collision_layer = 2 -collision_mask = 0 -monitoring = false +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") -[node name="CollisionShape2D" type="CollisionShape2D" parent="Bush9/Area2D"] -position = Vector2(-4.46976, -71.6294) -rotation = 1.6 -shape = SubResource("CapsuleShape2D_lfx7b") - -[node name="Bush8" type="Sprite2D" parent="."] -position = Vector2(-1616, -1651) -scale = Vector2(3.80334, 3.95089) -texture = SubResource("AtlasTexture_2wdar") -centered = false -offset = Vector2(-137.285, -179.785) -flip_h = true -metadata/tags = ["sticker"] - -[node name="Area2D" type="Area2D" parent="Bush8"] -collision_layer = 2 -collision_mask = 0 -monitoring = false - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Bush8/Area2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Bush11/Sticker"] position = Vector2(-4.46976, -71.6294) rotation = 1.6 shape = SubResource("CapsuleShape2D_lfx7b") +metadata/_edit_lock_ = true [node name="Bush10" type="Sprite2D" parent="."] position = Vector2(-2063, -2116) scale = Vector2(3.80334, 3.95089) -texture = SubResource("AtlasTexture_rn40i") -centered = false -offset = Vector2(-108.615, -141.38) +texture = ExtResource("11_dibxq") +offset = Vector2(0, -63.525) flip_h = true metadata/tags = ["sticker"] -[node name="Area2D" type="Area2D" parent="Bush10"] +[node name="Sticker" type="Area2D" parent="Bush10" node_paths=PackedStringArray("WorldSprite")] collision_layer = 2 -collision_mask = 0 -monitoring = false +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") -[node name="CollisionShape2D" type="CollisionShape2D" parent="Bush10/Area2D"] -position = Vector2(0, -48.95) -rotation = 1.5 -shape = SubResource("CapsuleShape2D_b3366") - -[node name="Bush11" type="Sprite2D" parent="."] -position = Vector2(2208, 2337) -scale = Vector2(5, 5.195) -texture = SubResource("AtlasTexture_rn40i") -centered = false -offset = Vector2(-108.615, -141.38) -metadata/tags = ["sticker"] - -[node name="Area2D" type="Area2D" parent="Bush11"] -collision_layer = 2 -collision_mask = 0 -monitoring = false - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Bush11/Area2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Bush10/Sticker"] position = Vector2(0, -48.95) rotation = 1.5 shape = SubResource("CapsuleShape2D_b3366") @@ -335,7 +306,7 @@ shape = SubResource("CapsuleShape2D_b3366") [node name="Rock1" type="Sprite2D" parent="."] position = Vector2(-1807, 2030) scale = Vector2(3.80334, 3.95089) -texture = SubResource("AtlasTexture_vun1v") +texture = ExtResource("7_mbwmw") centered = false offset = Vector2(-78.385, -130.2) metadata/tags = ["rock"] @@ -350,7 +321,7 @@ debug_color = Color(0.996033, 0, 0.194446, 0.42) [node name="Rock2" type="Sprite2D" parent="."] position = Vector2(-2248, 1895) scale = Vector2(3.80334, 3.95089) -texture = SubResource("AtlasTexture_wpoj4") +texture = ExtResource("8_bhcew") centered = false offset = Vector2(-126.11, -220.56) metadata/tags = ["rock"] @@ -365,7 +336,7 @@ debug_color = Color(0.996033, 0, 0.194446, 0.42) [node name="Log" type="Sprite2D" parent="."] position = Vector2(-1043, -170) scale = Vector2(4, 4) -texture = SubResource("AtlasTexture_w86nr") +texture = ExtResource("6_8yowd") centered = false offset = Vector2(-79.665, -133.81) metadata/_edit_lock_ = true @@ -377,10 +348,21 @@ position = Vector2(3.75, -17.5) shape = SubResource("RectangleShape2D_tss3y") debug_color = Color(0.999472, 0.00663362, 0.0810784, 0.42) +[node name="Sticker" type="Area2D" parent="Log" node_paths=PackedStringArray("WorldSprite")] +collision_layer = 2 +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") + +[node name="stickershape" type="CollisionShape2D" parent="Log/Sticker"] +position = Vector2(4.5, -34.75) +shape = SubResource("CircleShape2D_8byel") + [node name="WoodBarrer" type="Sprite2D" parent="."] position = Vector2(1246, 2431) scale = Vector2(6.5, 6.5) -texture = SubResource("AtlasTexture_4j533") +texture = ExtResource("14_n4lnm") centered = false offset = Vector2(-96.815, -74.27) metadata/_edit_lock_ = true @@ -395,7 +377,7 @@ debug_color = Color(0.999472, 0.00663362, 0.0810784, 0.42) [node name="Log3" type="Sprite2D" parent="."] position = Vector2(293, -810) scale = Vector2(4, 4) -texture = SubResource("AtlasTexture_w86nr") +texture = ExtResource("6_8yowd") centered = false offset = Vector2(-79.665, -133.81) metadata/_edit_lock_ = true @@ -407,15 +389,29 @@ position = Vector2(3.75, -17.5) shape = SubResource("RectangleShape2D_tss3y") debug_color = Color(0.999472, 0.00663362, 0.0810784, 0.42) -[node name="FirePit" type="Sprite2D" parent="."] -position = Vector2(-315, -588) +[node name="Sticker" type="Area2D" parent="Log3" node_paths=PackedStringArray("WorldSprite")] +collision_layer = 2 +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") + +[node name="StickerShape" type="CollisionShape2D" parent="Log3/Sticker"] +position = Vector2(4.5, -34.75) +shape = SubResource("CircleShape2D_8byel") + +[node name="FirePit" type="Node2D" parent="."] +position = Vector2(-303, -662) + +[node name="FirePitSprite" type="Sprite2D" parent="FirePit"] +z_index = -1 scale = Vector2(4, 4) texture = ExtResource("10_2ugv3") offset = Vector2(0, -26.64) [node name="GPUParticles2D" type="GPUParticles2D" parent="FirePit"] -position = Vector2(1.25, -45.75) -scale = Vector2(0.5, 0.5) +position = Vector2(5, -183) +scale = Vector2(2, 2) amount = 4 process_material = SubResource("ParticleProcessMaterial_jw3i8") texture = SubResource("AtlasTexture_c24s7") @@ -425,43 +421,58 @@ visibility_rect = Rect2(-160, -160, 320, 320) local_coords = true [node name="StaticBody2D" type="StaticBody2D" parent="FirePit"] -position = Vector2(5.25, -32) +position = Vector2(15.13, -91.07) +scale = Vector2(4, 4) [node name="CollisionShape2D" type="CollisionShape2D" parent="FirePit/StaticBody2D"] -shape = SubResource("CircleShape2D_5wedp") +rotation = 1.5708 +shape = SubResource("CapsuleShape2D_b176g") debug_color = Color(0.937527, 0.247798, 0.087146, 0.42) [node name="PointLight2D" type="PointLight2D" parent="FirePit"] -position = Vector2(8.25, -43) -scale = Vector2(0.7, 0.7) +position = Vector2(33, -172) +scale = Vector2(2.8, 2.8) color = Color(1, 0.54902, 0.270588, 1) energy = 1.2 shadow_enabled = true texture = ExtResource("7_4swoj") texture_scale = 1.9 +metadata/_edit_lock_ = true -[node name="Sticker" type="Area2D" parent="FirePit" node_paths=PackedStringArray("WorldSprite")] -position = Vector2(2.75, -32) +[node name="Sticker" type="Area2D" parent="FirePit" node_paths=PackedStringArray("WorldSprite", "StickerSprite")] +position = Vector2(11, -128) +scale = Vector2(4, 4) collision_layer = 2 -collision_mask = 0 -monitoring = false -script = ExtResource("8_c6p5e") -WorldSprite = NodePath("..") +collision_mask = 61 +script = ExtResource("5_ek34p") +WorldSprite = NodePath("../FirePitSprite") +StickerSprite = NodePath("../FirePitSticker") metadata/tags = PackedStringArray("sticker") [node name="CollisionShape2D" type="CollisionShape2D" parent="FirePit/Sticker"] shape = SubResource("CircleShape2D_wkggp") -[connection signal="property_list_changed" from="Bush1" to="Bush1" method="_on_property_list_changed"] -[connection signal="property_list_changed" from="Tree1" to="Tree1" method="_on_property_list_changed"] +[node name="FirePitSticker" type="Sprite2D" parent="FirePit"] +visible = false +scale = Vector2(1.8, 1.8) +texture = ExtResource("19_d8hr8") +offset = Vector2(0, -95.355) + +[node name="Bush2" parent="." instance=ExtResource("8_tag7x")] +position = Vector2(-1449, -1696) +flip_h = true + +[node name="Bush3" parent="." instance=ExtResource("8_tag7x")] +position = Vector2(1000, -2228) +flip_h = true + [connection signal="property_list_changed" from="Tree2" to="Tree2" method="_on_property_list_changed"] -[connection signal="property_list_changed" from="Tree3" to="Tree3" method="_on_property_list_changed"] +[connection signal="property_list_changed" from="Tree5" to="Tree5" method="_on_property_list_changed"] +[connection signal="property_list_changed" from="Tree6" to="Tree6" method="_on_property_list_changed"] [connection signal="property_list_changed" from="Tree4" to="Tree4" method="_on_property_list_changed"] [connection signal="property_list_changed" from="Bush6" to="Bush6" method="_on_property_list_changed"] [connection signal="property_list_changed" from="Bush7" to="Bush7" method="_on_property_list_changed"] -[connection signal="property_list_changed" from="Bush9" to="Bush9" method="_on_property_list_changed"] -[connection signal="property_list_changed" from="Bush8" to="Bush8" method="_on_property_list_changed"] -[connection signal="property_list_changed" from="Bush10" to="Bush10" method="_on_property_list_changed"] [connection signal="property_list_changed" from="Bush11" to="Bush11" method="_on_property_list_changed"] +[connection signal="property_list_changed" from="Bush10" to="Bush10" method="_on_property_list_changed"] [connection signal="property_list_changed" from="Rock1" to="Rock1" method="_on_property_list_changed"] [connection signal="property_list_changed" from="Rock2" to="Rock2" method="_on_property_list_changed"] diff --git a/maps/map2.tscn b/maps/map2.tscn index e5b3860..a6569a5 100644 --- a/maps/map2.tscn +++ b/maps/map2.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=21 format=3 uid="uid://5tfe84u3gyty"] +[gd_scene load_steps=22 format=3 uid="uid://5tfe84u3gyty"] [ext_resource type="Texture2D" uid="uid://bnmlngwnibfnj" path="res://extracted/ref_map2.jpg" id="1_cdv75"] [ext_resource type="Texture2D" uid="uid://cypb81fuw4w44" path="res://textures/atlas/GroundExtensions_All_01_SPRT.png" id="3_54rqc"] @@ -8,6 +8,7 @@ [ext_resource type="Texture2D" uid="uid://dggavne4ueche" path="res://textures/sprites/Tree_Field_01_SPRT.png" id="5_lwnej"] [ext_resource type="Texture2D" uid="uid://chuv25pm2vqen" path="res://textures/atlas/Rocks_All_01_SPRT.png" id="7_pykf8"] [ext_resource type="Texture2D" uid="uid://b366mcexlko72" path="res://textures/atlas/LogsAndWood_All_01_SPRT.png" id="8_ugxkt"] +[ext_resource type="Script" path="res://core/stickernode.gd" id="9_ap7ts"] [sub_resource type="AtlasTexture" id="AtlasTexture_rckkj"] atlas = ExtResource("3_54rqc") @@ -33,12 +34,12 @@ size = Vector2(133.06, 62.73) atlas = ExtResource("8_ugxkt") region = Rect2(1600, 944, 104, 176) -[sub_resource type="RectangleShape2D" id="RectangleShape2D_djose"] -size = Vector2(154.335, 84.705) - [sub_resource type="RectangleShape2D" id="RectangleShape2D_enbs7"] size = Vector2(65.54, 94.235) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_djose"] +size = Vector2(154.335, 84.705) + [sub_resource type="AtlasTexture" id="AtlasTexture_ddtk8"] atlas = ExtResource("7_pykf8") region = Rect2(1440, 1376, 256, 256) @@ -57,40 +58,35 @@ size = Vector2(325.915, 124.47) z_as_relative = false y_sort_enabled = true -[node name="Map2" type="Sprite2D" parent="."] +[node name="Floor" type="Sprite2D" parent="."] z_index = -10 scale = Vector2(5.44506, 5.44506) texture = ExtResource("3_gbt28") metadata/_edit_lock_ = true -[node name="StaticBody2D" type="StaticBody2D" parent="Map2"] +[node name="StaticBody2D" type="StaticBody2D" parent="Floor"] -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Map2/StaticBody2D"] -visible = false +[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Floor/StaticBody2D"] position = Vector2(5.32593, -60.2381) build_mode = 1 -polygon = PackedVector2Array(-448, -432.5, -29.5759, -431.73, -29.5681, -475.661, 128.557, -481.354, 134.066, -431.429, 458, -430.833, 456.928, 275.846, 138.841, 274.193, 142.514, 319.372, 134.415, 336.571, -270.153, 338.472, -270.153, 270.888, -447.378, 269.786, -444.694, 85.548, -509.269, 86.1331, -512.758, -74.563, -445.734, -77.3378) +polygon = PackedVector2Array(-448, -432.5, -29.5759, -431.73, -29.5681, -475.661, 128.557, -481.354, 134.066, -431.429, 458, -430.833, 451.235, 453.255, -443.154, 454.357, -444.694, 85.548, -509.269, 86.1331, -512.758, -74.563, -445.734, -77.3378) -[node name="Dock" type="Sprite2D" parent="Map2"] +[node name="Dock" type="Sprite2D" parent="Floor"] position = Vector2(-80.2562, 4.59132) texture = SubResource("AtlasTexture_rckkj") -[node name="StaticBody2D" type="StaticBody2D" parent="Map2/Dock"] +[node name="StaticBody2D" type="StaticBody2D" parent="Floor/Dock"] -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Map2/Dock/StaticBody2D"] -position = Vector2(-4.95862, -0.550958) -polygon = PackedVector2Array(-183.469, 112.763, -180.347, 275.112, -175.205, 275.479, -177.592, 112.212) +[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Floor/Dock/StaticBody2D"] +polygon = PackedVector2Array(-27.3642, 105.6, -27.9152, 135.719, 220.751, 132.965, 225.158, 140.494, 224.791, 257.481, 219.465, 271.071, -183.653, 270.52, -186.926, 119.417, -187.142, 109.457, -181.082, 109.824, -178.143, 264.46, 217.628, 264.46, 218.179, 139.943, -31.221, 141.78, -31.7719, 105.049) -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Map2/Dock/StaticBody2D"] -polygon = PackedVector2Array(-27.3642, 105.6, -27.9152, 135.719, 217.628, 133.883, 223.505, 140.311, 224.791, 257.481, 230.668, 257.481, 227.362, 128.557, -24.9768, 130.577) - -[node name="Door1" type="Sprite2D" parent="Map2"] +[node name="Door1" type="Sprite2D" parent="Floor"] position = Vector2(-472.171, -51.0555) scale = Vector2(0.74059, 0.74059) texture = SubResource("AtlasTexture_7lxfk") flip_h = true -[node name="Door" parent="Map2" instance=ExtResource("4_yvr3q")] +[node name="Door" parent="Floor" instance=ExtResource("4_yvr3q")] position = Vector2(67.4006, -511.656) scale = Vector2(0.869617, 0.869617) texture = SubResource("AtlasTexture_a0jcl") @@ -153,16 +149,6 @@ centered = false offset = Vector2(-52.525, -167.375) metadata/tags = ["sticker"] -[node name="Area2D" type="Area2D" parent="Box1"] -collision_layer = 2 -collision_mask = 0 -monitoring = false - -[node name="StickerShape2D" type="CollisionShape2D" parent="Box1/Area2D"] -position = Vector2(0, -76.12) -rotation = 1.5708 -shape = SubResource("RectangleShape2D_djose") - [node name="StaticBody2D" type="StaticBody2D" parent="Box1"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Box1/StaticBody2D"] @@ -170,6 +156,18 @@ position = Vector2(0, -49.595) shape = SubResource("RectangleShape2D_enbs7") debug_color = Color(0.996033, 0, 0.194446, 0.42) +[node name="Sticker" type="Area2D" parent="Box1" node_paths=PackedStringArray("WorldSprite")] +collision_layer = 2 +collision_mask = 15 +script = ExtResource("9_ap7ts") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") + +[node name="StickerShape2D" type="CollisionShape2D" parent="Box1/Sticker"] +position = Vector2(0, -76.12) +rotation = 1.5708 +shape = SubResource("RectangleShape2D_djose") + [node name="Box2" type="Sprite2D" parent="."] position = Vector2(1437, -1275.32) scale = Vector2(5, 4.51) @@ -178,16 +176,6 @@ centered = false offset = Vector2(-54.04, -167.375) metadata/tags = ["sticker"] -[node name="Area2D" type="Area2D" parent="Box2"] -collision_layer = 2 -collision_mask = 0 -monitoring = false - -[node name="StickerShape2D" type="CollisionShape2D" parent="Box2/Area2D"] -position = Vector2(0, -76.12) -rotation = 1.5708 -shape = SubResource("RectangleShape2D_djose") - [node name="StaticBody2D" type="StaticBody2D" parent="Box2"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Box2/StaticBody2D"] @@ -195,6 +183,18 @@ position = Vector2(0, -49.595) shape = SubResource("RectangleShape2D_enbs7") debug_color = Color(0.996033, 0, 0.194446, 0.42) +[node name="Sticker" type="Area2D" parent="Box2" node_paths=PackedStringArray("WorldSprite")] +collision_layer = 2 +collision_mask = 15 +script = ExtResource("9_ap7ts") +WorldSprite = NodePath("..") +metadata/tags = PackedStringArray("sticker") + +[node name="StickerShape2D" type="CollisionShape2D" parent="Box2/Sticker"] +position = Vector2(0, -76.12) +rotation = 1.5708 +shape = SubResource("RectangleShape2D_djose") + [node name="Rock2" type="Sprite2D" parent="."] position = Vector2(1776, -705.32) scale = Vector2(5, 5.195) diff --git a/maps/mapManager.tscn b/maps/mapManager.tscn index de58576..2ac8b13 100644 --- a/maps/mapManager.tscn +++ b/maps/mapManager.tscn @@ -203,6 +203,7 @@ _data = { } [node name="MapManager" type="Node2D"] +y_sort_enabled = true script = ExtResource("1_p0vo1") InitialPlayer = ExtResource("2_fyjh8") InitialMap = ExtResource("2_qgqfi") @@ -218,12 +219,19 @@ libraries = { } [node name="Camera2D" type="Camera2D" parent="."] -zoom = Vector2(0.13, 0.13) +zoom = Vector2(0.09, 0.09) [node name="Background" parent="Camera2D" instance=ExtResource("4_81gsq")] Pattern = ExtResource("5_pl2si") PatternColor = Color(1, 1, 1, 0.490196) BGColor = Color(0.173374, 0.319037, 0.221103, 1) +[node name="OutOfBound" type="StaticBody2D" parent="."] +collision_layer = 32 +collision_mask = 2 + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="OutOfBound"] +polygon = PackedVector2Array(-2668, -2600, -2718, 2494, 2770, 2483, 2761, -2635, -6608, -2575, -6572, -3893, 6824, -4044, 6590, 3810, -6903, 3843, -6608, -2579) + [connection signal="ready" from="." to="." method="_on_ready"] [connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"] diff --git a/prefab/prefab_woddenbridge.tscn b/prefab/prefab_woddenbridge.tscn index a71b6b9..a653448 100644 --- a/prefab/prefab_woddenbridge.tscn +++ b/prefab/prefab_woddenbridge.tscn @@ -11,7 +11,6 @@ texture = SubResource("AtlasTexture_nkyhf") [node name="BridgeNode" parent="." instance=ExtResource("2_te8ug")] position = Vector2(1788, 788) -collision_layer = 2 [node name="PlayerDetection" type="CollisionPolygon2D" parent="BridgeNode"] position = Vector2(-623.92, 0) @@ -19,8 +18,7 @@ scale = Vector2(0.650499, 1) polygon = PackedVector2Array(-1875.9, -847.689, -1878.05, -681.225, -1699.64, -682.976, -1706.37, -847.689) [node name="StaticBody2D" type="StaticBody2D" parent="."] -collision_layer = 3 -input_pickable = true +collision_layer = 16 [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"] polygon = PackedVector2Array(-84.7196, -115.177, -83.3193, 112.026, -58.9886, 111.851, -59.1637, -113.951) diff --git a/project.godot b/project.godot index 416a23b..f488a1a 100644 --- a/project.godot +++ b/project.godot @@ -122,6 +122,10 @@ mouse_right={ 2d_physics/layer_1="Player" 2d_physics/layer_2="Stickers" +2d_physics/layer_3="Zone" +2d_physics/layer_4="PNJ" +2d_physics/layer_5="Wall" +2d_physics/layer_6="OutOfBound" [rendering] diff --git a/textures/sprites/plants_bush2.tres b/textures/sprites/plants_bush2.tres new file mode 100644 index 0000000..5b3d2d0 --- /dev/null +++ b/textures/sprites/plants_bush2.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://qsse8uwt06ns"] + +[ext_resource type="Texture2D" uid="uid://cun14l52f477p" path="res://textures/atlas/Bushes_All_01_SPRT.png" id="1_6o3oy"] + +[resource] +atlas = ExtResource("1_6o3oy") +region = Rect2(736, 96, 224, 160) diff --git a/textures/sprites/FireStickers.png b/textures/sprites/stickers_fire1.png similarity index 100% rename from textures/sprites/FireStickers.png rename to textures/sprites/stickers_fire1.png diff --git a/textures/sprites/FireStickers.png.import b/textures/sprites/stickers_fire1.png.import similarity index 70% rename from textures/sprites/FireStickers.png.import rename to textures/sprites/stickers_fire1.png.import index d5ef703..8cbe825 100644 --- a/textures/sprites/FireStickers.png.import +++ b/textures/sprites/stickers_fire1.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://xx3dwpwk467v" -path="res://.godot/imported/FireStickers.png-b1f6454cf2d8ec7c882729598eb9bead.ctex" +path="res://.godot/imported/stickers_fire1.png-e93a337294878aa37d22daa3b5a89519.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://textures/sprites/FireStickers.png" -dest_files=["res://.godot/imported/FireStickers.png-b1f6454cf2d8ec7c882729598eb9bead.ctex"] +source_file="res://textures/sprites/stickers_fire1.png" +dest_files=["res://.godot/imported/stickers_fire1.png-e93a337294878aa37d22daa3b5a89519.ctex"] [params]