Compare commits
6 commits
2da91253a7
...
66691e55a7
Author | SHA1 | Date | |
---|---|---|---|
66691e55a7 | |||
f2fff85d01 | |||
41715b56bb | |||
09b921e321 | |||
0f32cbf710 | |||
e51b395664 |
9 changed files with 126 additions and 125 deletions
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=23 format=3 uid="uid://0m1hk2nu4bps"]
|
||||
[gd_scene load_steps=24 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,6 +499,12 @@ node_connections = [&"output", 0, &"WalkRun"]
|
|||
[sub_resource type="CanvasTexture" id="CanvasTexture_2b3h6"]
|
||||
diffuse_texture = ExtResource("6_3ryww")
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_pxwyk"]
|
||||
resource_local_to_scene = true
|
||||
resource_name = "PlayerDetectionShape"
|
||||
radius = 153.77
|
||||
height = 570.87
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
collision_mask = 17
|
||||
motion_mode = 1
|
||||
|
@ -548,8 +554,8 @@ parameters/WalkRun/3/TimeScale/scale = 0.3
|
|||
position = Vector2(17, 0)
|
||||
|
||||
[node name="BootL" type="Sprite2D" parent="Skeleton2D"]
|
||||
position = Vector2(40.7995, -40.9482)
|
||||
rotation = -0.517457
|
||||
position = Vector2(41.9105, -40.9961)
|
||||
rotation = -0.525145
|
||||
scale = Vector2(1, 1)
|
||||
texture = ExtResource("2_w1l4c")
|
||||
region_enabled = true
|
||||
|
@ -557,16 +563,15 @@ region_rect = Rect2(896, 768, 128, 128)
|
|||
metadata/Type = "Skin"
|
||||
|
||||
[node name="BootR" type="Sprite2D" parent="Skeleton2D"]
|
||||
position = Vector2(-70.0154, -47.9395)
|
||||
rotation = 0.481493
|
||||
scale = Vector2(1, 1)
|
||||
position = Vector2(-70.9266, -47.9955)
|
||||
rotation = 0.491016
|
||||
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, -242.313)
|
||||
position = Vector2(51, -242.426)
|
||||
texture = ExtResource("2_w1l4c")
|
||||
offset = Vector2(-15, 0)
|
||||
region_enabled = true
|
||||
|
@ -590,7 +595,7 @@ metadata/Type = "Skin"
|
|||
|
||||
[node name="Tail" type="Sprite2D" parent="Skeleton2D/Body"]
|
||||
show_behind_parent = true
|
||||
position = Vector2(44, 112.313)
|
||||
position = Vector2(44, 112.426)
|
||||
rotation = 0.153589
|
||||
texture = ExtResource("2_w1l4c")
|
||||
offset = Vector2(70, 0)
|
||||
|
@ -599,9 +604,8 @@ region_rect = Rect2(768, 640, 256, 128)
|
|||
metadata/Type = "Skin"
|
||||
|
||||
[node name="Head" type="Sprite2D" parent="Skeleton2D"]
|
||||
position = Vector2(-40, -415.313)
|
||||
rotation = 0.000647508
|
||||
scale = Vector2(1, 1)
|
||||
position = Vector2(-40, -415.426)
|
||||
rotation = 4.5764e-05
|
||||
texture = ExtResource("2_w1l4c")
|
||||
offset = Vector2(0, -168)
|
||||
region_enabled = true
|
||||
|
@ -689,3 +693,11 @@ z_index = -1
|
|||
position = Vector2(42, -381)
|
||||
scale = Vector2(1.89731, 1.89731)
|
||||
texture = SubResource("CanvasTexture_2b3h6")
|
||||
|
||||
[node name="DetectionArea" type="Area2D" parent="."]
|
||||
position = Vector2(0, -290)
|
||||
collision_layer = 5
|
||||
collision_mask = 14
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectionArea"]
|
||||
shape = SubResource("CapsuleShape2D_pxwyk")
|
||||
|
|
|
@ -8,7 +8,12 @@ class_name Sticker extends Area2D
|
|||
## and for the sprites.
|
||||
|
||||
#region Exported variables
|
||||
@export var Sticker_mode:bool = false
|
||||
@export var Sticker_mode:bool = false:
|
||||
set(value):
|
||||
Sticker_mode = value
|
||||
## TODO: preview the sticker in editor
|
||||
if Engine.is_editor_hint():
|
||||
updateStickerMode(value)
|
||||
@export_group("Nodes")
|
||||
## The look of the object. If it's multiple sprites, they should be under one main sprite
|
||||
@export var WorldSprite:Sprite2D
|
||||
|
@ -19,6 +24,9 @@ class_name Sticker extends Area2D
|
|||
set(new_area):
|
||||
if(new_area != self):
|
||||
DetectionArea = new_area
|
||||
## Detection shapes all in green
|
||||
for _collisionsshapes in DetectionArea.get_children():
|
||||
_collisionsshapes.debug_color = Color(0, 0.637, 0.392, 0.42)
|
||||
else:
|
||||
printerr("DetectionArea cannot be the sticker itself")
|
||||
@export_group("Material")
|
||||
|
@ -46,6 +54,8 @@ func _get_configuration_warnings():
|
|||
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
|
||||
|
@ -98,9 +108,6 @@ 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=[]):
|
||||
|
@ -108,14 +115,16 @@ func on_released(_CastResult:Array=[]):
|
|||
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
|
||||
updateStickerMode(false)
|
||||
on_unhover() #security,but i don't like it
|
||||
get_parent().reparent(MapManager.current_scene.get_child(0))
|
||||
|
||||
|
||||
## Change all parameters based on the mode
|
||||
func updateStickerMode(stickerMode:bool):
|
||||
get_parent().top_level = stickerMode
|
||||
disable_ChildNodes_collisions(stickerMode)
|
||||
update_ChildNodes_visibilty(!stickerMode)
|
||||
Sticker_mode = stickerMode
|
||||
|
||||
func on_click():
|
||||
print(self," clicked")
|
||||
|
@ -147,12 +156,8 @@ func on_unhover():
|
|||
|
||||
|
||||
func on_grab(_offset:Vector2=Vector2(0.0,0.0)):
|
||||
Sticker_mode = true
|
||||
|
||||
get_parent().top_level = true
|
||||
updateStickerMode(true)
|
||||
get_parent().reparent(MapManager)
|
||||
update_ChildNodes_visibilty(false)
|
||||
disable_ChildNodes_collisions(true)
|
||||
Grabbed = true
|
||||
|
||||
func update_ChildNodes_visibilty(_visible:bool=true):
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
[gd_scene load_steps=30 format=3 uid="uid://wlqsvbqpcbh"]
|
||||
[gd_scene load_steps=29 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="PackedScene" uid="uid://bddcriwo55x8k" path="res://prefab/prefab_woddenbridge.tscn" id="4_okpsn"]
|
||||
|
@ -16,6 +15,7 @@
|
|||
[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="PackedScene" uid="uid://bc1quyxrmv706" path="res://prefab/prefab_tree1.tscn" id="11_8c4hp"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdurdoebbnau7" path="res://prefab/prefab_bush2.tscn" id="11_u6j5q"]
|
||||
[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"]
|
||||
|
@ -23,11 +23,6 @@
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yeof8"]
|
||||
size = Vector2(202.667, 60.3336)
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_dqo8w"]
|
||||
resource_name = "TreeShape"
|
||||
radius = 70.0
|
||||
height = 512.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4cdlc"]
|
||||
size = Vector2(133.06, 62.73)
|
||||
|
||||
|
@ -134,86 +129,17 @@ scale = Vector2(6.15, 6.15)
|
|||
[node name="Bush1" parent="." instance=ExtResource("8_tag7x")]
|
||||
position = Vector2(-2192, 1176)
|
||||
|
||||
[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="Tree5" parent="." instance=ExtResource("11_8c4hp")]
|
||||
position = Vector2(1560, 504)
|
||||
|
||||
[node name="Sticker" type="Area2D" parent="Tree2" node_paths=PackedStringArray("WorldSprite")]
|
||||
collision_layer = 2
|
||||
collision_mask = 61
|
||||
script = ExtResource("5_ek34p")
|
||||
WorldSprite = NodePath("..")
|
||||
metadata/tags = PackedStringArray("sticker")
|
||||
[node name="Tree9" parent="." instance=ExtResource("11_8c4hp")]
|
||||
position = Vector2(-2402, -62)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree2/Sticker"]
|
||||
position = Vector2(0, -253.27)
|
||||
rotation = 0.01
|
||||
shape = SubResource("CapsuleShape2D_dqo8w")
|
||||
[node name="Tree8" parent="." instance=ExtResource("11_8c4hp")]
|
||||
position = Vector2(2377, -2253)
|
||||
|
||||
[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="Sticker" type="Area2D" parent="Tree5" 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="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="Sticker" type="Area2D" parent="Tree4" 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="Tree4/Sticker"]
|
||||
position = Vector2(0, -253.27)
|
||||
rotation = 0.01
|
||||
shape = SubResource("CapsuleShape2D_dqo8w")
|
||||
[node name="Tree7" parent="." instance=ExtResource("11_8c4hp")]
|
||||
position = Vector2(-766, -2019)
|
||||
|
||||
[node name="Bush20" parent="." instance=ExtResource("11_u6j5q")]
|
||||
position = Vector2(-2169, -2169)
|
||||
|
@ -391,9 +317,5 @@ position = Vector2(2207, 2320)
|
|||
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="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="Rock1" to="Rock1" method="_on_property_list_changed"]
|
||||
[connection signal="property_list_changed" from="Rock2" to="Rock2" method="_on_property_list_changed"]
|
||||
|
|
|
@ -41,6 +41,6 @@ collision_mask = 61
|
|||
position = Vector2(0, -5.415)
|
||||
rotation = 1.5708
|
||||
shape = SubResource("CapsuleShape2D_ke631")
|
||||
debug_color = Color(1.29953e-06, 0.637445, 0.391979, 0.42)
|
||||
debug_color = Color(0, 0.637, 0.392, 0.42)
|
||||
|
||||
[connection signal="property_list_changed" from="." to="." method="_on_property_list_changed"]
|
||||
|
|
17
prefab/prefab_stickerparticles.tscn
Normal file
17
prefab/prefab_stickerparticles.tscn
Normal file
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://drdipqf4euv1h"]
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_emvuu"]
|
||||
lifetime_randomness = 0.5
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(8, 1, 1)
|
||||
direction = Vector3(0, 0, 0)
|
||||
gravity = Vector3(0, -15, 0)
|
||||
scale_max = 3.0
|
||||
|
||||
[node name="StickerParticle" type="GPUParticles2D"]
|
||||
top_level = true
|
||||
amount = 15
|
||||
process_material = SubResource("ParticleProcessMaterial_emvuu")
|
||||
lifetime = 1.6
|
||||
randomness = 1.0
|
44
prefab/prefab_tree1.tscn
Normal file
44
prefab/prefab_tree1.tscn
Normal file
|
@ -0,0 +1,44 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bc1quyxrmv706"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dggavne4ueche" path="res://textures/sprites/Tree_Field_01_SPRT.png" id="1_ks2yc"]
|
||||
[ext_resource type="Script" path="res://core/stickernode.gd" id="2_7fa8u"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_dqo8w"]
|
||||
resource_name = "TreeShape"
|
||||
radius = 70.0
|
||||
height = 512.0
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_o5egb"]
|
||||
radius = 21.8229
|
||||
height = 69.3515
|
||||
|
||||
[node name="Tree1" type="Sprite2D"]
|
||||
scale = Vector2(3.80334, 3.95089)
|
||||
texture = ExtResource("1_ks2yc")
|
||||
centered = false
|
||||
offset = Vector2(-251.145, -512)
|
||||
metadata/tags = ["sticker"]
|
||||
|
||||
[node name="Sticker" type="Area2D" parent="." node_paths=PackedStringArray("WorldSprite", "DetectionArea")]
|
||||
collision_layer = 2
|
||||
collision_mask = 61
|
||||
script = ExtResource("2_7fa8u")
|
||||
WorldSprite = NodePath("..")
|
||||
DetectionArea = NodePath("DetectionZone")
|
||||
metadata/tags = PackedStringArray("sticker")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sticker"]
|
||||
position = Vector2(0, -253.27)
|
||||
rotation = 0.01
|
||||
shape = SubResource("CapsuleShape2D_dqo8w")
|
||||
|
||||
[node name="DetectionZone" type="Area2D" parent="Sticker"]
|
||||
collision_layer = 4
|
||||
collision_mask = 61
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sticker/DetectionZone"]
|
||||
position = Vector2(0, -32.3978)
|
||||
shape = SubResource("CapsuleShape2D_o5egb")
|
||||
debug_color = Color(0, 0.637, 0.392, 0.42)
|
||||
|
||||
[connection signal="property_list_changed" from="." to="." method="_on_property_list_changed"]
|
|
@ -26,10 +26,12 @@ Cursor="*res://core/Cursor.tscn"
|
|||
|
||||
window/size/viewport_width=1920
|
||||
window/size/viewport_height=1080
|
||||
window/size/mode=2
|
||||
window/size/initial_position_type=2
|
||||
window/size/initial_screen=2
|
||||
window/size/extend_to_title=true
|
||||
window/stretch/mode="canvas_items"
|
||||
window/vsync/vsync_mode=0
|
||||
window/size/viewport_width.editor=1152
|
||||
window/size/viewport_height.editor=648
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://d311puikrpgel"]
|
||||
|
||||
[ext_resource type="Shader" path="res://shaders/shader_outline3.gdshader" id="1_4ciqw"]
|
||||
[ext_resource type="Shader" path="res://shaders/shader_outline3.gdshader" id="1_laeuv"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_4ciqw")
|
||||
shader = ExtResource("1_laeuv")
|
||||
shader_parameter/thickness = 10.0
|
||||
shader_parameter/ring_count = 40
|
||||
shader_parameter/ring_offset = 1.0
|
||||
shader_parameter/ring_count = 16
|
||||
shader_parameter/ring_offset = null
|
||||
shader_parameter/outline_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/border_clipping_fix = true
|
||||
shader_parameter/aspect_ratio = 1.0
|
||||
shader_parameter/square_border = false
|
||||
shader_parameter/offset = null
|
||||
shader_parameter/max_or_add = true
|
||||
shader_parameter/max_or_add = false
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://583rlv8jgawy"]
|
||||
|
||||
[ext_resource type="Shader" path="res://shaders/pageflip2.gdshader" id="1_1kmqt"]
|
||||
[ext_resource type="Shader" path="res://shaders/pageflipdddd.gdshader" id="1_u6jpi"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_1kmqt")
|
||||
shader_parameter/flip_param = 1.0
|
||||
shader_parameter/dim_color_scale = 0.4
|
||||
shader_parameter/x_buffer = 2.0
|
||||
shader_parameter/y_buffer = 2.0
|
||||
shader = ExtResource("1_u6jpi")
|
||||
shader_parameter/roll_param = 0.0
|
||||
shader_parameter/roll_radius = 0.105
|
||||
shader_parameter/roll_direction = Vector2(0.165, -0.065)
|
||||
|
|
Loading…
Reference in a new issue