Compare commits

..

6 commits

Author SHA1 Message Date
Lucas Peter
462bc799c3
update code editor window size 2024-07-30 18:19:54 +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
21 changed files with 113 additions and 30 deletions

View file

@ -33,15 +33,6 @@ func _process(_delta):
grabbedSticker.position = grabbedStickerOffset+get_global_mouse_position() grabbedSticker.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(): func pointcast():
resetCast() resetCast()
query.collide_with_areas = true query.collide_with_areas = true
@ -67,7 +58,7 @@ func pointcast():
if (hoveredObject and hoveredObject.has_method("on_hover")): if (hoveredObject and hoveredObject.has_method("on_hover")):
hoveredObject.on_hover() hoveredObject.on_hover()
print("Current hovered object :", hoveredObject) print("Current hovered object :", hoveredObject)
if (isSticker(hoveredObject)): if (Global.isSticker(hoveredObject)):
hoveredSticker = hoveredObject hoveredSticker = hoveredObject
print("Current hovered sticker :", hoveredSticker) print("Current hovered sticker :", hoveredSticker)
else: else:

View file

@ -51,6 +51,7 @@ animations = [{
[node name="Cursor" type="Node2D"] [node name="Cursor" type="Node2D"]
top_level = true top_level = true
z_index = 100
script = ExtResource("1_b5uuj") script = ExtResource("1_b5uuj")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]

View file

@ -4,7 +4,7 @@
resource_name = "bridge" resource_name = "bridge"
script/source = "extends Area2D script/source = "extends Area2D
var wallObject : Array var wallObjects : Array
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
@ -18,16 +18,18 @@ func _process(_delta):
func _on_body_entered(object): func _on_body_entered(object):
print(\"Entered %d\",object) print(\"Entered %d\",object)
if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" ): if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" and wallObjects != null ):
for _object in wallObject: for _object in wallObjects:
if (_object != null):
_object.process_mode = Node.PROCESS_MODE_DISABLED _object.process_mode = Node.PROCESS_MODE_DISABLED
else: else:
wallObject.append(object) wallObjects.append(object)
func _on_body_exited(object): func _on_body_exited(object):
if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" ): if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" and wallObjects != null ):
for _object in wallObject: for _object in wallObjects:
if (_object != null):
_object.process_mode = Node.PROCESS_MODE_INHERIT _object.process_mode = Node.PROCESS_MODE_INHERIT
" "

View file

@ -10,7 +10,7 @@ func _ready():
func _process(_delta): func _process(_delta):
pass pass
func getTags(selectedObject:Node): func get_tags(selectedObject:Node):
var _tags: Array var _tags: Array
if (selectedObject.has_meta("tags")): if (selectedObject.has_meta("tags")):
_tags = selectedObject.get_meta("tags") _tags = selectedObject.get_meta("tags")
@ -19,3 +19,25 @@ func getTags(selectedObject:Node):
printerr("no tags inside %",selectedObject) printerr("no tags inside %",selectedObject)
return _tags return _tags
func add_tags(selectedObject:Node,tags:Array):
var _all_tags:Array
if (selectedObject.has_meta("tags")):
_all_tags = selectedObject.get_meta("tags")
_all_tags.append(tags)
selectedObject.set_meta("tags",_all_tags)
func remove_tags(selectedObject:Node,tags:Array):
if (selectedObject.has_meta("tags")):
var _all_tags:Array
_all_tags = selectedObject.get_meta("tags")
for _tag in tags:
_all_tags.erase(_tag)
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

View file

@ -5,7 +5,8 @@ platform="Windows Desktop"
runnable=true runnable=true
dedicated_server=false dedicated_server=false
custom_features="" 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="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="builds/stickerClone.exe" export_path="builds/stickerClone.exe"
@ -68,7 +69,8 @@ platform="Linux/X11"
runnable=true runnable=true
dedicated_server=false dedicated_server=false
custom_features="" 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="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="builds/StickerClone.x86_64" export_path="builds/StickerClone.x86_64"

View file

@ -27,6 +27,8 @@ Cursor="*res://core/Cursor.tscn"
window/size/viewport_width=1920 window/size/viewport_width=1920
window/size/viewport_height=1080 window/size/viewport_height=1080
window/size/initial_position_type=2 window/size/initial_position_type=2
window/size/viewport_width.editor=1152
window/size/viewport_height.editor=648
[editor_plugins] [editor_plugins]

View file

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

View file

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

View file

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