Compare commits

...

31 commits

Author SHA1 Message Date
Lucas Peter
298e3a0875
Update to 4.4 2025-02-10 19:16:34 +01:00
Lucas Peter
2da91253a7 update working flip shader 2025-02-10 18:11:44 +00:00
5a8bf0c06f sticker flip shader
Need to add the outline shader
2025-02-10 18:11:44 +00:00
33f98692f8 update to 4.3 2024-08-26 10:59:34 +02:00
90f690198f fix a lot of map issues 2024-08-04 00:35:30 +02:00
753dd4456c Merge branch 'feature/sticker' into develop 2024-08-04 00:35:06 +02:00
57d6b3f607 wip:FX if released mode accessible 2024-08-04 00:32:50 +02:00
c91284051c fix sticker order 2024-08-03 23:09:14 +02:00
4cf3eb166a Fix Y sorting and filter by type 2024-08-03 22:42:28 +02:00
0be8633a7e sticker detection 2024-08-03 22:42:06 +02:00
Lucas Peter
64284f5c58
wip: Sticker area and zone detection made separate (maybe optional) 2024-08-02 17:26:19 +02:00
Lucas Peter
32811969ea
map manager handling stickers, not root 2024-08-01 12:31:54 +02:00
e7729da740
sticker land detection + sticker mode 2024-08-01 12:31:30 +02:00
a4c7e49438 update map1 2024-08-01 00:54:19 +02:00
4788045f44 fix visibility 2024-08-01 00:53:59 +02:00
Lucas Peter
a17a080a87
wip:game icon 2024-07-31 18:04:55 +02:00
Lucas Peter
300ed066fc
wip: fix map1 2024-07-31 18:04:34 +02:00
Lucas Peter
d3b3dcfea0
fix collision and hover issue 2024-07-31 18:04:21 +02:00
Lucas Peter
d520cd58b9
Merge branch 'feature/sticker' into develop
# Conflicts:
#	textures/sprites/props_fire1.tres
2024-07-31 12:23:20 +02:00
Lucas Peter
9bfdaf3d0b
misc editor settings
# Conflicts:
#	project.godot
#	textures/sprites/props_fire1.tres
2024-07-31 12:22:34 +02:00
Lucas Peter
209af3e7e7
delete old code 2024-07-31 12:21:29 +02:00
Lucas Peter
79a577272a
update sticker code
Rework code, make sticker a Area2D Node that handle all sticker logic
2024-07-31 12:21:17 +02:00
1a77fe1df6 fix map 2024-07-30 22:25:38 +02:00
Lucas Peter
462bc799c3
update code editor window size 2024-07-30 18:19:54 +02:00
Lucas Peter
25994d0b98
Update code and ref 2024-07-30 18:14:01 +02:00
Lucas Peter
f54aa28f8e
rework sticker
Now sticker works by being placed under any Node2D that serve as root/transform. Sticker node handle the visual aspect of the sticker.
This should be changed soon (view TODO)
2024-07-30 18:12:30 +02:00
Lucas Peter
4e658d2ff1
update stickers location 2024-07-30 18:12:11 +02:00
Lucas Peter
de2678f43d
global function update 2024-07-30 12:21:15 +02:00
Lucas Peter
750f138ee2
make cursor top level 2024-07-30 12:20:08 +02:00
Lucas Peter
ecdc0da046
change ressources handling (again) 2024-07-30 10:36:53 +02:00
Lucas Peter
e8a647c49f
fix null object 2024-07-30 10:14:56 +02:00
79 changed files with 1348 additions and 705 deletions

View file

@ -0,0 +1 @@
uid://df541g6d1m0h7

View file

@ -0,0 +1 @@
uid://vmuu35t03wbp

View file

@ -0,0 +1 @@
uid://dxfum2rfbgiyh

View file

@ -0,0 +1 @@
uid://cst7jwbhlxns6

View file

@ -0,0 +1 @@
uid://b87jrs2b80ppa

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://bie1xn8v1kd66"]
[ext_resource type="Script" path="res://addons/Todo_Manager/ColourPicker.gd" id="1"]
[ext_resource type="Script" uid="uid://df541g6d1m0h7" path="res://addons/Todo_Manager/ColourPicker.gd" id="1"]
[node name="TODOColour" type="HBoxContainer"]
offset_right = 105.0

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=6 format=3 uid="uid://b6k0dtftankcx"]
[ext_resource type="Script" path="res://addons/Todo_Manager/Dock.gd" id="1"]
[ext_resource type="Script" path="res://addons/Todo_Manager/Project.gd" id="2"]
[ext_resource type="Script" path="res://addons/Todo_Manager/Current.gd" id="3"]
[ext_resource type="Script" uid="uid://dxfum2rfbgiyh" path="res://addons/Todo_Manager/Dock.gd" id="1"]
[ext_resource type="Script" uid="uid://b87jrs2b80ppa" path="res://addons/Todo_Manager/Project.gd" id="2"]
[ext_resource type="Script" uid="uid://vmuu35t03wbp" path="res://addons/Todo_Manager/Current.gd" id="3"]
[sub_resource type="ButtonGroup" id="ButtonGroup_kqxcu"]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://bx11sel2q5wli"]
[ext_resource type="Script" path="res://addons/Todo_Manager/Pattern.gd" id="1"]
[ext_resource type="Script" uid="uid://cst7jwbhlxns6" path="res://addons/Todo_Manager/Pattern.gd" id="1"]
[node name="Pattern" type="HBoxContainer"]
script = ExtResource("1")

View file

@ -0,0 +1 @@
uid://dq747pn20mkv6

View file

@ -0,0 +1 @@
uid://56d5mb4w3y36

View file

@ -0,0 +1 @@
uid://bk2tdeyxoeofg

View file

@ -1,14 +1,14 @@
extends Node2D
var spaceState
var spaceState:World2D
var query : PhysicsPointQueryParameters2D
var CastResult : Array
var hoveredObjects : Array
var hoveredObject
var hoveredSticker
var grabbedSticker
var grabbedStickerOffset
var hoveredColliders : Array
var hoveredCollider:CollisionObject2D
var hoveredStickerNode:Sticker
var grabbedStickerNode:Sticker
var grabbedStickerOffset:Vector2
enum CURSOR_STATE {DEFAULT, CLICK, GRAB, GRABBED}
var currentCursorState:CURSOR_STATE = CURSOR_STATE.DEFAULT
@ -29,49 +29,41 @@ func _process(_delta):
#endregion
pointcast()
cursor_look()
if (grabbedSticker != null):
grabbedSticker.position = grabbedStickerOffset+get_global_mouse_position()
if (grabbedStickerNode != null):
grabbedStickerNode.get_parent().position = grabbedStickerOffset+get_global_mouse_position()
func isSticker(selectedObject:Node):
var _isSticker:bool = false
var _tags = Global.getTags(selectedObject)
if (_tags.size() > 0):
if (_tags.find("sticker") != -1):
_isSticker = true
return _isSticker
func pointcast():
resetCast()
query.collide_with_areas = true
query.collide_with_bodies = false
query.position = get_global_mouse_position()
CastResult = spaceState.direct_space_state.intersect_point(query)
# CastResult is not reliable. Objects are added randomly in the array
# so we need to filter/sort the trace result
if ( CastResult.size() > 0 and (grabbedSticker == null)):
if ( CastResult.size() > 0 and (grabbedStickerNode == null)):
#region Fill HoveredObjects
#region Fill hoveredColliders
for _object in CastResult:
if(_object.collider.input_pickable == true):
hoveredObjects.append(_object.collider.get_parent())
hoveredColliders.append(_object.collider)
#endregion
if (hoveredObjects.size() > 0):
if (hoveredObjects.size() >= 2):
sortByPosY(hoveredObjects,false)
if (hoveredObjects[0] != hoveredObject):
if (hoveredColliders.size() > 0):
if (hoveredColliders.size() >= 2):
hoveredColliders = sortByPosY(hoveredColliders,false)
if (hoveredColliders[0] != hoveredCollider):
$GrabTimer.stop()
if (hoveredObject and hoveredObject.has_method("on_unhover")):
hoveredObject.on_unhover()
hoveredObject = hoveredObjects[0]
if (hoveredObject and hoveredObject.has_method("on_hover")):
hoveredObject.on_hover()
print("Current hovered object :", hoveredObject)
if (isSticker(hoveredObject)):
hoveredSticker = hoveredObject
print("Current hovered sticker :", hoveredSticker)
if (hoveredCollider and hoveredCollider.has_method("on_unhover")):
hoveredCollider.on_unhover()
hoveredCollider = hoveredColliders[0]
if (hoveredCollider and hoveredCollider.has_method("on_hover")):
hoveredCollider.on_hover()
print("Current hovered object :", hoveredCollider)
if (Global.isSticker(hoveredCollider)):
hoveredStickerNode = hoveredCollider
print("Current hovered sticker :", hoveredStickerNode)
else:
hoveredSticker = null
hoveredStickerNode = null
else:
resetCast(true)
else:
@ -79,26 +71,37 @@ func pointcast():
func resetCast(bFull = false):
CastResult.clear()
hoveredObjects.clear()
hoveredColliders.clear()
if bFull:
if (hoveredObject != null and hoveredObject.has_method("on_unhover")):
hoveredObject.on_unhover()
hoveredObject = null
hoveredSticker = null
if (hoveredCollider != null and hoveredCollider.has_method("on_unhover") and (hoveredCollider != grabbedStickerNode)):
hoveredCollider.on_unhover()
hoveredCollider = null
hoveredStickerNode = null
## 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.position.y < b.position.y
return a.get_parent().position.y < b.get_parent().position.y #Sticker are always at 0, so we need parent position
func _input(rawInputEvent:InputEvent):
@ -107,37 +110,39 @@ func _input(rawInputEvent:InputEvent):
$GrabTimer.start()
if (rawInputEvent.is_action_released("select")):
$GrabTimer.stop()
if (grabbedSticker != null):
if (grabbedStickerNode != null):
grab_end()
func grab_start():
if (hoveredSticker and grabbedSticker == null):
grabbedSticker = hoveredSticker
if (hoveredStickerNode and grabbedStickerNode == null):
grabbedStickerNode = hoveredStickerNode
print("Grabbed ", grabbedSticker)
grabbedStickerOffset = grabbedSticker.position - get_global_mouse_position()
print("offset =", grabbedStickerOffset, " Stickpos:",grabbedSticker.position,"-",get_global_mouse_position() )
if (grabbedSticker.has_method("on_grab")):
grabbedSticker.on_grab(grabbedStickerOffset)
print("Grabbed ", grabbedStickerNode)
grabbedStickerOffset = grabbedStickerNode.get_parent().position - get_global_mouse_position()
print("offset =", grabbedStickerOffset, " Stickpos:",grabbedStickerNode.get_parent().position,"-",get_global_mouse_position() )
if (grabbedStickerNode.has_method("on_grab")):
grabbedStickerNode.on_grab(grabbedStickerOffset)
func grab_end():
grabbedSticker.on_released()
if (grabbedStickerNode.has_method("on_released")):
grabbedStickerNode.on_unhover()
grabbedStickerNode.on_released()
print("stopg grabbin at ",query.position )
DebugDraw.points.append(query.position)
DebugDraw.drawPoints()
#TODO: Drop the sticker or maybe he will auto-drop ?
grabbedSticker = null
grabbedStickerNode = null
func cursorClick():
if (hoveredObject and hoveredObject.has_method("on_click")):
hoveredObject.on_click()
if (hoveredCollider and hoveredCollider.has_method("on_click")):
hoveredCollider.on_click()
func cursor_look():
if (grabbedSticker ):
if (grabbedStickerNode ):
currentCursorState = CURSOR_STATE.GRABBED
elif (hoveredSticker):
elif (hoveredStickerNode):
if ($GrabTimer and !($GrabTimer.is_stopped())):
currentCursorState = CURSOR_STATE.GRABBED
else:

1
core/Cursor.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://0wbh0tf7pnti

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=8 format=3 uid="uid://524sv8spw6go"]
[ext_resource type="Texture2D" uid="uid://q1rdbr8uh78r" path="res://textures/cursor_default.tres" id="1_50ts1"]
[ext_resource type="Script" path="res://core/Cursor.gd" id="1_b5uuj"]
[ext_resource type="Script" uid="uid://0wbh0tf7pnti" path="res://core/Cursor.gd" id="1_b5uuj"]
[ext_resource type="Texture2D" uid="uid://bdstohvc7pvot" path="res://textures/cursor_click.tres" id="1_h0do2"]
[ext_resource type="Texture2D" uid="uid://buxws7r3kn0d7" path="res://textures/cursor_grab_01.tres" id="3_fj3w4"]
[ext_resource type="Texture2D" uid="uid://pbahcjllgjjq" path="res://textures/cursor_grab_02.tres" id="4_153q8"]
@ -51,6 +51,7 @@ animations = [{
[node name="Cursor" type="Node2D"]
top_level = true
z_index = 100
script = ExtResource("1_b5uuj")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
@ -60,7 +61,7 @@ centered = false
offset = Vector2(-80, -190)
[node name="GrabTimer" type="Timer" parent="."]
wait_time = 0.5
wait_time = 0.3
one_shot = true
[connection signal="animation_changed" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_changed"]

View file

@ -3,24 +3,26 @@ extends Sprite2D
@export_group("Travel settings")
@export_file("*.tscn") var NextScene:String
@export_enum("LEFT","RIGHT","UP","DOWN") var Travel :int
@export var Spawn_Position:Vector2 = Vector2(0,0
)
var NextSceneLoaded
@export var Spawn_Position:Vector2 = Vector2(0,0) #TODO: Extrapoler la position suivante en fonction de l'enum Travel
var NextSceneLoaded:Resource
func _on_area_2d_area_entered(area):
if(area):
if(MapManager and MapManager.player == area.get_parent() and (MapManager.player.Traveling == false) ):
MapManager.player.Traveling = true
print("enter door",area)
NextSceneLoaded = load(NextScene)
if (NextSceneLoaded != null):
MapManager.transition_to_scene(NextSceneLoaded,Spawn_Position,Travel)
else:
printerr("error loading ",NextScene)
if not NextScene.is_empty():
NextSceneLoaded = load(NextScene)
if (NextSceneLoaded != null):
MapManager.transition_to_scene(NextSceneLoaded,Spawn_Position,Travel)
else:
printerr("error loading ",NextScene)
func _ready():
NextSceneLoaded = load(NextScene)
print(NextSceneLoaded)
if not NextScene.is_empty():
NextSceneLoaded = load(NextScene)
print(NextSceneLoaded)

1
core/Door.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://cw8e21uwdhung

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://do65rgg0p2plt"]
[ext_resource type="Texture2D" uid="uid://cxharyv0ajr37" path="res://textures/atlas/DioramaEntrance_All_01_SPRT.png" id="1_4vclu"]
[ext_resource type="Script" path="res://core/Door.gd" id="2_8a3ug"]
[ext_resource type="Script" uid="uid://cw8e21uwdhung" path="res://core/Door.gd" id="2_8a3ug"]
[sub_resource type="AtlasTexture" id="AtlasTexture_wi524"]
atlas = ExtResource("1_4vclu")
@ -17,6 +17,7 @@ flip_h = true
script = ExtResource("2_8a3ug")
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 4
input_pickable = false
monitorable = false

View file

@ -1,23 +0,0 @@
extends Node
# 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_area_2d_mouse_entered():
pass # Replace with function body.
func _on_area_2d_mouse_exited():
pass # Replace with function body.
func _on_tree_entered():
pass # Replace with function body.

View file

@ -1,30 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://kbso0l2uk2n7"]
[sub_resource type="GDScript" id="GDScript_4kxk0"]
script/source = "extends Area2D
# 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_mouse_entered():
pass # Replace with function body.
func _on_mouse_exited():
pass # Replace with function body.
"
[node name="StickerDetection" type="Area2D"]
monitoring = false
script = SubResource("GDScript_4kxk0")
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]

View file

@ -1,38 +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" uid="uid://c3fo67161sh1i" path="res://core/bridgenode.tres.gd" id="1_tp7pv"]
var wallObject : 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\" ):
for _object in wallObject:
_object.process_mode = Node.PROCESS_MODE_DISABLED
else:
wallObject.append(object)
func _on_body_exited(object):
if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" ):
for _object in wallObject:
_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")

31
core/bridgenode.tres.gd Normal file
View file

@ -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

View file

@ -0,0 +1 @@
uid://c3fo67161sh1i

View file

@ -1,3 +1,4 @@
@tool
extends Node
@ -10,8 +11,8 @@ func _ready():
func _process(_delta):
pass
func getTags(selectedObject:Node):
var _tags: Array
func get_tags(selectedObject:Node):
var _tags: PackedStringArray
if (selectedObject.has_meta("tags")):
_tags = selectedObject.get_meta("tags")
return _tags
@ -19,3 +20,38 @@ func getTags(selectedObject:Node):
printerr("no tags inside %",selectedObject)
return _tags
## Add tag on selected object by adding metadata
func add_tag(selectedObject:Node,tag:String):
var _all_tags:PackedStringArray
if (selectedObject.has_meta("tags")):
_all_tags = selectedObject.get_meta("tags")
if (_all_tags.find(tag) == -1):
_all_tags.append(tag)
else:
_all_tags.append(tag)
selectedObject.set_meta("tags",_all_tags)
func add_tags(selectedObject:Node,tags:PackedStringArray):
var _all_tags:PackedStringArray
if (selectedObject.has_meta("tags")):
_all_tags = selectedObject.get_meta("tags")
_all_tags.append_array(tags)
selectedObject.set_meta("tags",_all_tags)
func remove_tags(selectedObject:Node,tags:PackedStringArray):
if (selectedObject.has_meta("tags")):
var _all_tags:PackedStringArray
_all_tags = selectedObject.get_meta("tags")
for _tag:String in tags:
if(_all_tags.find(_tag) !=-1):
_all_tags.remove_at(_all_tags.find(_tag))
selectedObject.set_meta("tags",_all_tags)
func isSticker(selectedObject:Node):
var _isSticker:bool = false
var _tags = get_tags(selectedObject)
if (_tags.size() > 0):
if (_tags.find("sticker") != -1):
_isSticker = true
return _isSticker

1
core/global.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://mevrsieqsgtn

View file

@ -26,6 +26,7 @@ func changeSkin(NewSkin:CanvasTexture,_NewHat:CanvasTexture = null):
Sprite.texture = CurrentHat
func get_input():
#TODO: Need to freeze the player while he is traveling
var directionX = Input.get_axis("move_left", "move_right")
var directionY = Input.get_axis("move_up", "move_down")
var mouseDirectionX = Input.get_axis("mouse_left", "mouse_right")

1
core/player.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://xdgkpnyfumni

View file

@ -1,6 +1,6 @@
[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="Script" uid="uid://xdgkpnyfumni" path="res://core/player.gd" id="1_whhfc"]
[ext_resource type="Texture2D" uid="uid://5pmqr3y62guu" path="res://textures/player/currentCloth.tres" id="2_w1l4c"]
[ext_resource type="Texture2D" uid="uid://5qixrbrclydr" path="res://textures/player/currentHat.tres" id="3_ybl0v"]
[ext_resource type="Animation" uid="uid://bd0mi2x4pkf70" path="res://animations/player/Walk.res" id="4_56ghs"]
@ -437,9 +437,9 @@ tracks/37/keys = {
[sub_resource type="AnimationLibrary" id="AnimationLibrary_4k813"]
_data = {
"RESET": SubResource("Animation_oktsg"),
"Walk": ExtResource("4_56ghs"),
"idle": ExtResource("5_uweie")
&"RESET": SubResource("Animation_oktsg"),
&"Walk": ExtResource("4_56ghs"),
&"idle": ExtResource("5_uweie")
}
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_paj7q"]
@ -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")

View file

@ -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):
@ -24,7 +31,7 @@ func transition_to_scene(new_scene: PackedScene, spawn_location: Vector2, spawn_
else:
next_scene.add_child(new_scene.instantiate())
#region Anim Map
if (next_scene.get_child(0) != null):
if (next_scene.get_child_count() > 0 and next_scene.get_child(0) != null):
match spawn_direction:
0:
$AnimationPlayer.play("travel_left",-1,1)
@ -61,13 +68,12 @@ func on_travel_end():
player.Traveling = false
print("end travel")
func _on_animation_player_animation_finished(anim_name):
func _on_animation_player_animation_finished(_anim_name):
print("anim finished")
current_scene.get_child(0).queue_free()
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"))
get_tree().create_timer(1).connect("timeout",Callable(self,"on_travel_end"))

View file

@ -0,0 +1 @@
uid://ca64tp2asqllb

168
core/stickernode.gd Normal file
View file

@ -0,0 +1,168 @@
@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
## Emitted when the sticker overlap a blocking body, preventing to be spawned as an asset in the level. Usually received by the cursor to change his sprite
signal spawn_mode_changed(can_spawn:bool)
#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)
spawn_mode_changed.emit(false)
func _on_body_exited(body:Node2D):
print("body exited",body)
detected_solids.erase(body)
if(Sticker_mode and Grabbed and detected_solids.size() == 0 ):
spawn_mode_changed.emit(true)
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

1
core/stickernode.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://b6blosn6modfc

View file

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://cww6s8uqhlws1"]
[ext_resource type="Material" uid="uid://583rlv8jgawy" path="res://shaders/shaderMaterial_flip.tres" id="1_k0ogt"]
[ext_resource type="Texture2D" uid="uid://dggavne4ueche" path="res://textures/sprites/Tree_Field_01_SPRT.png" id="2_gtigr"]
[node name="Node2D" type="Node2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
material = ExtResource("1_k0ogt")
position = Vector2(-8261, 513)
scale = Vector2(71.2109, 48.0078)
texture = ExtResource("2_gtigr")

View file

@ -5,7 +5,8 @@ platform="Windows Desktop"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
export_filter="resources"
export_files=PackedStringArray("res://animations/player/idle.res", "res://animations/player/Walk.res", "res://core/Background.tscn", "res://core/bridgeNode.tscn", "res://core/Cursor.gd", "res://core/Cursor.tscn", "res://core/debugDraw.tscn", "res://core/Door.gd", "res://core/Door.tscn", "res://core/global.gd", "res://core/player.gd", "res://core/player.tscn", "res://core/sceneInstance.gd", "res://core/Sticker.gd", "res://core/Sticker.tscn", "res://maps/gym.tscn", "res://maps/mainMenu.tscn", "res://maps/map1.tres", "res://maps/map1.tscn", "res://maps/map2.tres", "res://maps/map2.tscn", "res://maps/mapManager.tscn", "res://prefab/free_sticker.tscn", "res://prefab/prefab_woddenbridge.tscn", "res://prefab/solid_sticker.tscn", "res://shaders/shaderMaterial_Outline.tres", "res://shaders/shaders_glitch.gdshader", "res://shaders/shader_color_replacer.gdshader", "res://shaders/shader_outline2.gdshader", "res://shaders/shader_outline3.gdshader", "res://shaders/shader_outline.gdshader", "res://textures/atlas/Atlas_Buildings_01.png", "res://textures/atlas/Atlas_Builds_01.png", "res://textures/atlas/Atlas_Builds_02.png", "res://textures/atlas/Atlas_New_items.png", "res://textures/atlas/Bushes_All_01_SPRT.png", "res://textures/atlas/DioramaEntrance_All_01_SPRT.png", "res://textures/atlas/Floors_01_SPRT.png", "res://textures/atlas/Floors_02_SPRT.png", "res://textures/atlas/Floors_03_SPRT.png", "res://textures/atlas/Floors_04_SPRT.png", "res://textures/atlas/Floors_05_SPRT.png", "res://textures/atlas/Floors_06_SPRT.png", "res://textures/atlas/Floors_07_SPRT.png", "res://textures/atlas/Floors_08_SPRT.png", "res://textures/atlas/Floors_09_SPRT.png", "res://textures/atlas/Floors_10_SPRT.png", "res://textures/atlas/Floors_11_SPRT.png", "res://textures/atlas/Floors_12_SPRT.png", "res://textures/atlas/Floors_13_SPRT.png", "res://textures/atlas/Floors_14_SPRT.png", "res://textures/atlas/Floors_15_SPRT.png", "res://textures/atlas/Floors_MountBack_SPRT.png", "res://textures/atlas/GroundExtensions_All_01_SPRT.png", "res://textures/atlas/LogsAndWood_All_01_SPRT.png", "res://textures/atlas/Plants_All_01_SPRT.png", "res://textures/atlas/Props_All_01_SPRT.png", "res://textures/atlas/Rocks_All_01_SPRT.png", "res://textures/atlas/SPRT_Hand.png", "res://textures/pattern/Pattern_Desert.png", "res://textures/pattern/Pattern_Forest.png", "res://textures/pattern/Pattern_Mountains.png", "res://textures/pattern/Pattern_swamp.png", "res://textures/player/archer.png", "res://textures/player/currentCloth.tres", "res://textures/player/currentHat.tres", "res://textures/player/hat-layout.jpg", "res://textures/player/hermandad-beige.png", "res://textures/player/hermandad-black.png", "res://textures/player/hermandad-brown.png", "res://textures/player/player-layout.jpg", "res://textures/player/playerSkin_ref.png", "res://textures/player/witch.png", "res://textures/2d_lights_and_shadows_neutral_point_light.webp", "res://textures/cursor_click.tres", "res://textures/cursor_default.tres", "res://textures/cursor_grab.tres", "res://textures/cursor_grab_01.tres", "res://textures/cursor_grab_02.tres", "res://textures/cursor_grab_03.tres", "res://icon.svg")
include_filter=""
exclude_filter=""
export_path="builds/stickerClone.exe"
@ -68,7 +69,8 @@ platform="Linux/X11"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
export_filter="resources"
export_files=PackedStringArray("res://animations/player/idle.res", "res://animations/player/Walk.res", "res://core/Background.tscn", "res://core/bridgeNode.tscn", "res://core/Cursor.gd", "res://core/Cursor.tscn", "res://core/debugDraw.tscn", "res://core/Door.gd", "res://core/Door.tscn", "res://core/global.gd", "res://core/player.gd", "res://core/player.tscn", "res://core/sceneInstance.gd", "res://core/Sticker.gd", "res://core/Sticker.tscn", "res://maps/gym.tscn", "res://maps/mainMenu.tscn", "res://maps/map1.tres", "res://maps/map1.tscn", "res://maps/map2.tres", "res://maps/map2.tscn", "res://maps/mapManager.tscn", "res://prefab/free_sticker.tscn", "res://prefab/prefab_woddenbridge.tscn", "res://prefab/solid_sticker.tscn", "res://shaders/shaderMaterial_Outline.tres", "res://shaders/shaders_glitch.gdshader", "res://shaders/shader_color_replacer.gdshader", "res://shaders/shader_outline2.gdshader", "res://shaders/shader_outline3.gdshader", "res://shaders/shader_outline.gdshader", "res://textures/atlas/Atlas_Buildings_01.png", "res://textures/atlas/Atlas_Builds_01.png", "res://textures/atlas/Atlas_Builds_02.png", "res://textures/atlas/Atlas_New_items.png", "res://textures/atlas/Bushes_All_01_SPRT.png", "res://textures/atlas/DioramaEntrance_All_01_SPRT.png", "res://textures/atlas/Floors_01_SPRT.png", "res://textures/atlas/Floors_02_SPRT.png", "res://textures/atlas/Floors_03_SPRT.png", "res://textures/atlas/Floors_04_SPRT.png", "res://textures/atlas/Floors_05_SPRT.png", "res://textures/atlas/Floors_06_SPRT.png", "res://textures/atlas/Floors_07_SPRT.png", "res://textures/atlas/Floors_08_SPRT.png", "res://textures/atlas/Floors_09_SPRT.png", "res://textures/atlas/Floors_10_SPRT.png", "res://textures/atlas/Floors_11_SPRT.png", "res://textures/atlas/Floors_12_SPRT.png", "res://textures/atlas/Floors_13_SPRT.png", "res://textures/atlas/Floors_14_SPRT.png", "res://textures/atlas/Floors_15_SPRT.png", "res://textures/atlas/Floors_MountBack_SPRT.png", "res://textures/atlas/GroundExtensions_All_01_SPRT.png", "res://textures/atlas/LogsAndWood_All_01_SPRT.png", "res://textures/atlas/Plants_All_01_SPRT.png", "res://textures/atlas/Props_All_01_SPRT.png", "res://textures/atlas/Rocks_All_01_SPRT.png", "res://textures/atlas/SPRT_Hand.png", "res://textures/pattern/Pattern_Desert.png", "res://textures/pattern/Pattern_Forest.png", "res://textures/pattern/Pattern_Mountains.png", "res://textures/pattern/Pattern_swamp.png", "res://textures/player/archer.png", "res://textures/player/currentCloth.tres", "res://textures/player/currentHat.tres", "res://textures/player/hat-layout.jpg", "res://textures/player/hermandad-beige.png", "res://textures/player/hermandad-black.png", "res://textures/player/hermandad-brown.png", "res://textures/player/player-layout.jpg", "res://textures/player/playerSkin_ref.png", "res://textures/player/witch.png", "res://textures/2d_lights_and_shadows_neutral_point_light.webp", "res://textures/cursor_click.tres", "res://textures/cursor_default.tres", "res://textures/cursor_grab.tres", "res://textures/cursor_grab_01.tres", "res://textures/cursor_grab_02.tres", "res://textures/cursor_grab_03.tres", "res://icon.svg")
include_filter=""
exclude_filter=""
export_path="builds/StickerClone.x86_64"

View file

@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/Bangers.ttf-4f11207bb3b9f35b34fda7975f1924fb.
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
@ -22,6 +23,7 @@ allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]

View file

@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/Oswald-Bold.ttf-79f2e9d28b36fff7a79ee35d9b486
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
@ -22,6 +23,7 @@ allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]

View file

@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/PerfectDOSVGA437.ttf-71796ab40d4e073302c462ce
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
@ -22,6 +23,7 @@ allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]

View file

@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/ShortStack-Regular.ttf-b8f792f00bec9790ac69e5
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
@ -22,6 +23,7 @@ allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]

View file

@ -1,8 +1,9 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cacwy4tka88k1"]
[ext_resource type="Texture2D" uid="uid://bk87x1lpjog5j" path="res://textures/atlas/Floors_05_SPRT.png" id="1_vellv"]
[ext_resource type="Texture2D" uid="uid://bk87x1lpjog5j" path="res://textures/atlas/Floors_05_SPRT.png" id="1_gaubw"]
[resource]
atlas = ExtResource("1_vellv")
resource_name = "map1"
atlas = ExtResource("1_gaubw")
region = Rect2(0, 0, 1024, 992)
filter_clip = true

View file

@ -1,76 +1,44 @@
[gd_scene load_steps=33 format=3 uid="uid://wlqsvbqpcbh"]
[gd_scene load_steps=30 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://cxharyv0ajr37" path="res://textures/atlas/DioramaEntrance_All_01_SPRT.png" id="2_n7y5f"]
[ext_resource type="Texture2D" uid="uid://c5bd2ta3esnib" path="res://extracted/4010-A Tiny Sticker Tale review pic 1.jpg" id="3_yh2wy"]
[ext_resource type="Texture2D" uid="uid://bm2nsrfle5nsd" path="res://textures/sprites/floor_door_grass_right1.tres" id="2_0jvyl"]
[ext_resource type="Script" uid="uid://cw8e21uwdhung" 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"]
[ext_resource type="Texture2D" uid="uid://cun14l52f477p" path="res://textures/atlas/Bushes_All_01_SPRT.png" id="5_xmosd"]
[ext_resource type="PackedScene" uid="uid://domcpxdf6lqpb" path="res://prefab/free_sticker.tscn" id="6_3fkbm"]
[ext_resource type="Texture2D" uid="uid://dggavne4ueche" path="res://extracted/Texture2D/Tree_Field_01_SPRT.png" id="7_gygvy"]
[ext_resource type="Texture2D" uid="uid://chuv25pm2vqen" path="res://textures/atlas/Rocks_All_01_SPRT.png" id="8_itp05"]
[ext_resource type="PackedScene" uid="uid://6ww1g2enfdx3" path="res://prefab/solid_sticker.tscn" id="9_nxjul"]
[ext_resource type="Texture2D" uid="uid://b366mcexlko72" path="res://textures/atlas/LogsAndWood_All_01_SPRT.png" id="10_jr64r"]
[ext_resource type="Texture2D" uid="uid://bwcex0o7obtg5" path="res://textures/atlas/Props_All_01_SPRT.png" id="11_0efxk"]
[ext_resource type="Texture2D" uid="uid://ciyh3rnoo4uk" path="res://extracted/Texture2D/SimpleParticles_All_01_SPRT.png" id="12_ro7fd"]
[ext_resource type="Texture2D" uid="uid://dcgjlblm2rpy4" path="res://textures/2d_lights_and_shadows_neutral_point_light.webp" id="13_sm1ou"]
[ext_resource type="Script" uid="uid://b6blosn6modfc" 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="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="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"]
[sub_resource type="AtlasTexture" id="AtlasTexture_gnudx"]
atlas = ExtResource("2_n7y5f")
region = Rect2(252, 16, 108, 256)
[sub_resource type="AtlasTexture" id="AtlasTexture_ex6vq"]
atlas = ExtResource("2_n7y5f")
region = Rect2(0, 16, 228, 80)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_lfx7b"]
radius = 80.0
height = 254.0
[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="AtlasTexture" id="AtlasTexture_rn40i"]
atlas = ExtResource("5_xmosd")
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"]
atlas = ExtResource("8_itp05")
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"]
atlas = ExtResource("8_itp05")
region = Rect2(1440, 1376, 256, 256)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bkpsv"]
radius = 115.4
height = 230.8
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hk5e3"]
size = Vector2(201.89, 146.45)
[sub_resource type="AtlasTexture" id="AtlasTexture_w86nr"]
atlas = ExtResource("10_jr64r")
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"]
atlas = ExtResource("10_jr64r")
region = Rect2(1356, 1216, 192, 80)
[sub_resource type="AtlasTexture" id="AtlasTexture_2qdgk"]
atlas = ExtResource("11_0efxk")
region = Rect2(1824, 480, 192, 160)
[sub_resource type="CircleShape2D" id="CircleShape2D_8byel"]
radius = 54.91
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jw3i8"]
lifetime_randomness = 0.2
@ -83,17 +51,21 @@ angle_max = 12.5
gravity = Vector3(0, -20, 0)
[sub_resource type="AtlasTexture" id="AtlasTexture_c24s7"]
atlas = ExtResource("12_ro7fd")
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
[node name="Map1" type="Node2D"]
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)
@ -101,39 +73,53 @@ 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"]
collision_layer = 4
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
@ -144,109 +130,128 @@ visible = false
top_level = true
position = Vector2(78, -148)
scale = Vector2(6.15, 6.15)
texture = ExtResource("3_yh2wy")
[node name="Bush1" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(-2161, 1140)
Shape = SubResource("CapsuleShape2D_lfx7b")
Rotation = 1.6
[node name="Bush1" parent="." instance=ExtResource("8_tag7x")]
position = Vector2(-2192, 1176)
[node name="Tree1" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(1592, 606)
texture = ExtResource("7_gygvy")
offset = Vector2(-251.145, -512)
Shape = SubResource("CapsuleShape2D_dqo8w")
Position = Vector2(0, -253.27)
Rotation = 0.01
[node name="Tree2" parent="." instance=ExtResource("6_3fkbm")]
[node name="Tree2" type="Sprite2D" parent="."]
position = Vector2(-2399, -55)
texture = ExtResource("7_gygvy")
scale = Vector2(3.80334, 3.95089)
texture = ExtResource("4_74dki")
centered = false
offset = Vector2(-251.145, -512)
Shape = SubResource("CapsuleShape2D_dqo8w")
Position = Vector2(0, -253.27)
Rotation = 0.01
metadata/tags = ["sticker"]
[node name="Tree3" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(-763, -2021)
texture = ExtResource("7_gygvy")
[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="CollisionShape2D" type="CollisionShape2D" parent="Tree2/Sticker"]
position = Vector2(0, -253.27)
rotation = 0.01
shape = SubResource("CapsuleShape2D_dqo8w")
[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)
Shape = SubResource("CapsuleShape2D_dqo8w")
Position = Vector2(0, -253.27)
Rotation = 0.01
metadata/tags = ["sticker"]
[node name="Tree4" parent="." instance=ExtResource("6_3fkbm")]
[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)
texture = ExtResource("7_gygvy")
scale = Vector2(3.80334, 3.95089)
texture = ExtResource("4_74dki")
centered = false
offset = Vector2(-251.145, -512)
Shape = SubResource("CapsuleShape2D_dqo8w")
Position = Vector2(0, -253.27)
Rotation = 0.01
metadata/tags = ["sticker"]
[node name="Bush6" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(-1556, 293)
Shape = SubResource("CapsuleShape2D_lfx7b")
Rotation = 1.6
[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="Bush7" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(712, 293)
Shape = SubResource("CapsuleShape2D_lfx7b")
Rotation = 1.6
[node name="CollisionShape2D" type="CollisionShape2D" parent="Tree4/Sticker"]
position = Vector2(0, -253.27)
rotation = 0.01
shape = SubResource("CapsuleShape2D_dqo8w")
[node name="Bush9" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(1004, -2257)
Shape = SubResource("CapsuleShape2D_lfx7b")
Rotation = 1.6
[node name="Bush20" parent="." instance=ExtResource("11_u6j5q")]
position = Vector2(-2169, -2169)
[node name="Bush8" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(-1616, -1651)
offset = Vector2(-137.285, -179.785)
flip_h = true
Shape = SubResource("CapsuleShape2D_lfx7b")
Rotation = 1.6
[node name="Bush10" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(-2063, -2116)
texture = SubResource("AtlasTexture_rn40i")
offset = Vector2(-108.615, -141.38)
flip_h = true
Shape = SubResource("CapsuleShape2D_b3366")
Position = Vector2(0, -48.95)
Rotation = 1.5
[node name="Bush11" parent="." instance=ExtResource("6_3fkbm")]
position = Vector2(2208, 2337)
scale = Vector2(5, 5.195)
texture = SubResource("AtlasTexture_rn40i")
offset = Vector2(-108.615, -141.38)
Shape = SubResource("CapsuleShape2D_b3366")
Position = Vector2(0, -48.95)
Rotation = 1.5
[node name="Rock1" parent="." instance=ExtResource("9_nxjul")]
[node name="Rock1" type="Sprite2D" parent="."]
position = Vector2(-1807, 2030)
texture = SubResource("AtlasTexture_vun1v")
scale = Vector2(3.80334, 3.95089)
texture = ExtResource("7_mbwmw")
centered = false
offset = Vector2(-78.385, -130.2)
StickerShape = SubResource("CapsuleShape2D_b3366")
Position = Vector2(8.56, -52.395)
CollisionShape = SubResource("RectangleShape2D_4cdlc")
CollisionPosition = Vector2(7.915, -31.39)
metadata/tags = ["rock"]
[node name="Rock2" parent="." instance=ExtResource("9_nxjul")]
[node name="StaticBody2D" type="StaticBody2D" parent="Rock1"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Rock1/StaticBody2D"]
position = Vector2(7.915, -31.39)
shape = SubResource("RectangleShape2D_4cdlc")
debug_color = Color(0.996033, 0, 0.194446, 0.42)
[node name="Rock2" type="Sprite2D" parent="."]
position = Vector2(-2248, 1895)
texture = SubResource("AtlasTexture_wpoj4")
scale = Vector2(3.80334, 3.95089)
texture = ExtResource("8_bhcew")
centered = false
offset = Vector2(-126.11, -220.56)
StickerShape = SubResource("CapsuleShape2D_bkpsv")
Position = Vector2(0, -89.77)
CollisionShape = SubResource("RectangleShape2D_hk5e3")
CollisionPosition = Vector2(0, -66.02)
metadata/tags = ["rock"]
[node name="StaticBody2D" type="StaticBody2D" parent="Rock2"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Rock2/StaticBody2D"]
position = Vector2(0, -66.02)
shape = SubResource("RectangleShape2D_hk5e3")
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
@ -258,10 +263,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
@ -276,7 +292,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
@ -288,15 +304,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="."]
[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
position = Vector2(-294, -641)
scale = Vector2(4, 4)
texture = SubResource("AtlasTexture_2qdgk")
texture = ExtResource("10_2ugv3")
offset = Vector2(0, -26.64)
[node name="GPUParticles2D" type="GPUParticles2D" parent="FirePit"]
position = Vector2(-1.5, -18.25)
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")
@ -305,25 +335,65 @@ collision_base_size = 0.0
visibility_rect = Rect2(-160, -160, 320, 320)
local_coords = true
[node name="Sprite2D" type="Sprite2D" parent="FirePit"]
visible = false
position = Vector2(4.75, -2)
scale = Vector2(0.7, 0.7)
texture = SubResource("AtlasTexture_c24s7")
centered = false
offset = Vector2(-71.215, -125.04)
[node name="StaticBody2D" type="StaticBody2D" parent="FirePit"]
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(4.75, -2)
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("13_sm1ou")
texture = ExtResource("7_4swoj")
texture_scale = 1.9
metadata/_edit_lock_ = true
[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 = 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")
[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="Bush4" parent="." instance=ExtResource("8_tag7x")]
position = Vector2(-1561, 296)
flip_h = true
[node name="Bush5" parent="." instance=ExtResource("8_tag7x")]
position = Vector2(687, 304)
[node name="Bush8" parent="." instance=ExtResource("8_tag7x")]
position = Vector2(2207, 2320)
[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="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"]

View file

@ -1,15 +1,16 @@
[gd_scene load_steps=27 format=3 uid="uid://5tfe84u3gyty"]
[gd_scene load_steps=26 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"]
[ext_resource type="Texture2D" uid="uid://6hc7x8qe6r1c" path="res://maps/map2.tres" id="3_gbt28"]
[ext_resource type="PackedScene" uid="uid://domcpxdf6lqpb" path="res://prefab/free_sticker.tscn" id="4_2tdya"]
[ext_resource type="Texture2D" uid="uid://cxharyv0ajr37" path="res://textures/atlas/DioramaEntrance_All_01_SPRT.png" id="4_lgnnp"]
[ext_resource type="PackedScene" uid="uid://do65rgg0p2plt" path="res://core/Door.tscn" id="4_yvr3q"]
[ext_resource type="Texture2D" uid="uid://dggavne4ueche" path="res://extracted/Texture2D/Tree_Field_01_SPRT.png" id="5_lwnej"]
[ext_resource type="PackedScene" uid="uid://6ww1g2enfdx3" path="res://prefab/solid_sticker.tscn" id="6_k22qa"]
[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" uid="uid://b6blosn6modfc" path="res://core/stickernode.gd" id="9_ap7ts"]
[ext_resource type="PackedScene" uid="uid://kvjctagkwivk" path="res://prefab/prefab_bush1.tscn" id="10_hc0vj"]
[ext_resource type="PackedScene" uid="uid://cdurdoebbnau7" path="res://prefab/prefab_bush2.tscn" id="11_hypxn"]
[sub_resource type="AtlasTexture" id="AtlasTexture_rckkj"]
atlas = ExtResource("3_54rqc")
@ -24,22 +25,10 @@ region = Rect2(360, 288, 108, 272)
atlas = ExtResource("4_lgnnp")
region = Rect2(0, 16, 228, 80)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_np57i"]
radius = 70.0
height = 512.0
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_3r7ts"]
radius = 80.0
height = 254.0
[sub_resource type="AtlasTexture" id="AtlasTexture_ti2p7"]
atlas = ExtResource("7_pykf8")
region = Rect2(288, 256, 192, 160)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_r6rf6"]
radius = 65.0
height = 184.05
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4rns6"]
size = Vector2(133.06, 62.73)
@ -47,20 +36,16 @@ 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)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_io0k5"]
radius = 105.36
height = 291.04
[sub_resource type="RectangleShape2D" id="RectangleShape2D_o3kxg"]
size = Vector2(201.89, 146.45)
@ -71,44 +56,51 @@ region = Rect2(544, 1728, 416, 288)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ontns"]
size = Vector2(325.915, 124.47)
[sub_resource type="AtlasTexture" id="AtlasTexture_3kc8y"]
atlas = ExtResource("7_pykf8")
region = Rect2(1728, 1248, 288, 320)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bimlt"]
size = Vector2(258.691, 98.1358)
[node name="Map2" type="Node2D"]
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"]
collision_layer = 16
collision_mask = 9
[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Map2/StaticBody2D"]
[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Floor/StaticBody2D"]
visible = false
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"]
collision_layer = 16
collision_mask = 9
[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")
@ -117,103 +109,175 @@ Travel = 2
Spawn_Position = Vector2(0, 2317)
[node name="RefMap2" type="Sprite2D" parent="."]
visible = false
modulate = Color(1, 1, 1, 0.741176)
z_index = -5
position = Vector2(-123, -696)
scale = Vector2(6.39228, 6.39228)
texture = ExtResource("1_cdv75")
[node name="Tree1" parent="." instance=ExtResource("4_2tdya")]
[node name="Tree1" type="Sprite2D" parent="."]
position = Vector2(-2084.56, -1642.1)
scale = Vector2(3.80334, 3.95089)
texture = ExtResource("5_lwnej")
centered = false
offset = Vector2(-251.145, -512)
Shape = SubResource("CapsuleShape2D_np57i")
Position = Vector2(0, -253.27)
Rotation = 0.01
metadata/tags = ["sticker"]
[node name="Tree2" parent="." instance=ExtResource("4_2tdya")]
[node name="Tree2" type="Sprite2D" parent="."]
position = Vector2(-1569.56, -1870.1)
scale = Vector2(3.2, 3.324)
texture = ExtResource("5_lwnej")
centered = false
offset = Vector2(-251.145, -512)
Shape = SubResource("CapsuleShape2D_np57i")
Position = Vector2(0, -253.27)
Rotation = 0.01
metadata/tags = ["sticker"]
[node name="Tree3" parent="." instance=ExtResource("4_2tdya")]
[node name="Tree3" type="Sprite2D" parent="."]
position = Vector2(2156, -1876)
scale = Vector2(3, 3.117)
texture = ExtResource("5_lwnej")
centered = false
offset = Vector2(-251.145, -512)
Shape = SubResource("CapsuleShape2D_np57i")
Position = Vector2(0, -253.27)
Rotation = 0.01
metadata/tags = ["sticker"]
[node name="Bush1" parent="." instance=ExtResource("4_2tdya")]
position = Vector2(-1554.56, -1581.1)
Shape = SubResource("CapsuleShape2D_3r7ts")
Rotation = 1.6
[node name="Bush2" parent="." instance=ExtResource("4_2tdya")]
position = Vector2(-1863.56, -2052.1)
Shape = SubResource("CapsuleShape2D_3r7ts")
Rotation = 1.6
[node name="Bush3" parent="." instance=ExtResource("4_2tdya")]
position = Vector2(2171, -1357)
Shape = SubResource("CapsuleShape2D_3r7ts")
Rotation = 1.6
[node name="Rock1" parent="." instance=ExtResource("6_k22qa")]
[node name="Rock1" type="Sprite2D" parent="."]
position = Vector2(2160, -900.32)
scale = Vector2(5, 5.195)
texture = SubResource("AtlasTexture_ti2p7")
centered = false
offset = Vector2(-78.385, -130.2)
StickerShape = SubResource("CapsuleShape2D_r6rf6")
Position = Vector2(8.56, -52.395)
CollisionShape = SubResource("RectangleShape2D_4rns6")
CollisionPosition = Vector2(7.915, -31.39)
metadata/tags = ["rock"]
[node name="Box1" parent="." instance=ExtResource("6_k22qa")]
[node name="StaticBody2D" type="StaticBody2D" parent="Rock1"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Rock1/StaticBody2D"]
position = Vector2(7.915, -31.39)
shape = SubResource("RectangleShape2D_4rns6")
debug_color = Color(0.996033, 0, 0.194446, 0.42)
[node name="Box1" type="Sprite2D" parent="."]
position = Vector2(1195, -898.32)
scale = Vector2(5, 4.51)
texture = SubResource("AtlasTexture_4pwyl")
centered = false
offset = Vector2(-52.525, -167.375)
StickerShape = SubResource("RectangleShape2D_djose")
Position = Vector2(0, -76.12)
CollisionShape = SubResource("RectangleShape2D_enbs7")
CollisionPosition = Vector2(0, -49.595)
metadata/tags = ["sticker"]
[node name="Box2" parent="." instance=ExtResource("6_k22qa")]
[node name="StaticBody2D" type="StaticBody2D" parent="Box1"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Box1/StaticBody2D"]
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 = 61
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)
texture = SubResource("AtlasTexture_4pwyl")
centered = false
offset = Vector2(-54.04, -167.375)
StickerShape = SubResource("RectangleShape2D_djose")
Position = Vector2(0, -76.12)
CollisionShape = SubResource("RectangleShape2D_enbs7")
CollisionPosition = Vector2(0, -49.595)
metadata/tags = ["sticker"]
[node name="Rock2" parent="." instance=ExtResource("6_k22qa")]
[node name="StaticBody2D" type="StaticBody2D" parent="Box2"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Box2/StaticBody2D"]
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 = 61
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)
texture = SubResource("AtlasTexture_ddtk8")
centered = false
offset = Vector2(-126.11, -220.56)
StickerShape = SubResource("CapsuleShape2D_io0k5")
Position = Vector2(0, -89.77)
CollisionShape = SubResource("RectangleShape2D_o3kxg")
CollisionPosition = Vector2(0, -66.02)
metadata/tags = ["rock"]
[node name="Rock3" parent="." instance=ExtResource("6_k22qa")]
[node name="StaticBody2D" type="StaticBody2D" parent="Rock2"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Rock2/StaticBody2D"]
position = Vector2(0, -66.02)
shape = SubResource("RectangleShape2D_o3kxg")
debug_color = Color(0.996033, 0, 0.194446, 0.42)
[node name="Rock3" type="Sprite2D" parent="."]
position = Vector2(-993, -2293)
scale = Vector2(4.97891, 4.95232)
texture = SubResource("AtlasTexture_ko6cw")
centered = false
offset = Vector2(-208.35, -260.555)
StickerShape = SubResource("CapsuleShape2D_io0k5")
Position = Vector2(0, -123.545)
CollisionShape = SubResource("RectangleShape2D_ontns")
CollisionPosition = Vector2(0, -65.23)
metadata/tags = ["rock"]
[node name="StaticBody2D" type="StaticBody2D" parent="Rock3"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Rock3/StaticBody2D"]
position = Vector2(0, -65.23)
shape = SubResource("RectangleShape2D_ontns")
debug_color = Color(0.996033, 0, 0.194446, 0.42)
[node name="Rock4" type="Sprite2D" parent="."]
position = Vector2(1403, -2255)
scale = Vector2(4.97891, 4.95232)
texture = SubResource("AtlasTexture_3kc8y")
offset = Vector2(0, -146.15)
metadata/tags = ["rock"]
[node name="StaticBody2D" type="StaticBody2D" parent="Rock4"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Rock4/StaticBody2D"]
position = Vector2(0, -64.212)
shape = SubResource("RectangleShape2D_bimlt")
debug_color = Color(0.996033, 0, 0.194446, 0.42)
[node name="Bush1" parent="." instance=ExtResource("10_hc0vj")]
position = Vector2(-1686, -1649)
[node name="Bush10" parent="." instance=ExtResource("11_hypxn")]
position = Vector2(2187, -1459)
scale = Vector2(3.9, 4.052)
flip_h = false
[connection signal="property_list_changed" from="Tree1" to="Tree1" method="_on_property_list_changed"]
[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="Rock1" to="Rock1" method="_on_property_list_changed"]
[connection signal="property_list_changed" from="Box1" to="Box1" method="_on_property_list_changed"]
[connection signal="property_list_changed" from="Box2" to="Box2" method="_on_property_list_changed"]
[connection signal="property_list_changed" from="Rock2" to="Rock2" method="_on_property_list_changed"]
[connection signal="property_list_changed" from="Rock3" to="Rock3" method="_on_property_list_changed"]
[connection signal="property_list_changed" from="Rock4" to="Rock4" method="_on_property_list_changed"]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=11 format=3 uid="uid://d382cexpr4075"]
[ext_resource type="Script" path="res://core/sceneInstance.gd" id="1_p0vo1"]
[ext_resource type="Script" uid="uid://ca64tp2asqllb" path="res://core/sceneInstance.gd" id="1_p0vo1"]
[ext_resource type="PackedScene" uid="uid://0m1hk2nu4bps" path="res://core/player.tscn" id="2_fyjh8"]
[ext_resource type="PackedScene" uid="uid://wlqsvbqpcbh" path="res://maps/map1.tscn" id="2_qgqfi"]
[ext_resource type="PackedScene" uid="uid://bxin06eifwhb5" path="res://core/Background.tscn" id="4_81gsq"]
@ -196,13 +196,14 @@ tracks/3/keys = {
[sub_resource type="AnimationLibrary" id="AnimationLibrary_q5lfn"]
_data = {
"RESET": SubResource("Animation_gjtj4"),
"travel_down": SubResource("Animation_w8b25"),
"travel_left": SubResource("Animation_pd367"),
"travel_up": SubResource("Animation_c7s7o")
&"RESET": SubResource("Animation_gjtj4"),
&"travel_down": SubResource("Animation_w8b25"),
&"travel_left": SubResource("Animation_pd367"),
&"travel_up": SubResource("Animation_c7s7o")
}
[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"]

View file

@ -1,68 +0,0 @@
[gd_scene load_steps=4 format=3 uid="uid://domcpxdf6lqpb"]
[ext_resource type="Texture2D" uid="uid://cun14l52f477p" path="res://textures/atlas/Bushes_All_01_SPRT.png" id="1_1wk1p"]
[sub_resource type="AtlasTexture" id="AtlasTexture_2wdar"]
atlas = ExtResource("1_1wk1p")
region = Rect2(384, 64, 288, 224)
[sub_resource type="GDScript" id="GDScript_uqtu8"]
script/source = "@tool
extends Sprite2D
var OutlineMat:ShaderMaterial = preload(\"res://shaders/shaderMaterial_Outline.tres\")
@export_group(\"Sticker Detection Shape\")
@export var Shape :Shape2D:
set(new_shape):
Shape = new_shape
$Area2D/CollisionShape2D.shape = Shape
$Area2D/CollisionShape2D.queue_redraw()
@export var Position :Vector2:
set(new_position):
Position = new_position
$Area2D/CollisionShape2D.position = Position
$Area2D/CollisionShape2D.queue_redraw()
@export var Rotation :float:
set(new_rotation):
Rotation = new_rotation
$Area2D/CollisionShape2D.rotation = Rotation
$Area2D/CollisionShape2D.queue_redraw()
func on_released():
print(self,\" released\")
func on_click():
print(self,\" clicked\")
func on_hover():
material = OutlineMat
queue_redraw()
func on_unhover():
material = null
queue_redraw()
func on_grab(_offset:Vector2=Vector2(0.0,0.0)):
pass
"
[node name="FreeSticker1" type="Sprite2D"]
scale = Vector2(3.80334, 3.95089)
texture = SubResource("AtlasTexture_2wdar")
centered = false
offset = Vector2(-161.055, -179.785)
script = SubResource("GDScript_uqtu8")
metadata/tags = ["sticker"]
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 2
collision_mask = 0
monitoring = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(-4.46976, -71.6294)
rotation = 1.5708
[connection signal="property_list_changed" from="." to="." method="_on_property_list_changed"]

46
prefab/prefab_bush1.tscn Normal file
View file

@ -0,0 +1,46 @@
[gd_scene load_steps=5 format=3 uid="uid://kvjctagkwivk"]
[ext_resource type="Texture2D" uid="uid://ddajgcwn5ip4c" path="res://textures/sprites/plants_bush1.tres" id="1_gcxqk"]
[ext_resource type="Script" uid="uid://b6blosn6modfc" path="res://core/stickernode.gd" id="2_aj8js"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_lfx7b"]
resource_name = "bush1_sticker_zone"
radius = 80.0
height = 254.0
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ke631"]
resource_name = "bush1_detection_zone"
radius = 15.0
height = 150.0
[node name="Bush1" type="Sprite2D"]
scale = Vector2(3.80334, 3.95089)
texture = ExtResource("1_gcxqk")
centered = false
offset = Vector2(-161.055, -179.785)
metadata/tags = ["sticker"]
[node name="Sticker" type="Area2D" parent="." node_paths=PackedStringArray("WorldSprite", "DetectionArea")]
collision_layer = 2
collision_mask = 61
script = ExtResource("2_aj8js")
WorldSprite = NodePath("..")
DetectionArea = NodePath("DetectionZone")
metadata/tags = PackedStringArray("sticker")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sticker"]
position = Vector2(-4.46973, -71.6294)
rotation = 1.6
shape = SubResource("CapsuleShape2D_lfx7b")
[node name="DetectionZone" type="Area2D" parent="Sticker"]
collision_layer = 4
collision_mask = 61
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sticker/DetectionZone"]
position = Vector2(0, -5.415)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_ke631")
debug_color = Color(1.29953e-06, 0.637445, 0.391979, 0.42)
[connection signal="property_list_changed" from="." to="." method="_on_property_list_changed"]

43
prefab/prefab_bush2.tscn Normal file
View file

@ -0,0 +1,43 @@
[gd_scene load_steps=5 format=3 uid="uid://cdurdoebbnau7"]
[ext_resource type="Texture2D" uid="uid://qsse8uwt06ns" path="res://textures/sprites/plants_bush2.tres" id="1_thd4i"]
[ext_resource type="Script" uid="uid://b6blosn6modfc" path="res://core/stickernode.gd" id="2_f0erb"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_b3366"]
radius = 56.13
height = 184.05
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_1mqq3"]
height = 110.0
[node name="Bush10" type="Sprite2D"]
scale = Vector2(3.80334, 3.95089)
texture = ExtResource("1_thd4i")
offset = Vector2(0, -63.525)
flip_h = true
metadata/tags = ["sticker"]
[node name="Sticker" type="Area2D" parent="." node_paths=PackedStringArray("WorldSprite", "DetectionArea")]
collision_layer = 2
collision_mask = 61
script = ExtResource("2_f0erb")
WorldSprite = NodePath("..")
DetectionArea = NodePath("DetectionZone")
metadata/tags = PackedStringArray("sticker")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sticker"]
position = Vector2(0, -55.845)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_b3366")
[node name="DetectionZone" type="Area2D" parent="Sticker"]
collision_layer = 4
collision_mask = 61
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sticker/DetectionZone"]
position = Vector2(0, -10)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_1mqq3")
debug_color = Color(1.29953e-06, 0.637445, 0.391979, 0.42)
[connection signal="property_list_changed" from="." to="." method="_on_property_list_changed"]

View file

@ -1,10 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://bddcriwo55x8k"]
[gd_scene load_steps=3 format=3 uid="uid://bddcriwo55x8k"]
[ext_resource type="Texture2D" uid="uid://b366mcexlko72" path="res://textures/atlas/LogsAndWood_All_01_SPRT.png" id="1_lvitw"]
[ext_resource type="PackedScene" uid="uid://clqvgh6qmglue" path="res://core/bridgeNode.tscn" id="2_te8ug"]
[sub_resource type="AtlasTexture" id="AtlasTexture_nkyhf"]
atlas = ExtResource("1_lvitw")
region = Rect2(72, 1392, 216, 272)
[node name="WoodenBridge" type="Sprite2D"]
@ -13,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)
@ -21,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)

View file

@ -1,93 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://6ww1g2enfdx3"]
[ext_resource type="Texture2D" uid="uid://cun14l52f477p" path="res://textures/atlas/Bushes_All_01_SPRT.png" id="1_ssqve"]
[sub_resource type="AtlasTexture" id="AtlasTexture_2wdar"]
atlas = ExtResource("1_ssqve")
region = Rect2(384, 64, 288, 224)
[sub_resource type="GDScript" id="GDScript_uqtu8"]
script/source = "@tool
extends Sprite2D
var OutlineMat:ShaderMaterial = preload(\"res://shaders/shaderMaterial_Outline.tres\")
@export_group(\"Sticker Detection Shape\")
@export var StickerShape :Shape2D:
set(new_shape):
StickerShape = new_shape
$Area2D/StickerShape2D.shape = StickerShape
$Area2D/StickerShape2D.queue_redraw()
@export var Position :Vector2:
set(new_position):
Position = new_position
$Area2D/StickerShape2D.position = Position
$Area2D/StickerShape2D.queue_redraw()
@export var Rotation :float:
set(new_rotation):
Rotation = new_rotation
$Area2D/StickerShape2D.rotation = Rotation
$Area2D/StickerShape2D.queue_redraw()
@export_group(\"Collision Shape\")
@export var CollisionShape :Shape2D:
set(new_CollisionShape):
CollisionShape = new_CollisionShape
$StaticBody2D/CollisionShape2D.shape = CollisionShape
$StaticBody2D/CollisionShape2D.queue_redraw()
@export var CollisionPosition :Vector2:
set(new_CollisionPosition):
CollisionPosition = new_CollisionPosition
$StaticBody2D/CollisionShape2D.position = CollisionPosition
$StaticBody2D/CollisionShape2D.queue_redraw()
@export var CollisionRotation :float:
set(new_ColissionRotation):
CollisionRotation = new_ColissionRotation
$StaticBody2D/CollisionShape2D.rotation = CollisionRotation
$StaticBody2D/CollisionShape2D.queue_redraw()
func on_released():
print(self,\" released\")
func on_click():
print(self,\" clicked\")
func on_hover():
material = OutlineMat
queue_redraw()
func on_unhover():
material = null
queue_redraw()
func on_grab(_offset:Vector2=Vector2(0.0,0.0)):
pass
"
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ep5ck"]
size = Vector2(104.391, 20.3774)
[node name="SolidSticker1" type="Sprite2D"]
scale = Vector2(3.80334, 3.95089)
texture = SubResource("AtlasTexture_2wdar")
centered = false
offset = Vector2(-161.055, -179.785)
script = SubResource("GDScript_uqtu8")
metadata/tags = ["sticker"]
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 2
collision_mask = 0
monitoring = false
[node name="StickerShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(-4.46976, -71.6294)
rotation = 1.5708
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(2.10341, -10.8836)
shape = SubResource("RectangleShape2D_ep5ck")
debug_color = Color(0.996033, 0, 0.194446, 0.42)
[connection signal="property_list_changed" from="." to="." method="_on_property_list_changed"]

View file

@ -13,7 +13,7 @@ config_version=5
config/name="StickerClone"
config/version="0.1"
run/main_scene="res://maps/mainMenu.tscn"
config/features=PackedStringArray("4.2", "Mobile")
config/features=PackedStringArray("4.4", "Mobile")
[autoload]
@ -27,6 +27,11 @@ Cursor="*res://core/Cursor.tscn"
window/size/viewport_width=1920
window/size/viewport_height=1080
window/size/initial_position_type=2
window/size/initial_screen=2
window/size/extend_to_title=true
window/stretch/mode="canvas_items"
window/size/viewport_width.editor=1152
window/size/viewport_height.editor=648
[editor_plugins]
@ -41,43 +46,43 @@ import/fbx/enabled=false
move_up={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":122,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":113,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
sticker_mode={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194326,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194326,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
select={
"deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(111, 16),"global_position":Vector2(115, 57),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
back={
@ -89,7 +94,7 @@ back={
menu={
"deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":true,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
mouse_up={
@ -117,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]

132
shaders/pageflip2.gdshader Normal file
View file

@ -0,0 +1,132 @@
shader_type canvas_item;
uniform float flip_param : hint_range(0.0, 1.0); // Parameter to control the flipping effect
uniform float dim_color_scale : hint_range(0.0, 1.0) = 0.4; // Control the dim of the back of the flipped texture
uniform float x_buffer = 2.0;//Increase these if you need your flip to stretch further
uniform float y_buffer = 2.0;
const vec2 scale = vec2(1, 1); // Scale of the texture
const vec2 start_flip_pos = vec2(1.0, 0.0); // Starting position of the flip
const vec2 end_flip_pos = vec2(0, 1); // Ending position of the flip
uniform vec2 atlas_offset = vec2(0.0); // Offset dans l'atlas
uniform vec2 atlas_size = vec2(1.0); // Taille de la région dans l'atlas
// Function to calculate the vector from a line to a point
vec2 Line2point(vec2 linePoint, vec2 lineDire, vec2 point) {
lineDire = normalize(lineDire); // Normalize the direction of the line
return -linePoint - dot(-linePoint, lineDire) * lineDire - (-point - dot(-point, lineDire) * lineDire);
}
void vertex() {
//This increases the size of the uv so the sprite can be drawn 'out of bounds'
VERTEX.x *= x_buffer;
VERTEX.y *= y_buffer;
}
// Main fragment shader function
void fragment() {
// Resize the texture coordinates before the buffer
vec2 uv = vec2((UV.x - 0.5) * x_buffer + 0.5, (UV.y - 0.5) * y_buffer + 0.5);
uv = UV * atlas_size + atlas_offset;
// Interpolate flip position based on flip_param
vec2 flip_pos = mix(start_flip_pos, end_flip_pos, flip_param);
// Get the UV coordinates of the fragment
vec4 finalColor = vec4(0.0); // Initialize final color with transparent
float scale_min = scale.x / scale.y;
vec2 uv_max = vec2(scale_min, 1.0);
float trueScale;
// Adjust UV coordinates based on the scale
if (scale.y < scale.x) {
scale_min = scale.y / scale.x;
uv.y *= scale_min;
uv_max = vec2(1.0, scale_min);
trueScale = scale.x;
} else {
uv.x *= scale_min;
trueScale = scale.y;
}
// Sample the color from the texture at the given UV coordinates
COLOR = texture(TEXTURE, uv);
// Calculate the position in texture space
vec2 pPos = uv / trueScale;
// If the flip position is valid, can't be 0
if (flip_pos.x > -0.00001) {
vec2 left_bottom = vec2(0.0, uv_max.y / trueScale);
vec2 midpoint = (flip_pos - left_bottom) / 2.5 + left_bottom;
vec2 midDirect = normalize(vec2(-(flip_pos - left_bottom).y, (flip_pos - left_bottom).x));
// Calculate sharp point and direction vectors
vec2 sharpPoint = vec2(0.0, midpoint.y - midDirect.y / midDirect.x * midpoint.x);
vec2 flipEdgeDire = normalize(sharpPoint - flip_pos);
vec2 sharpPointB = vec2(midpoint.x - midDirect.x / midDirect.y * (midpoint - left_bottom).y, left_bottom.y);
vec2 flipEdgeDireB = normalize(sharpPointB - flip_pos);
float cyOriOff = min(length(flip_pos - left_bottom), 100.0);
float cyR = cyOriOff * 2.05 / PI;
vec2 midlineToP = Line2point(midpoint, midDirect, pPos);
vec2 cyOriToP = midlineToP - normalize(flip_pos - left_bottom) * cyOriOff;
vec2 cyEdgeToP = midlineToP - normalize(flip_pos - left_bottom) * (cyOriOff - cyR);
// Determine the location of the fragment relative to the flip
bool atBG = (cyOriToP.x <= -0.001);
bool atCy = (cyEdgeToP.x >= 0.0) && (cyOriToP.x <= 0.0);
bool atCyPage = false;
vec2 uvCy;
vec2 uvCyB;
// If the fragment is within the curvature area
if (atCy) {
vec2 cyOri = pPos - cyOriToP;
vec2 trueDis = cyR * asin(length(cyOriToP) / cyR) * normalize(cyOriToP);
vec2 truePos = cyOri + trueDis;
vec2 sideEdgeToTP = Line2point(flip_pos, flipEdgeDire, truePos);
vec2 BottomEdgeToTP = Line2point(flip_pos, flipEdgeDireB, truePos);
uvCyB = truePos * trueScale;
if ((BottomEdgeToTP.x < 0.0) && (sideEdgeToTP.y > 0.0)) {
atCyPage = true;
uvCy = vec2(length(sideEdgeToTP), left_bottom.y - length(BottomEdgeToTP)) * trueScale;
}
if ((uvCyB.x > uv_max.x) || (uvCyB.y > uv_max.y) || (uvCyB.x <= 0.0) || (uvCyB.y <= 0.0)) {
atCy = false;
}
}
// If the fragment is not within the background or curvature area, sample the color from the texture
if (!atBG && !atCy) {
finalColor = texture(TEXTURE, uv);
}
// If the fragment is within the curvature area, sample the color with curvature effect
if (atCy) {
finalColor = texture(TEXTURE, uvCyB);
}
// If the fragment is on the flipped page, adjust the color for the back of the page
if (atCyPage) {
vec4 cyPageColor = texture(TEXTURE, uvCy);
cyPageColor.rgb *= dim_color_scale; // Dim the color slightly
finalColor = mix(finalColor, cyPageColor, cyPageColor.a);
}
// Set the final color
COLOR = finalColor;
}
}

View file

@ -0,0 +1 @@
uid://5gsjq7w5fcou

View file

@ -0,0 +1,145 @@
shader_type canvas_item;
// Scale and mouse position as input parameters
const vec2 scale = vec2(1, 1);
uniform float dim_color_scale : hint_range(0.0, 1.0) = 0.5;
uniform float pos_x : hint_range(0.0, 1.0) = 0.0001 ;
uniform float pos_y : hint_range(0.0, 1.0) = 0.05;
// Helper function to calculate the distance between a point and a line
vec2 Line2point(vec2 linePoint, vec2 lineDire, vec2 point) {
lineDire = normalize(lineDire);
vec2 line2Ori = -linePoint - dot(-linePoint, lineDire) * lineDire;
vec2 p2Ori = -point - dot(-point, lineDire) * lineDire;
return line2Ori - p2Ori;
}
// Function to blend two colors based on their alpha values
vec4 ColorWithA(vec4 oldCol, vec4 newCol) {
vec4 finalCol;
if ((newCol.a + oldCol.a) >= 1.0) {
finalCol.rgb = newCol.rgb;
finalCol.a = 1.0;
} else {
finalCol.rgb = newCol.a / (newCol.a + oldCol.a) * newCol.rgb + oldCol.a / (newCol.a + oldCol.a) * oldCol.rgb;
finalCol.a = oldCol.a + newCol.a;
}
return finalCol;
}
void fragment() {
// Initialize mouse position and final color
vec2 mouse_pos = vec2(-1., -1.);
vec2 uv = UV;
vec4 finalColor = vec4(0.0); // Transparent color initially
// Adjust scale to maintain aspect ratio of the sprite
float scale_min = scale.x / scale.y;
vec2 uv_max = vec2(scale_min, 1.0);
float trueScale;
if (scale.y < scale.x) {
scale_min = scale.y / scale.x;
uv.y = uv.y * scale_min;
uv_max = vec2(1.0, scale_min);
trueScale = scale.x;
} else {
uv.x = uv.x * scale_min;
trueScale = scale.y;
}
// Normalize mouse position based on the texture pixel size
mouse_pos.x = pos_x * (1.0 / TEXTURE_PIXEL_SIZE.x);
mouse_pos.y = pos_y * (1.0 / TEXTURE_PIXEL_SIZE.y);
vec2 normalized_mouse = mouse_pos * uv_max;
// Default texture color assignment
COLOR = texture(TEXTURE, uv);
// Calculate sprite's position relative to the mouse
vec2 pPos = uv / TEXTURE_PIXEL_SIZE * trueScale;
// Only process if the mouse position is valid
if (normalized_mouse.x > -0.0001) {
vec2 left_bottom = vec2(0.0, uv_max.y / TEXTURE_PIXEL_SIZE.y * trueScale);
vec2 midpoint = (normalized_mouse - left_bottom) / 2.0 + left_bottom;
vec2 midDirect = normalize(vec2(-(normalized_mouse - left_bottom).y, (normalized_mouse - left_bottom).x));
// Calculate flip interactions
vec2 sharpPoint = vec2(0.0, midpoint.y - midDirect.y / midDirect.x * midpoint.x);
vec2 flipEdgeDire = normalize(sharpPoint - normalized_mouse);
vec2 sharpPointB = vec2(midpoint.x - midDirect.x / midDirect.y * (midpoint - left_bottom).y, left_bottom.y);
vec2 flipEdgeDireB = normalize(sharpPointB - normalized_mouse);
// Flip logic based on mouse distance and angle
float cyOriOff = length(normalized_mouse - left_bottom);
if (cyOriOff > 100.0) cyOriOff = 100.0;
float cyR = cyOriOff * 2.0 / PI;
vec2 midlineToP = Line2point(midpoint, midDirect, pPos);
vec2 sideEdgeToP = Line2point(normalized_mouse, flipEdgeDire, pPos);
vec2 BottomEdgeToP = Line2point(normalized_mouse, flipEdgeDireB, pPos);
vec2 cyOriToP = midlineToP - normalize(normalized_mouse - left_bottom) * cyOriOff;
vec2 cyEdgeToP = midlineToP - normalize(normalized_mouse - left_bottom) * (cyOriOff - cyR);
bool atBG = (cyOriToP).x <= -0.01;
bool atPageBack = !atBG && (sideEdgeToP.y > 0.0) && (BottomEdgeToP.x <= 0.0);
bool atCy = cyEdgeToP.x >= 0.0 && (cyOriToP).x <= 0.0;
bool atCyPage = false;
float shadow = 1.0;
vec2 uvCy, uvCyB;
// Handle flip state and apply shadow effect
if (atCy) {
vec2 cyOri = pPos - cyOriToP;
vec2 trueDis = cyR * asin(length(cyOriToP) / cyR) * normalize(cyOriToP);
vec2 truePos = cyOri + trueDis;
uvCyB = truePos * TEXTURE_PIXEL_SIZE / trueScale;
shadow *= 1.0 - pow(length(trueDis) / (cyR * PI / 2.0), 3.0);
// Determine if we are on the flip side of the page
if ((BottomEdgeToP.x < 0.0) && (sideEdgeToP.y > 0.0)) {
atCyPage = true;
uvCy = vec2(length(sideEdgeToP), left_bottom.y - length(BottomEdgeToP)) * TEXTURE_PIXEL_SIZE / trueScale;
}
if (uvCyB.x > uv_max.x || uvCyB.y > uv_max.y || uvCyB.x <= 0.0 || uvCyB.y <= 0.0) {
atCy = false;
}
}
// Blend final color based on conditions
COLOR = vec4(0.0); // Reset COLOR
if (!atBG && !atCy) {
vec4 color = texture(TEXTURE, uv);
finalColor = color;
}
if (atCy) {
vec4 cyColor = texture(TEXTURE, uvCyB);
finalColor = cyColor;
}
if (atCyPage) {
vec4 cyPageColor = texture(TEXTURE, uvCy);
cyPageColor.xyz *= dim_color_scale; // Dim the color slightly
finalColor = mix(finalColor, cyPageColor, cyPageColor.a);
} else if (atPageBack) { // If the fragment is on the flipped page, adjust the color for the back of the page
uv = vec2(length(sideEdgeToP), left_bottom.y - length(BottomEdgeToP)) * TEXTURE_PIXEL_SIZE / trueScale;
vec4 pageBackColor = texture(TEXTURE, uv);
pageBackColor.xyz *= dim_color_scale; // Dim the back page color
finalColor = mix(finalColor, pageBackColor, pageBackColor.a);
}
COLOR = finalColor;
}
else{
}
}

View file

@ -0,0 +1 @@
uid://bfbb27u1p782f

11
shaders/pageflipweb.tres Normal file
View file

@ -0,0 +1,11 @@
[gd_resource type="VisualShader" format=3 uid="uid://bxy88pmtcbiq6"]
[resource]
code = "shader_type canvas_item;
render_mode blend_mix;
"
mode = 1
flags/light_only = false

View file

@ -1,6 +1,6 @@
[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" uid="uid://cdj8qc2oip667" path="res://shaders/shader_outline3.gdshader" id="1_4ciqw"]
[resource]
shader = ExtResource("1_4ciqw")
@ -11,5 +11,5 @@ 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/offset = Vector2(0, 0)
shader_parameter/max_or_add = true

View file

@ -0,0 +1,10 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://583rlv8jgawy"]
[ext_resource type="Shader" path="res://shaders/pageflip2.gdshader" id="1_1kmqt"]
[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

View file

@ -0,0 +1 @@
uid://3yqh0gv1l0ca

View file

@ -1,53 +0,0 @@
shader_type canvas_item;
uniform vec4 line_color : source_color = vec4(1);
uniform float line_thickness : hint_range(0, 20) = 0.0;
uniform bool add_margins = true;
void vertex() {
if (add_margins) {
VERTEX += (UV * 2.0 - 1.0) * line_thickness;
}
}
void fragment() {
vec2 uv = UV;
if (add_margins) {
vec2 texture_pixel_size = vec2(1.0) / (vec2(1.0) / TEXTURE_PIXEL_SIZE + vec2(line_thickness * 2.0));
uv = (uv - texture_pixel_size * line_thickness) * TEXTURE_PIXEL_SIZE / texture_pixel_size;
if (uv != clamp(uv, vec2(0.0), vec2(1.0))) {
COLOR.a = 0.0;
} else {
COLOR = texture(TEXTURE, uv);
}
} else {
COLOR = texture(TEXTURE, uv);
}
vec2 size = TEXTURE_PIXEL_SIZE * line_thickness;
if (line_thickness < 0.1) {
vec4 color = texture(TEXTURE, uv);
COLOR = color;
} else {
float outline = texture(TEXTURE, uv + vec2(-size.x, 0)).a;
outline += texture(TEXTURE, uv + vec2(0, size.y)).a;
outline += texture(TEXTURE, uv + vec2(size.x, 0)).a;
outline += texture(TEXTURE, uv + vec2(0, -size.y)).a;
outline += texture(TEXTURE, uv + vec2(-size.x * 0.866, size.y * 0.5)).a;
outline += texture(TEXTURE, uv + vec2(-size.x * 0.5, size.y * 0.866)).a;
outline += texture(TEXTURE, uv + vec2(size.x * 0.866, size.y * 0.5)).a;
outline += texture(TEXTURE, uv + vec2(size.x * 0.5, size.y * 0.866)).a;
outline += texture(TEXTURE, uv + vec2(-size.x * 0.866, -size.y * 0.5)).a;
outline += texture(TEXTURE, uv + vec2(-size.x * 0.5, -size.y * 0.866)).a;
outline += texture(TEXTURE, uv + vec2(size.x * 0.866, -size.y * 0.5)).a;
outline += texture(TEXTURE, uv + vec2(size.x * 0.5, -size.y * 0.866)).a;
outline = min(outline, 1.0);
vec4 color = texture(TEXTURE, uv);
COLOR = mix(color, line_color, outline - color.a);
}
}

View file

@ -0,0 +1 @@
uid://dn25k1jjr1fdg

View file

@ -0,0 +1 @@
uid://cdj8qc2oip667

View file

@ -0,0 +1 @@
uid://k4ulede1bi4i

BIN
source/game_icon.psd (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ciyh3rnoo4uk"
path="res://.godot/imported/SimpleParticles_All_01_SPRT.png-6334fcb848493621387efb6556c81e19.ctex"
path="res://.godot/imported/SimpleParticles_All_01_SPRT.png-7694919abde183df9e6646702e07bee1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://extracted/Texture2D/SimpleParticles_All_01_SPRT.png"
dest_files=["res://.godot/imported/SimpleParticles_All_01_SPRT.png-6334fcb848493621387efb6556c81e19.ctex"]
source_file="res://textures/atlas/SimpleParticles_All_01_SPRT.png"
dest_files=["res://.godot/imported/SimpleParticles_All_01_SPRT.png-7694919abde183df9e6646702e07bee1.ctex"]
[params]

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dggavne4ueche"
path="res://.godot/imported/Tree_Field_01_SPRT.png-cf2a7d71334800fb9c2ea7c429535d5c.ctex"
path="res://.godot/imported/Tree_Field_01_SPRT.png-2a31f32b148af262ecdd14c661e63993.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://extracted/Texture2D/Tree_Field_01_SPRT.png"
dest_files=["res://.godot/imported/Tree_Field_01_SPRT.png-cf2a7d71334800fb9c2ea7c429535d5c.ctex"]
source_file="res://textures/sprites/Tree_Field_01_SPRT.png"
dest_files=["res://.godot/imported/Tree_Field_01_SPRT.png-2a31f32b148af262ecdd14c661e63993.ctex"]
[params]

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dkeu83h43pw1o"]
[ext_resource type="Texture2D" uid="uid://cxharyv0ajr37" path="res://textures/atlas/DioramaEntrance_All_01_SPRT.png" id="1_mxci2"]
[resource]
atlas = ExtResource("1_mxci2")
region = Rect2(7, 98, 220, 114)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bm2nsrfle5nsd"]
[ext_resource type="Texture2D" uid="uid://cxharyv0ajr37" path="res://textures/atlas/DioramaEntrance_All_01_SPRT.png" id="1_8pcct"]
[resource]
atlas = ExtResource("1_8pcct")
region = Rect2(252, 16, 108, 256)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://b2nhenx3l2uww"]
[ext_resource type="Texture2D" uid="uid://cxharyv0ajr37" path="res://textures/atlas/DioramaEntrance_All_01_SPRT.png" id="1_bsuil"]
[resource]
atlas = ExtResource("1_bsuil")
region = Rect2(0, 16, 228, 80)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://ddajgcwn5ip4c"]
[ext_resource type="Texture2D" uid="uid://cun14l52f477p" path="res://textures/atlas/Bushes_All_01_SPRT.png" id="1_o3c46"]
[resource]
atlas = ExtResource("1_o3c46")
region = Rect2(384, 64, 320, 224)

View file

@ -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)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dnomlcslicb3k"]
[ext_resource type="Texture2D" uid="uid://bwcex0o7obtg5" path="res://textures/atlas/Props_All_01_SPRT.png" id="1_12s0p"]
[resource]
atlas = ExtResource("1_12s0p")
region = Rect2(1824, 480, 192, 160)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://1qfjbuyf5aq5"]
[ext_resource type="Texture2D" uid="uid://b366mcexlko72" path="res://textures/atlas/LogsAndWood_All_01_SPRT.png" id="1_0edjn"]
[resource]
atlas = ExtResource("1_0edjn")
region = Rect2(544, 32, 160, 192)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bfnbnuclg8ab0"]
[ext_resource type="Texture2D" uid="uid://b366mcexlko72" path="res://textures/atlas/LogsAndWood_All_01_SPRT.png" id="1_686v7"]
[resource]
atlas = ExtResource("1_686v7")
region = Rect2(72, 1392, 216, 272)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://51ntd0qmjw5j"]
[ext_resource type="Texture2D" uid="uid://b366mcexlko72" path="res://textures/atlas/LogsAndWood_All_01_SPRT.png" id="1_tl1y6"]
[resource]
atlas = ExtResource("1_tl1y6")
region = Rect2(1356, 1216, 192, 80)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://c6acjgu8jnrkl"]
[ext_resource type="Texture2D" uid="uid://chuv25pm2vqen" path="res://textures/atlas/Rocks_All_01_SPRT.png" id="1_epk7g"]
[resource]
atlas = ExtResource("1_epk7g")
region = Rect2(1440, 1376, 256, 256)

View file

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cup0xru4j84wj"]
[ext_resource type="Texture2D" uid="uid://chuv25pm2vqen" path="res://textures/atlas/Rocks_All_01_SPRT.png" id="1_jaqtq"]
[resource]
atlas = ExtResource("1_jaqtq")
region = Rect2(288, 256, 192, 160)

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://xx3dwpwk467v"
path="res://.godot/imported/FireStickers.png-259d039f52ae610545db7b1f9c72e648.ctex"
path="res://.godot/imported/stickers_fire1.png-e93a337294878aa37d22daa3b5a89519.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://extracted/Texture2D/FireStickers.png"
dest_files=["res://.godot/imported/FireStickers.png-259d039f52ae610545db7b1f9c72e648.ctex"]
source_file="res://textures/sprites/stickers_fire1.png"
dest_files=["res://.godot/imported/stickers_fire1.png-e93a337294878aa37d22daa3b5a89519.ctex"]
[params]

View file

@ -0,0 +1 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="16" height="16"><style>.a{fill:#8da5f3}.b{fill:#515d88}</style><path fill-rule="evenodd" class="a" d="m44 4c2.1 0 4.2 0.4 6.1 1.2 2 0.8 3.7 2 5.2 3.5 1.5 1.5 2.7 3.2 3.5 5.2 0.8 1.9 1.2 4 1.2 6.1v9l-8.8 9.4c0.5-0.7 0.8-1.5 0.8-2.4v-8c0-1.1-0.4-2.1-1.2-2.8-0.7-0.8-1.7-1.2-2.8-1.2-1.1 0-2.1 0.4-2.8 1.2-0.8 0.7-1.2 1.7-1.2 2.8v8c0 1.1 0.4 2.1 1.2 2.8 0.7 0.8 1.7 1.2 2.8 1.2 1 0 1.9-0.4 2.6-1l-19.6 21h-11c-2.1 0-4.2-0.4-6.1-1.2-2-0.8-3.7-2-5.2-3.5-1.5-1.5-2.7-3.2-3.5-5.2-0.8-1.9-1.2-4-1.2-6.1v-24c0-2.1 0.4-4.2 1.2-6.1 0.8-2 2-3.7 3.5-5.2 1.5-1.5 3.2-2.7 5.2-3.5 1.9-0.8 4-1.2 6.1-1.2zm-32 32c0 1.1 0.4 2.1 1.2 2.8 0.7 0.8 1.7 1.2 2.8 1.2 1.1 0 2.1-0.4 2.8-1.2 0.8-0.7 1.2-1.7 1.2-2.8v-8c0-1.1-0.4-2.1-1.2-2.8-0.7-0.8-1.7-1.2-2.8-1.2-1.1 0-2.1 0.4-2.8 1.2-0.8 0.7-1.2 1.7-1.2 2.8zm38.6 3l0.6-0.6q-0.2 0.2-0.4 0.4-0.1 0.1-0.2 0.2zm-7.3 6.7c-0.8-0.7-1.8-1.2-2.8-1.2-1.1 0-2.1 0.4-2.8 1.2q-1.2 1.1-2.6 1.7-1.5 0.6-3.1 0.6-1.6 0-3.1-0.6-1.4-0.6-2.6-1.7c-0.7-0.8-1.7-1.2-2.8-1.2-1 0-2 0.5-2.8 1.2-0.7 0.7-1.1 1.7-1.1 2.8 0 1 0.4 2.1 1.1 2.8 1.5 1.5 3.2 2.7 5.2 3.5 1.9 0.8 4 1.2 6.1 1.2 2.1 0 12-9.6 11.3-10.3z"/><path class="b" d="m60.1 26.4c0 0-26.2-6.4-32.1 0.8-5.5 6.5-5.2 33.1-5.2 33.1l8.6-0.6 27.4-29z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bc22tbocdun87"
path="res://.godot/imported/icon_sticker2.svg-a942a9bf0ad4999d3046be6cf284193c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://textures/stickers/icon_sticker2.svg"
dest_files=["res://.godot/imported/icon_sticker2.svg-a942a9bf0ad4999d3046be6cf284193c.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false