Compare commits

..

1 commit
main ... wip

Author SHA1 Message Date
Fabien Freling
3a9568e527 remove dangling signals 2020-07-06 19:53:46 +02:00
49 changed files with 658 additions and 1141 deletions

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://suyulwtqoyec" path="res://.import/escher_convex_concave.jpg-aad7b984721eed80e7b3645478172e11.stex"
path="res://.godot/imported/escher_convex_concave.jpg-aad7b984721eed80e7b3645478172e11.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/artworks/escher_convex_concave.jpg" source_file="res://assets/artworks/escher_convex_concave.jpg"
dest_files=["res://.godot/imported/escher_convex_concave.jpg-aad7b984721eed80e7b3645478172e11.ctex"] dest_files=[ "res://.import/escher_convex_concave.jpg-aad7b984721eed80e7b3645478172e11.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://b87nwpig87ssi" path="res://.import/escher_lizards.jpg-6d8ffd09737747dd30c293cf429cf003.stex"
path="res://.godot/imported/escher_lizards.jpg-6d8ffd09737747dd30c293cf429cf003.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/artworks/escher_lizards.jpg" source_file="res://assets/artworks/escher_lizards.jpg"
dest_files=["res://.godot/imported/escher_lizards.jpg-6d8ffd09737747dd30c293cf429cf003.ctex"] dest_files=[ "res://.import/escher_lizards.jpg-6d8ffd09737747dd30c293cf429cf003.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://ch448afhj21kn" path="res://.import/hokusai.jpg-e34bef5c2c01e91fd3f7fbd65bf1bb63.stex"
path="res://.godot/imported/hokusai.jpg-e34bef5c2c01e91fd3f7fbd65bf1bb63.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/artworks/hokusai.jpg" source_file="res://assets/artworks/hokusai.jpg"
dest_files=["res://.godot/imported/hokusai.jpg-e34bef5c2c01e91fd3f7fbd65bf1bb63.ctex"] dest_files=[ "res://.import/hokusai.jpg-e34bef5c2c01e91fd3f7fbd65bf1bb63.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,34 +0,0 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://db83efud5yxsr"
path="res://.godot/imported/Montserrat-ExtraBold.otf-8b4f6e223c2354188bd56d5be1852439.fontdata"
[deps]
source_file="res://assets/fonts/Montserrat-ExtraBold.otf"
dest_files=["res://.godot/imported/Montserrat-ExtraBold.otf-8b4f6e223c2354188bd56d5be1852439.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -1,6 +1,6 @@
[gd_resource type="FontFile" load_steps=2 format=2] [gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://assets/fonts/Montserrat-ExtraBold.otf" type="FontFile" id=1] [ext_resource path="res://assets/fonts/Montserrat-ExtraBold.otf" type="DynamicFontData" id=1]
[resource] [resource]
size = 36 size = 36

File diff suppressed because one or more lines are too long

View file

@ -1,34 +0,0 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://dca4i4g8hysm5"
path="res://.godot/imported/OpenSans-ExtraBold.ttf-9d520f0ed8398261e18b9fe72a3be25c.fontdata"
[deps]
source_file="res://assets/fonts/OpenSans-ExtraBold.ttf"
dest_files=["res://.godot/imported/OpenSans-ExtraBold.ttf-9d520f0ed8398261e18b9fe72a3be25c.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

File diff suppressed because one or more lines are too long

View file

@ -1,34 +0,0 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://wyv0hst7dcve"
path="res://.godot/imported/OpenSans-SemiBold.ttf-15d8406842a575c8f65fb9c8990d4b7c.fontdata"
[deps]
source_file="res://assets/fonts/OpenSans-SemiBold.ttf"
dest_files=["res://.godot/imported/OpenSans-SemiBold.ttf-15d8406842a575c8f65fb9c8990d4b7c.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://divxq2g2ymkta" path="res://.import/icon_folder.png-b3a2a9bdd4c609fb3eeaba30c71ceb5a.stex"
path="res://.godot/imported/icon_folder.png-b3a2a9bdd4c609fb3eeaba30c71ceb5a.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/icon_folder.png" source_file="res://assets/icon_folder.png"
dest_files=["res://.godot/imported/icon_folder.png-b3a2a9bdd4c609fb3eeaba30c71ceb5a.ctex"] dest_files=[ "res://.import/icon_folder.png-b3a2a9bdd4c609fb3eeaba30c71ceb5a.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://cv2p52ibv3gwm" path="res://.import/icon_parent_folder.png-28fe9c21193d111a87cc30b6d49f5418.stex"
path="res://.godot/imported/icon_parent_folder.png-28fe9c21193d111a87cc30b6d49f5418.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/icon_parent_folder.png" source_file="res://assets/icon_parent_folder.png"
dest_files=["res://.godot/imported/icon_parent_folder.png-28fe9c21193d111a87cc30b6d49f5418.ctex"] dest_files=[ "res://.import/icon_parent_folder.png-28fe9c21193d111a87cc30b6d49f5418.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://doxhwehu0cjd8" path="res://.import/logo.svg-f0fea7f4c0900e3cf3563bd5e43c48d1.stex"
path="res://.godot/imported/logo.svg-f0fea7f4c0900e3cf3563bd5e43c48d1.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,27 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/logo/logo.svg" source_file="res://assets/logo/logo.svg"
dest_files=["res://.godot/imported/logo.svg-f0fea7f4c0900e3cf3563bd5e43c48d1.ctex"] dest_files=[ "res://.import/logo.svg-f0fea7f4c0900e3cf3563bd5e43c48d1.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0 svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://b4tk1p7iwg8ev" path="res://.import/logo_512.png-52e0380d6068282002ce7e4da540a4c8.stex"
path="res://.godot/imported/logo_512.png-52e0380d6068282002ce7e4da540a4c8.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/logo/logo_512.png" source_file="res://assets/logo/logo_512.png"
dest_files=["res://.godot/imported/logo_512.png-52e0380d6068282002ce7e4da540a4c8.ctex"] dest_files=[ "res://.import/logo_512.png-52e0380d6068282002ce7e4da540a4c8.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://dtcqacnu1f0y6" path="res://.import/logo_android_192.png-d1092f8bdc9b8ae234b5684d3089068d.stex"
path="res://.godot/imported/logo_android_192.png-d1092f8bdc9b8ae234b5684d3089068d.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/logo/logo_android_192.png" source_file="res://assets/logo/logo_android_192.png"
dest_files=["res://.godot/imported/logo_android_192.png-d1092f8bdc9b8ae234b5684d3089068d.ctex"] dest_files=[ "res://.import/logo_android_192.png-d1092f8bdc9b8ae234b5684d3089068d.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://cmcuio5kms1w7" path="res://.import/logo_android_bg_432.png-bed8240198b34da49346f00ca02dd189.stex"
path="res://.godot/imported/logo_android_bg_432.png-bed8240198b34da49346f00ca02dd189.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/logo/logo_android_bg_432.png" source_file="res://assets/logo/logo_android_bg_432.png"
dest_files=["res://.godot/imported/logo_android_bg_432.png-bed8240198b34da49346f00ca02dd189.ctex"] dest_files=[ "res://.import/logo_android_bg_432.png-bed8240198b34da49346f00ca02dd189.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://bded64ix0xlha" path="res://.import/logo_android_fg_432.png-41c23e93a296f808ef139e74532dbbec.stex"
path="res://.godot/imported/logo_android_fg_432.png-41c23e93a296f808ef139e74532dbbec.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://assets/logo/logo_android_fg_432.png" source_file="res://assets/logo/logo_android_fg_432.png"
dest_files=["res://.godot/imported/logo_android_fg_432.png-41c23e93a296f808ef139e74532dbbec.ctex"] dest_files=[ "res://.import/logo_android_fg_432.png-41c23e93a296f808ef139e74532dbbec.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -1,14 +1,13 @@
[remap] [remap]
importer="wav" importer="wav"
type="AudioStreamWAV" type="AudioStreamSample"
uid="uid://bucgw5g1qhd25" path="res://.import/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav-b392178f8c17e091ceb27ba6c6715408.sample"
path="res://.godot/imported/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav-b392178f8c17e091ceb27ba6c6715408.sample"
[deps] [deps]
source_file="res://assets/sounds/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav" source_file="res://assets/sounds/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav"
dest_files=["res://.godot/imported/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav-b392178f8c17e091ceb27ba6c6715408.sample"] dest_files=[ "res://.import/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav-b392178f8c17e091ceb27ba6c6715408.sample" ]
[params] [params]
@ -18,7 +17,5 @@ force/max_rate=false
force/max_rate_hz=44100 force/max_rate_hz=44100
edit/trim=false edit/trim=false
edit/normalize=false edit/normalize=false
edit/loop_mode=0 edit/loop=false
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0 compress/mode=0

View file

@ -1,14 +1,13 @@
[remap] [remap]
importer="wav" importer="wav"
type="AudioStreamWAV" type="AudioStreamSample"
uid="uid://6prruwyafod2" path="res://.import/button_down.wav-42814080afc0d5a0c8dc6a3e923f8da2.sample"
path="res://.godot/imported/button_down.wav-42814080afc0d5a0c8dc6a3e923f8da2.sample"
[deps] [deps]
source_file="res://assets/sounds/button_down.wav" source_file="res://assets/sounds/button_down.wav"
dest_files=["res://.godot/imported/button_down.wav-42814080afc0d5a0c8dc6a3e923f8da2.sample"] dest_files=[ "res://.import/button_down.wav-42814080afc0d5a0c8dc6a3e923f8da2.sample" ]
[params] [params]
@ -18,7 +17,5 @@ force/max_rate=false
force/max_rate_hz=44100 force/max_rate_hz=44100
edit/trim=false edit/trim=false
edit/normalize=false edit/normalize=false
edit/loop_mode=0 edit/loop=false
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0 compress/mode=0

View file

@ -1,14 +1,13 @@
[remap] [remap]
importer="wav" importer="wav"
type="AudioStreamWAV" type="AudioStreamSample"
uid="uid://d2bcr15fhsxig" path="res://.import/button_up.wav-ec2800f415eaeb69cc2da5cd45fee5fc.sample"
path="res://.godot/imported/button_up.wav-ec2800f415eaeb69cc2da5cd45fee5fc.sample"
[deps] [deps]
source_file="res://assets/sounds/button_up.wav" source_file="res://assets/sounds/button_up.wav"
dest_files=["res://.godot/imported/button_up.wav-ec2800f415eaeb69cc2da5cd45fee5fc.sample"] dest_files=[ "res://.import/button_up.wav-ec2800f415eaeb69cc2da5cd45fee5fc.sample" ]
[params] [params]
@ -18,7 +17,5 @@ force/max_rate=false
force/max_rate_hz=44100 force/max_rate_hz=44100
edit/trim=false edit/trim=false
edit/normalize=false edit/normalize=false
edit/loop_mode=0 edit/loop=false
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0 compress/mode=0

View file

@ -1,14 +1,13 @@
[remap] [remap]
importer="wav" importer="wav"
type="AudioStreamWAV" type="AudioStreamSample"
uid="uid://bknild65hxpvb" path="res://.import/lock_01.wav-54ccea9628672d8dd2a49ea43a3b9c4b.sample"
path="res://.godot/imported/lock_01.wav-54ccea9628672d8dd2a49ea43a3b9c4b.sample"
[deps] [deps]
source_file="res://assets/sounds/lock_01.wav" source_file="res://assets/sounds/lock_01.wav"
dest_files=["res://.godot/imported/lock_01.wav-54ccea9628672d8dd2a49ea43a3b9c4b.sample"] dest_files=[ "res://.import/lock_01.wav-54ccea9628672d8dd2a49ea43a3b9c4b.sample" ]
[params] [params]
@ -18,7 +17,5 @@ force/max_rate=false
force/max_rate_hz=44100 force/max_rate_hz=44100
edit/trim=false edit/trim=false
edit/normalize=false edit/normalize=false
edit/loop_mode=0 edit/loop=false
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0 compress/mode=0

View file

@ -1,62 +1,62 @@
[gd_resource type="Theme" load_steps=8 format=3 uid="uid://b7gu1bjpj8ixp"] [gd_resource type="Theme" load_steps=8 format=2]
[ext_resource type="FontFile" uid="uid://dys5hkbvmolh2" path="res://assets/fonts/OpenSans-SemiBold-24.tres" id="1"] [ext_resource path="res://assets/fonts/OpenSans-SemiBold-24.tres" type="DynamicFont" id=1]
[sub_resource type="StyleBoxFlat" id="1"] [sub_resource type="StyleBoxFlat" id=1]
bg_color = Color(0.12549, 0.235294, 0.337255, 1) bg_color = Color( 0.12549, 0.235294, 0.337255, 1 )
[sub_resource type="StyleBoxFlat" id="2"] [sub_resource type="StyleBoxFlat" id=2]
bg_color = Color(0.12549, 0.235294, 0.337255, 1) bg_color = Color( 0.12549, 0.235294, 0.337255, 1 )
[sub_resource type="StyleBoxFlat" id="3"] [sub_resource type="StyleBoxFlat" id=3]
bg_color = Color(0.12549, 0.235294, 0.337255, 1) bg_color = Color( 0.12549, 0.235294, 0.337255, 1 )
[sub_resource type="StyleBoxFlat" id="4"] [sub_resource type="StyleBoxFlat" id=4]
bg_color = Color(0.0509804, 0.168627, 0.270588, 1) bg_color = Color( 0.0509804, 0.168627, 0.270588, 1 )
[sub_resource type="StyleBoxFlat" id="5"] [sub_resource type="StyleBoxFlat" id=5]
bg_color = Color(1, 0.831373, 0.639216, 1) bg_color = Color( 1, 0.831373, 0.639216, 1 )
[sub_resource type="StyleBoxFlat" id="6"] [sub_resource type="StyleBoxFlat" id=6]
bg_color = Color(1, 0.831373, 0.639216, 1) bg_color = Color( 1, 0.831373, 0.639216, 1 )
border_width_left = 4 border_width_left = 4
border_width_top = 4 border_width_top = 4
border_width_right = 4 border_width_right = 4
border_width_bottom = 4 border_width_bottom = 4
border_color = Color(0.12549, 0.235294, 0.337255, 1) border_color = Color( 0.12549, 0.235294, 0.337255, 1 )
corner_radius_top_left = 20 corner_radius_top_left = 20
corner_radius_top_right = 20 corner_radius_top_right = 20
corner_radius_bottom_right = 20 corner_radius_bottom_right = 20
corner_radius_bottom_left = 20 corner_radius_bottom_left = 20
shadow_size = 5 shadow_size = 5
shadow_offset = Vector2(0, 5) shadow_offset = Vector2( 0, 5 )
[resource] [resource]
default_font = ExtResource("1") default_font = ExtResource( 1 )
Button/colors/font_color = Color(0.815686, 0.505882, 0.34902, 1) Button/colors/font_color = Color( 0.815686, 0.505882, 0.34902, 1 )
Button/colors/font_color_disabled = Color(0.9, 0.9, 0.9, 0.2) Button/colors/font_color_disabled = Color( 0.9, 0.9, 0.9, 0.2 )
Button/colors/font_color_hover = Color(1, 0.92549, 0.839216, 1) Button/colors/font_color_hover = Color( 1, 0.92549, 0.839216, 1 )
Button/colors/font_color_pressed = Color(1, 0.92549, 0.839216, 1) Button/colors/font_color_pressed = Color( 1, 0.92549, 0.839216, 1 )
Button/constants/hseparation = 2 Button/constants/hseparation = 2
Button/fonts/font = ExtResource("1") Button/fonts/font = null
Button/styles/disabled = null Button/styles/disabled = null
Button/styles/focus = SubResource("1") Button/styles/focus = SubResource( 1 )
Button/styles/hover = SubResource("2") Button/styles/hover = SubResource( 2 )
Button/styles/normal = SubResource("3") Button/styles/normal = SubResource( 3 )
Button/styles/pressed = SubResource("4") Button/styles/pressed = SubResource( 4 )
LineEdit/colors/clear_button_color = Color(0.88, 0.88, 0.88, 1) LineEdit/colors/clear_button_color = Color( 0.88, 0.88, 0.88, 1 )
LineEdit/colors/clear_button_color_pressed = Color(1, 1, 1, 1) LineEdit/colors/clear_button_color_pressed = Color( 1, 1, 1, 1 )
LineEdit/colors/cursor_color = Color(0.94, 0.94, 0.94, 1) LineEdit/colors/cursor_color = Color( 0.94, 0.94, 0.94, 1 )
LineEdit/colors/font_color = Color(0.88, 0.88, 0.88, 1) LineEdit/colors/font_color = Color( 0.88, 0.88, 0.88, 1 )
LineEdit/colors/font_color_selected = Color(0, 0, 0, 1) LineEdit/colors/font_color_selected = Color( 0, 0, 0, 1 )
LineEdit/colors/font_color_uneditable = Color(0.88, 0.88, 0.88, 0.5) LineEdit/colors/font_color_uneditable = Color( 0.88, 0.88, 0.88, 0.5 )
LineEdit/colors/selection_color = Color(0.49, 0.49, 0.49, 1) LineEdit/colors/selection_color = Color( 0.49, 0.49, 0.49, 1 )
LineEdit/constants/minimum_spaces = 8 LineEdit/constants/minimum_spaces = 8
LineEdit/fonts/font = ExtResource("1") LineEdit/fonts/font = null
LineEdit/icons/clear = null LineEdit/icons/clear = null
LineEdit/styles/focus = null LineEdit/styles/focus = null
LineEdit/styles/normal = null LineEdit/styles/normal = null
LineEdit/styles/read_only = null LineEdit/styles/read_only = null
Panel/styles/panel = SubResource("5") Panel/styles/panel = SubResource( 5 )
PopupPanel/styles/panel = SubResource("6") PopupPanel/styles/panel = SubResource( 6 )
SpinBox/icons/updown = null SpinBox/icons/updown = null

View file

@ -1,7 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=3 uid="uid://67k71jff03ue"] [gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="Sky" id="1"] [sub_resource type="ProceduralSky" id=1]
[resource] [resource]
background_mode = 2 background_mode = 2
sky = SubResource("1") background_sky = SubResource( 1 )

27
flake.lock generated
View file

@ -1,27 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1764642553,
"narHash": "sha256-mvbFFzVBhVK1FjyPHZGMAKpNiqkr7k++xIwy+p/NQvA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f720de59066162ee879adcc8c79e15c51fe6bfb4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,37 +0,0 @@
{
description = "Taqin";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs =
inputs@{ nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
formatter.${system} = pkgs.nixfmt-rfc-style;
devShell.${system} =
with pkgs;
mkShell {
LD_LIBRARY_PATH = lib.makeLibraryPath [ stdenv.cc.cc ]; # For libstdc++.so.6
# ANDROID_HOME = "${androidenv.androidPkgs_9_0.androidsdk}/libexec/android-sdk";
nativeBuildInputs = [
clang
just
godot_4
android-tools
# androidenv.androidPkgs_9_0.androidsdk
# androidenv.androidPkgs_9_0.platform-tools
jre_headless
];
};
};
}

View file

@ -1,9 +1,8 @@
[remap] [remap]
importer="texture" importer="texture"
type="CompressedTexture2D" type="StreamTexture"
uid="uid://dhn5unukdotkl" path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
@ -11,24 +10,25 @@ metadata={
[deps] [deps]
source_file="res://icon.png" source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"] dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 flags/repeat=0
mipmaps/generate=false flags/filter=true
mipmaps/limit=-1 flags/mipmaps=false
roughness/mode=0 flags/anisotropic=false
roughness/src_normal="" flags/srgb=2
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/HDR_as_SRGB=false
process/hdr_as_srgb=false process/invert_color=false
process/hdr_clamp_exposure=false stream=false
process/size_limit=0 size_limit=0
detect_3d/compress_to=1 detect_3d=true
svg/scale=1.0

View file

@ -6,13 +6,46 @@
; [section] ; section goes between [] ; [section] ; section goes between []
; param=value ; assign values to parameters ; param=value ; assign values to parameters
config_version=5 config_version=4
_global_script_classes=[ {
"base": "Control",
"class": "DepthButton",
"language": "GDScript",
"path": "res://src/DepthButton.gd"
}, {
"base": "Panel",
"class": "ImagePicker",
"language": "GDScript",
"path": "res://src/ImagePicker.gd"
}, {
"base": "PopupPanel",
"class": "NewGamePanel",
"language": "GDScript",
"path": "res://src/NewGamePanel.gd"
}, {
"base": "Node2D",
"class": "Piece",
"language": "GDScript",
"path": "res://src/Piece.gd"
}, {
"base": "Control",
"class": "Taquin",
"language": "GDScript",
"path": "res://src/Taquin.gd"
} ]
_global_script_class_icons={
"DepthButton": "",
"ImagePicker": "",
"NewGamePanel": "",
"Piece": "",
"Taquin": ""
}
[application] [application]
config/name="Taqin" config/name="Taqin"
run/main_scene="res://src/Main.tscn" run/main_scene="res://src/Main.tscn"
config/features=PackedStringArray("4.3")
config/icon="res://assets/logo/logo_512.png" config/icon="res://assets/logo/logo_512.png"
[autoload] [autoload]
@ -22,12 +55,13 @@ Styles="*res://src/Styles.gd"
[display] [display]
window/size/resizable=false window/size/resizable=false
window/size/window_width_override=600 window/size/test_width=600
window/size/window_height_override=1200 window/size/test_height=1200
window/dpi/allow_hidpi=true
window/energy_saving/keep_screen_on=false window/energy_saving/keep_screen_on=false
window/handheld/orientation="portrait" window/handheld/orientation="portrait"
window/size/viewport_width.mobile=600 window/size/width.mobile=600
window/size/viewport_height.mobile=1200 window/size/height.mobile=1200
window/stretch/aspect.mobile="expand" window/stretch/aspect.mobile="expand"
window/stretch/mode.mobile="2d" window/stretch/mode.mobile="2d"
@ -37,8 +71,8 @@ import/open_asset_import/use_fbx=false
[gui] [gui]
theme/custom="res://assets/taqin_theme.tres"
theme/use_hidpi=true theme/use_hidpi=true
theme/custom="res://assets/taqin_theme.tres"
[input_devices] [input_devices]
@ -46,5 +80,4 @@ pointing/emulate_touch_from_mouse=true
[rendering] [rendering]
renderer/rendering_method="mobile" environment/default_environment="res://default_env.tres"
environment/defaults/default_environment="res://default_env.tres"

View file

@ -1,4 +1,4 @@
@tool tool
class_name DepthButton class_name DepthButton
extends Control extends Control
@ -7,37 +7,37 @@ signal button_down()
signal button_up() signal button_up()
signal toggled() signal toggled()
@export var text := "" export var text := ""
@export var corner_type = Styles.CornerType.SINGLE # (Styles.CornerType) export(Styles.CornerType) var corner_type = Styles.CornerType.SINGLE
@export var corner_radius := 10 export var corner_radius := 10
@export var depth := 10 export var depth := 10
@export var toggle_mode := false export var toggle_mode := false
@export var group: ButtonGroup export var group: ButtonGroup
var pressed_state : get = is_pressed, set = set_pressed var pressed setget set_pressed, is_pressed
var _pressed_depth := 4 var _pressed_depth := 4
var _toggled := false var _toggled := false
var _toggled_depth := _pressed_depth + 3 var _toggled_depth := _pressed_depth + 3
@onready var background := $Background onready var background := $Background
@onready var button: Button = $Button onready var button: Button = $Button
func _ready(): func _ready():
assert(_toggled_depth > _pressed_depth) assert(_toggled_depth > _pressed_depth)
button.text = text button.text = text
button.offset_bottom = -depth button.margin_bottom = -depth
button.toggle_mode = toggle_mode button.toggle_mode = toggle_mode
#button.group = group button.group = group
button.size.y = size.y - depth button.rect_size.y = rect_size.y - depth
# #
# Styles # Styles
# #
var background_style := Styles.get_stylebox_flat(background.get_theme_stylebox("panel", "panel"), "button_background", corner_type) var background_style := Styles.get_stylebox_flat(background.get_stylebox("panel", "panel"), "button_background", corner_type)
background_style.set_bg_color(Color(0.73, 0.35, 0.13)) background_style.set_bg_color(Color(0.73, 0.35, 0.13))
background.set('theme_override_styles/panel', background_style) background.set('custom_styles/panel', background_style)
match corner_type: match corner_type:
Styles.CornerType.SINGLE: Styles.CornerType.SINGLE:
background_style.corner_radius_bottom_left = corner_radius background_style.corner_radius_bottom_left = corner_radius
@ -54,7 +54,7 @@ func _ready():
for style_name in ["normal", "hover", "focus", "pressed"]: for style_name in ["normal", "hover", "focus", "pressed"]:
var original_style = button.get_theme_stylebox(style_name) var original_style = button.get_stylebox(style_name)
# print_debug("style for ", style_name, ": ", original_style) # print_debug("style for ", style_name, ": ", original_style)
var stylebox := Styles.get_stylebox_flat(original_style, style_name, corner_type) var stylebox := Styles.get_stylebox_flat(original_style, style_name, corner_type)
button.set("custom_styles/%s" % style_name, stylebox) button.set("custom_styles/%s" % style_name, stylebox)
@ -91,15 +91,15 @@ func set_pressed(value: bool) -> void:
# Signals # Signals
# #
func _on_Button_button_down(): func _on_Button_button_down():
button.position.y = depth - _pressed_depth button.rect_position.y = depth - _pressed_depth
$AudioDown.play() $AudioDown.play()
emit_signal("button_down") emit_signal("button_down")
func _on_Button_button_up(): func _on_Button_button_up():
if _toggled: if _toggled:
button.position.y = depth - _toggled_depth button.rect_position.y = depth - _toggled_depth
else: else:
button.position.y = 0 button.rect_position.y = 0
$AudioUp.play() $AudioUp.play()
emit_signal("button_up") emit_signal("button_up")
@ -108,9 +108,9 @@ func _on_Button_toggled(button_pressed):
return return
if button_pressed: if button_pressed:
button.position.y = depth - _toggled_depth button.rect_position.y = depth - _toggled_depth
else: else:
button.position.y = 0 button.rect_position.y = 0
_toggled = button_pressed _toggled = button_pressed
emit_signal("toggled", _toggled) emit_signal("toggled", _toggled)

View file

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

View file

@ -8,9 +8,9 @@
[node name="DepthButton" type="Control"] [node name="DepthButton" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_right = -732.0 margin_right = -732.0
offset_bottom = -452.0 margin_bottom = -452.0
custom_minimum_size = Vector2( 200, 80 ) rect_min_size = Vector2( 200, 80 )
theme = ExtResource( 1 ) theme = ExtResource( 1 )
script = ExtResource( 2 ) script = ExtResource( 2 )
__meta__ = { __meta__ = {
@ -30,7 +30,7 @@ __meta__ = {
[node name="Button" type="Button" parent="."] [node name="Button" type="Button" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_bottom = -10.0 margin_bottom = -10.0
text = "Press Me" text = "Press Me"
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false

View file

@ -5,29 +5,28 @@ signal texture_selected(texture)
var _parent_display_name := "<parent directory>" var _parent_display_name := "<parent directory>"
var _sep := "/" var _sep := "/"
var _dir : DirAccess var _dir := Directory.new()
@export var root_dir: String export var root_dir: String
@export var walkable := false export var walkable := false
@export var folder_texture: Texture2D = null export var folder_texture: Texture = null
@export var parent_folder_texture: Texture2D = null export var parent_folder_texture: Texture = null
func _ready(): func _ready():
print_debug("root dir: ", root_dir) print_debug("root dir: ", root_dir)
if root_dir != null and not root_dir.is_empty(): if root_dir != null and not root_dir.empty():
populate(root_dir) populate(root_dir)
func populate(dir: String) -> void: func populate(dir: String) -> void:
print_debug("populate ", dir) print_debug("populate ", dir)
clear() clear()
_dir = DirAccess.open(dir) if _dir.change_dir(dir) != OK:
if !_dir:
print_debug("Cannot open path ", dir) print_debug("Cannot open path ", dir)
assert(false) assert(false)
return return
_dir.list_dir_begin() # TODOConverter3To4 fill missing arguments https://github.com/godotengine/godot/pull/40547 _dir.list_dir_begin()
var file_name := _dir.get_next() var file_name := _dir.get_next()
while file_name != "": while file_name != "":
if _dir.current_is_dir(): if _dir.current_is_dir():

View file

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

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://src/FileList.gd" type="Script" id=1] [ext_resource path="res://src/FileList.gd" type="Script" id=1]
[ext_resource path="res://assets/icon_parent_folder.png" type="Texture2D" id=2] [ext_resource path="res://assets/icon_parent_folder.png" type="Texture" id=2]
[ext_resource path="res://assets/icon_folder.png" type="Texture2D" id=3] [ext_resource path="res://assets/icon_folder.png" type="Texture" id=3]
[node name="FileList" type="ItemList"] [node name="FileList" type="ItemList"]
anchor_right = 1.0 anchor_right = 1.0

View file

@ -1,4 +1,4 @@
@tool tool
class_name ImagePicker class_name ImagePicker
extends Panel extends Panel
@ -8,7 +8,7 @@ signal canceled()
var _fs_tab_index := 1 var _fs_tab_index := 1
@onready var fs_list := $VBoxContainer/TabContainer/Filesystem/FileList onready var fs_list := $VBoxContainer/TabContainer/Filesystem/FileList
func _ready(): func _ready():
# TODO: fix Android # TODO: fix Android

View file

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

View file

@ -2,9 +2,9 @@
[ext_resource path="res://src/ImagePicker.gd" type="Script" id=1] [ext_resource path="res://src/ImagePicker.gd" type="Script" id=1]
[ext_resource path="res://src/FileList.tscn" type="PackedScene" id=2] [ext_resource path="res://src/FileList.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/artworks/hokusai.jpg" type="Texture2D" id=3] [ext_resource path="res://assets/artworks/hokusai.jpg" type="Texture" id=3]
[ext_resource path="res://assets/artworks/escher_convex_concave.jpg" type="Texture2D" id=4] [ext_resource path="res://assets/artworks/escher_convex_concave.jpg" type="Texture" id=4]
[ext_resource path="res://assets/artworks/escher_lizards.jpg" type="Texture2D" id=5] [ext_resource path="res://assets/artworks/escher_lizards.jpg" type="Texture" id=5]
[node name="ImagePicker" type="Panel"] [node name="ImagePicker" type="Panel"]
anchor_right = 1.0 anchor_right = 1.0
@ -17,29 +17,29 @@ __meta__ = {
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
clip_contents = true rect_clip_content = true
alignment = 1 alignment = 1
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="TabContainer" type="TabContainer" parent="VBoxContainer"] [node name="TabContainer" type="TabContainer" parent="VBoxContainer"]
offset_right = 1024.0 margin_right = 1024.0
offset_bottom = 512.0 margin_bottom = 512.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="App" type="TabBar" parent="VBoxContainer/TabContainer"] [node name="App" type="Tabs" parent="VBoxContainer/TabContainer"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_left = 8.0 margin_left = 8.0
offset_top = 61.0 margin_top = 61.0
offset_right = -8.0 margin_right = -8.0
offset_bottom = -8.0 margin_bottom = -8.0
clip_contents = true rect_clip_content = true
[node name="FileList" parent="VBoxContainer/TabContainer/App" instance=ExtResource( 2 )] [node name="FileList" parent="VBoxContainer/TabContainer/App" instance=ExtResource( 2 )]
items = [ "", ExtResource( 4 ), false, "", ExtResource( 5 ), false, "", ExtResource( 3 ), false ] items = [ "", ExtResource( 4 ), false, "", ExtResource( 5 ), false, "", ExtResource( 3 ), false ]
@ -47,31 +47,29 @@ root_dir = ""
folder_texture = null folder_texture = null
parent_folder_texture = null parent_folder_texture = null
[node name="Filesystem" type="TabBar" parent="VBoxContainer/TabContainer"] [node name="Filesystem" type="Tabs" parent="VBoxContainer/TabContainer"]
visible = false visible = false
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_left = 8.0 margin_left = 8.0
offset_top = 61.0 margin_top = 61.0
offset_right = -8.0 margin_right = -8.0
offset_bottom = -8.0 margin_bottom = -8.0
[node name="FileList" parent="VBoxContainer/TabContainer/Filesystem" instance=ExtResource( 2 )] [node name="FileList" parent="VBoxContainer/TabContainer/Filesystem" instance=ExtResource( 2 )]
root_dir = "" root_dir = ""
walkable = true walkable = true
[node name="Cancel" type="Button" parent="VBoxContainer"] [node name="Cancel" type="Button" parent="VBoxContainer"]
offset_top = 520.0 margin_top = 520.0
offset_right = 1024.0 margin_right = 1024.0
offset_bottom = 600.0 margin_bottom = 600.0
custom_minimum_size = Vector2( 0, 80 ) rect_min_size = Vector2( 0, 80 )
text = "Cancel" text = "Cancel"
flat = true flat = true
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[connection signal="item_rect_changed" from="." to="." method="_on_ImagePicker_item_rect_changed"]
[connection signal="resized" from="." to="." method="_on_ImagePicker_resized"]
[connection signal="texture_selected" from="VBoxContainer/TabContainer/App/FileList" to="." method="_on_FileList_texture_selected"] [connection signal="texture_selected" from="VBoxContainer/TabContainer/App/FileList" to="." method="_on_FileList_texture_selected"]
[connection signal="file_selected" from="VBoxContainer/TabContainer/Filesystem/FileList" to="." method="_on_FileList_file_selected"] [connection signal="file_selected" from="VBoxContainer/TabContainer/Filesystem/FileList" to="." method="_on_FileList_file_selected"]
[connection signal="pressed" from="VBoxContainer/Cancel" to="." method="_on_Cancel_pressed"] [connection signal="pressed" from="VBoxContainer/Cancel" to="." method="_on_Cancel_pressed"]

View file

@ -1,19 +1,19 @@
extends Control extends Control
@onready var container = $GridContainer onready var container = $GridContainer
@onready var taquin = $GridContainer/Taquin onready var taquin = $GridContainer/Taquin
var _first_popup_call := true var _first_popup_call := true
func _ready(): func _ready():
taquin.custom_minimum_size = get_viewport().get_visible_rect().size * (2.0 / 3.0) taquin.rect_min_size = get_viewport().get_visible_rect().size * (2.0 / 3.0)
layout_reflow() layout_reflow()
if not load_game(): if not load_game():
start_fresh() start_fresh()
print("Starting state: ", taquin.current_state_name()) print("Starting state: ", taquin.current_state_name())
func _notification(what): func _notification(what):
if what == NOTIFICATION_WM_CLOSE_REQUEST: if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:
save_game() save_game()
get_tree().quit() # default behavior get_tree().quit() # default behavior
@ -25,17 +25,18 @@ func layout_reflow():
if container == null: if container == null:
return return
if container.size.x < container.size.y: if container.rect_size.x < container.rect_size.y:
# portrait # portrait
container.columns = 1 container.columns = 1
else: else:
# landscape # landscape
container.columns = 2 container.columns = 2
#update() update()
# https://docs.godotengine.org/en/stable/tutorials/io/saving_games.html # https://docs.godotengine.org/en/3.2/tutorials/io/saving_games.html
func save_game(): func save_game():
var save_file = FileAccess.open("user://savegame.save", FileAccess.WRITE) var save_game = File.new()
save_game.open("user://savegame.save", File.WRITE)
var save_nodes = get_tree().get_nodes_in_group("Persist") var save_nodes = get_tree().get_nodes_in_group("Persist")
for node in save_nodes: for node in save_nodes:
# Check the node has a save function # Check the node has a save function
@ -50,21 +51,20 @@ func save_game():
node_data["path"] = node.get_path() node_data["path"] = node.get_path()
# Store the save dictionary as a new line in the save file # Store the save dictionary as a new line in the save file
save_file.store_line(JSON.stringify(node_data)) save_game.store_line(to_json(node_data))
save_file.close() save_game.close()
func load_game(): func load_game():
if not FileAccess.file_exists("user://savegame.save"): var save_game = File.new()
return # Error! We don't have a save to load. if not save_game.file_exists("user://savegame.save"):
return false # Error! We don't have a save to load.
# Load the file line by line and process that dictionary to restore # Load the file line by line and process that dictionary to restore
# the object it represents. # the object it represents.
var save_file = FileAccess.open("user://savegame.save", FileAccess.READ) save_game.open("user://savegame.save", File.READ)
while save_file.get_position() < save_file.get_length(): while save_game.get_position() < save_game.get_len():
# Get the saved dictionary from the next line in the save file # Get the saved dictionary from the next line in the save file
var test_json_conv = JSON.new() var node_data = parse_json(save_game.get_line())
test_json_conv.parse(save_file.get_line())
var node_data = test_json_conv.get_data()
# Call the node's save function # Call the node's save function
var node = get_node(node_data["path"]) var node = get_node(node_data["path"])
@ -74,7 +74,7 @@ func load_game():
else: else:
print("Cannot load node ", node_data["path"]) print("Cannot load node ", node_data["path"])
save_file.close() save_game.close()
return true return true
func start_fresh(): func start_fresh():
@ -84,15 +84,15 @@ func start_fresh():
# Signals # Signals
# #
func _on_Taquin_state_changed(previous, new): func _on_Taquin_state_changed(previous, new):
print("Taquin state: ", taquin.State.keys()[previous], " -> ", taquin.State.keys()[new]) print("Taquin state: ", Taquin.State.keys()[previous], " -> ", Taquin.State.keys()[new])
match new: match new:
taquin.State.WINNING: Taquin.State.WINNING:
print("Solved!") print("Solved!")
taquin.State.GAME_OVER: Taquin.State.GAME_OVER:
pass pass
func _on_New_game_pressed(): func _on_New_game_pressed():
$NewGamePanel.position = Vector2.ZERO $NewGamePanel.rect_position = Vector2.ZERO
if _first_popup_call: if _first_popup_call:
# We only call popup_centered() once, otherwise the popup shifts to the # We only call popup_centered() once, otherwise the popup shifts to the
# bottom right after each call. # bottom right after each call.

View file

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

View file

@ -1,62 +1,85 @@
[gd_scene load_steps=6 format=3 uid="uid://cj4uqgtnylppu"] [gd_scene load_steps=6 format=2]
[ext_resource type="Script" uid="uid://rn30misiiww4" path="res://src/Main.gd" id="1"] [ext_resource path="res://src/Main.gd" type="Script" id=1]
[ext_resource type="PackedScene" path="res://src/Taquin.tscn" id="2"] [ext_resource path="res://src/Taquin.tscn" type="PackedScene" id=2]
[ext_resource type="PackedScene" path="res://src/NewGamePanel.tscn" id="3"] [ext_resource path="res://src/NewGamePanel.tscn" type="PackedScene" id=3]
[ext_resource type="PackedScene" path="res://src/DepthButton.tscn" id="4"] [ext_resource path="res://src/DepthButton.tscn" type="PackedScene" id=4]
[ext_resource type="Theme" uid="uid://b7gu1bjpj8ixp" path="res://assets/taqin_theme.tres" id="5"] [ext_resource path="res://assets/taqin_theme.tres" type="Theme" id=5]
[node name="Main" type="Control"] [node name="Main" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 theme = ExtResource( 5 )
grow_vertical = 2 script = ExtResource( 1 )
theme = ExtResource("5") __meta__ = {
script = ExtResource("1") "_edit_use_anchors_": false
}
[node name="Background" type="Panel" parent="."] [node name="Background" type="Panel" parent="."]
layout_mode = 0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
theme = ExtResource("5") theme = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="GridContainer" type="GridContainer" parent="."] [node name="GridContainer" type="GridContainer" parent="."]
layout_mode = 0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_left = 20.0 margin_left = 20.0
offset_top = 20.0 margin_top = 20.0
offset_right = -20.0 margin_right = -20.0
offset_bottom = -20.0 margin_bottom = -20.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
theme_override_constants/h_separation = 10 custom_constants/vseparation = 10
theme_override_constants/v_separation = 10 custom_constants/hseparation = 10
columns = 2 columns = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Taquin" parent="GridContainer" groups=["Persist"] instance=ExtResource("2")] [node name="Taquin" parent="GridContainer" groups=[
layout_mode = 2 "Persist",
] instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 540.0
margin_bottom = 560.0
autoload_fresh_game = false autoload_fresh_game = false
[node name="VBoxContainer" type="VBoxContainer" parent="GridContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="GridContainer"]
layout_mode = 2 margin_left = 550.0
margin_right = 984.0
margin_bottom = 560.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
alignment = 1 alignment = 1
[node name="New Game" parent="GridContainer/VBoxContainer" instance=ExtResource("4")] [node name="New Game" parent="GridContainer/VBoxContainer" instance=ExtResource( 4 )]
custom_minimum_size = Vector2(0, 70) anchor_right = 0.0
layout_mode = 2 anchor_bottom = 0.0
margin_top = 206.0
margin_right = 434.0
margin_bottom = 276.0
rect_min_size = Vector2( 0, 70 )
text = "New Game" text = "New Game"
[node name="Hints" parent="GridContainer/VBoxContainer" instance=ExtResource("4")] [node name="Hints" parent="GridContainer/VBoxContainer" instance=ExtResource( 4 )]
custom_minimum_size = Vector2(0, 70) anchor_right = 0.0
layout_mode = 2 anchor_bottom = 0.0
margin_top = 284.0
margin_right = 434.0
margin_bottom = 354.0
rect_min_size = Vector2( 0, 70 )
text = "Hints" text = "Hints"
[node name="NewGamePanel" parent="." instance=ExtResource("3")] [node name="NewGamePanel" parent="." instance=ExtResource( 3 )]
rect_pivot_offset = Vector2( 4, 4 )
[connection signal="about_to_popup" from="NewGamePanel" to="." method="_on_NewGamePanel_about_to_show"] [connection signal="state_changed" from="GridContainer/Taquin" to="." method="_on_Taquin_state_changed"]
[connection signal="pressed" from="GridContainer/VBoxContainer/New Game" to="." method="_on_New_game_pressed"]
[connection signal="button_down" from="GridContainer/VBoxContainer/Hints" to="GridContainer/Taquin" method="_on_Hints_button_down"]
[connection signal="button_up" from="GridContainer/VBoxContainer/Hints" to="GridContainer/Taquin" method="_on_Hints_button_up"]
[connection signal="about_to_show" from="NewGamePanel" to="." method="_on_NewGamePanel_about_to_show"]
[connection signal="popup_hide" from="NewGamePanel" to="." method="_on_NewGamePanel_popup_hide"] [connection signal="popup_hide" from="NewGamePanel" to="." method="_on_NewGamePanel_popup_hide"]
[connection signal="start_triggered" from="NewGamePanel" to="GridContainer/Taquin" method="_on_NewGamePanel_start_triggered"]

View file

@ -1,4 +1,4 @@
@tool tool
class_name NewGamePanel class_name NewGamePanel
extends PopupPanel extends PopupPanel
@ -19,70 +19,70 @@ const hard_iterations := 30
const Utils = preload("res://src/Utils.gd") const Utils = preload("res://src/Utils.gd")
@export var window_scale_factor = 0.9 # how big the popup will be compared to screen export var window_scale_factor = 0.9 # how big the popup will be compared to screen
@export var default_artwork_texture: Texture2D export var default_artwork_texture: Texture
var preferences = ConfigFile.new() var preferences = ConfigFile.new()
var fade_duration = 0.2 var fade_duration = 0.2
var fade_scale_factor = 0.9 var fade_scale_factor = 0.9
var flip_duration = 0.4 var flip_duration = 0.4
@onready var popup = $"." onready var popup = $"."
@onready var panel = $Panel onready var panel = $Panel
@onready var edit_panel = $EditPanel onready var edit_panel = $EditPanel
@onready var tween = $Tween onready var tween = $Tween
@onready var difficulty_container = $Panel/VBoxContainer/Difficulty onready var difficulty_container = $Panel/VBoxContainer/Difficulty
@onready var easy_button = $Panel/VBoxContainer/Difficulty/Easy onready var easy_button = $Panel/VBoxContainer/Difficulty/Easy
@onready var normal_button = $Panel/VBoxContainer/Difficulty/Normal onready var normal_button = $Panel/VBoxContainer/Difficulty/Normal
@onready var hard_button = $Panel/VBoxContainer/Difficulty/Hard onready var hard_button = $Panel/VBoxContainer/Difficulty/Hard
@onready var custom_button = $Panel/VBoxContainer/HBoxContainer/Custom onready var custom_button = $Panel/VBoxContainer/HBoxContainer/Custom
@onready var preview = $Panel/VBoxContainer/ArtworkSource/Preview onready var preview = $Panel/VBoxContainer/ArtworkSource/Preview
@onready var columns_spinbox = $EditPanel/VBoxContainer/Columns/SpinBox onready var columns_spinbox = $EditPanel/VBoxContainer/Columns/SpinBox
@onready var rows_spinbox = $EditPanel/VBoxContainer/Rows/SpinBox onready var rows_spinbox = $EditPanel/VBoxContainer/Rows/SpinBox
@onready var iterations_spinbox = $EditPanel/VBoxContainer/Iterations/SpinBox onready var iterations_spinbox = $EditPanel/VBoxContainer/Iterations/SpinBox
func _init(): func _init():
var err = preferences.load(pref_path) var err = preferences.load(pref_path)
func _ready(): func _ready():
#pivot_offset = size / 2 rect_pivot_offset = rect_size / 2
assert(popup.theme != null) assert(popup.theme != null)
var popup_style : = popup.get_theme_stylebox("panel", "PopupPanel") as StyleBoxFlat var popup_style : = popup.get_stylebox("panel", "PopupPanel") as StyleBoxFlat
assert(popup_style != null) assert(popup_style != null)
var panel_style := panel.get_theme_stylebox("panel", "Panel") as StyleBoxFlat var panel_style := panel.get_stylebox("panel", "Panel") as StyleBoxFlat
assert(panel_style != null) assert(panel_style != null)
var modified_panel_style = panel_style.duplicate() var modified_panel_style = panel_style.duplicate()
modified_panel_style.corner_radius_bottom_left = popup_style.corner_radius_bottom_left modified_panel_style.corner_radius_bottom_left = popup_style.corner_radius_bottom_left
modified_panel_style.corner_radius_bottom_right = popup_style.corner_radius_bottom_right modified_panel_style.corner_radius_bottom_right = popup_style.corner_radius_bottom_right
modified_panel_style.corner_radius_top_left = popup_style.corner_radius_top_left modified_panel_style.corner_radius_top_left = popup_style.corner_radius_top_left
modified_panel_style.corner_radius_top_right = popup_style.corner_radius_top_right modified_panel_style.corner_radius_top_right = popup_style.corner_radius_top_right
panel.set("theme_override_styles/panel", modified_panel_style) panel.set("custom_styles/panel", modified_panel_style)
edit_panel.set("theme_override_styles/panel", modified_panel_style) edit_panel.set("custom_styles/panel", modified_panel_style)
panel.show() panel.show()
edit_panel.hide() edit_panel.hide()
edit_panel.hide() edit_panel.hide()
var button_max_width: int = $EditPanel/VBoxContainer.size.x / 3.5 var button_max_width: int = $EditPanel/VBoxContainer.rect_size.x / 3.5
var button_width: int = min(200, button_max_width) var button_width := min(200, button_max_width)
print_debug("button max width = ", button_max_width) print_debug("button max width = ", button_max_width)
easy_button.custom_minimum_size.x = button_width easy_button.rect_min_size.x = button_width
normal_button.custom_minimum_size.x = button_width normal_button.rect_min_size.x = button_width
hard_button.custom_minimum_size.x = button_width hard_button.rect_min_size.x = button_width
custom_button.custom_minimum_size.x = button_width custom_button.rect_min_size.x = button_width
func fade_in(): func fade_in():
tween.remove_all() tween.remove_all()
tween.interpolate_property(self, "scale", Vector2(fade_scale_factor, fade_scale_factor), Vector2.ONE, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN) tween.interpolate_property(self, "rect_scale", Vector2(fade_scale_factor, fade_scale_factor), Vector2.ONE, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
tween.interpolate_property(self, "modulate:a", 0.0, 1.0, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN) tween.interpolate_property(self, "modulate:a", 0.0, 1.0, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
tween.start() tween.start()
func fade_out(): func fade_out():
tween.remove_all() tween.remove_all()
tween.interpolate_property(self, "scale", Vector2.ONE, Vector2(fade_scale_factor, fade_scale_factor), fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN) tween.interpolate_property(self, "rect_scale", Vector2.ONE, Vector2(fade_scale_factor, fade_scale_factor), fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
tween.interpolate_property(self, "modulate:a", 1.0, 0.0, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN) tween.interpolate_property(self, "modulate:a", 1.0, 0.0, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
tween.interpolate_callback(self, fade_duration, "hide") tween.interpolate_callback(self, fade_duration, "hide")
tween.start() tween.start()
@ -90,20 +90,20 @@ func fade_out():
func flip_over(new_panel: Panel) -> void: func flip_over(new_panel: Panel) -> void:
tween.remove_all() tween.remove_all()
var mid_duration = flip_duration / 2.0 var mid_duration = flip_duration / 2.0
tween.interpolate_property(self, "scale:x", 1.0, 0.0, mid_duration) tween.interpolate_property(self, "rect_scale:x", 1.0, 0.0, mid_duration)
tween.interpolate_callback($Panel, mid_duration, "hide") tween.interpolate_callback($Panel, mid_duration, "hide")
tween.interpolate_callback(new_panel, mid_duration, "show") tween.interpolate_callback(new_panel, mid_duration, "show")
tween.interpolate_property(self, "scale:x", 0.0, 1.0, mid_duration, Tween.TRANS_LINEAR, Tween.EASE_IN, mid_duration) tween.interpolate_property(self, "rect_scale:x", 0.0, 1.0, mid_duration, Tween.TRANS_LINEAR, Tween.EASE_IN, mid_duration)
tween.start() tween.start()
func flip_back(previous_panel: Panel) -> void: func flip_back(previous_panel: Panel) -> void:
_update_description() _update_description()
tween.remove_all() tween.remove_all()
var mid_duration = flip_duration / 2.0 var mid_duration = flip_duration / 2.0
tween.interpolate_property(self, "scale:x", 1.0, 0.0, mid_duration) tween.interpolate_property(self, "rect_scale:x", 1.0, 0.0, mid_duration)
tween.interpolate_callback($Panel, mid_duration, "show") tween.interpolate_callback($Panel, mid_duration, "show")
tween.interpolate_callback(previous_panel, mid_duration, "hide") tween.interpolate_callback(previous_panel, mid_duration, "hide")
tween.interpolate_property(self, "scale:x", 0.0, 1.0, mid_duration, Tween.TRANS_LINEAR, Tween.EASE_IN, mid_duration) tween.interpolate_property(self, "rect_scale:x", 0.0, 1.0, mid_duration, Tween.TRANS_LINEAR, Tween.EASE_IN, mid_duration)
tween.start() tween.start()
func _update_description(): func _update_description():
@ -131,7 +131,7 @@ func _update_description():
# $Panel/Description.text = "Dimension: %d x %d\nIterations: %d" % [columns, rows, iterations] # $Panel/Description.text = "Dimension: %d x %d\nIterations: %d" % [columns, rows, iterations]
desc.clear() desc.clear()
desc.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER desc.push_align(RichTextLabel.ALIGN_CENTER)
desc.add_text("Board: ") desc.add_text("Board: ")
desc.push_bold() desc.push_bold()
@ -152,11 +152,14 @@ func _update_description():
desc.add_text("%d" % [iterations]) desc.add_text("%d" % [iterations])
desc.pop() desc.pop()
func _set_artwork(tex: Texture2D) -> void: func _set_artwork(tex: Texture) -> void:
preview.texture = tex preview.texture = tex
var file = FileAccess.open(cached_artwork_path, FileAccess.WRITE) var file = File.new()
if file.open(cached_artwork_path, File.WRITE) != OK:
assert(false)
file.store_var(tex.get_data(), true) file.store_var(tex.get_data(), true)
file.close()
# #
# Signals # Signals
@ -193,10 +196,10 @@ func _on_Start_pressed():
func _on_NewGamePanel_about_to_show(): func _on_NewGamePanel_about_to_show():
var difficulty = preferences.get_value("game", "difficulty", "normal") var difficulty = preferences.get_value("game", "difficulty", "normal")
easy_button.button_pressed = difficulty == "easy" easy_button.pressed = difficulty == "easy"
normal_button.button_pressed = difficulty == "normal" normal_button.pressed = difficulty == "normal"
hard_button.button_pressed = difficulty == "hard" hard_button.pressed = difficulty == "hard"
custom_button.button_pressed = difficulty == "custom" custom_button.pressed = difficulty == "custom"
columns_spinbox.value = preferences.get_value("game", "custom_columns", normal_columns) columns_spinbox.value = preferences.get_value("game", "custom_columns", normal_columns)
rows_spinbox.value = preferences.get_value("game", "custom_rows", normal_rows) rows_spinbox.value = preferences.get_value("game", "custom_rows", normal_rows)

View file

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

View file

@ -1,9 +1,9 @@
@tool tool
class_name Piece class_name Piece
extends Node2D extends Node2D
@export var size: int = 160 export var size: int = 160
@export var texture: Texture2D export var texture: Texture
var order: int = 0 var order: int = 0
var taquin_original_index := Vector2.ZERO var taquin_original_index := Vector2.ZERO
@ -17,21 +17,21 @@ var taquin_original_normalized_position := Vector2.ZERO
var piece_scale := Vector2(0.25, 0.25) var piece_scale := Vector2(0.25, 0.25)
func _ready() -> void: func _ready() -> void:
$ColorRect.size = Vector2(size, size) $ColorRect.rect_size = Vector2(size, size)
$ColorRect/Label.text = str(order) $ColorRect/Label.text = str(order)
# We need a dedicated material to have separate uniform, # We need a dedicated material to have separate uniform,
# otherwise uniforms will be shared. # otherwise uniforms will be shared.
var mat = $ColorRect.material.duplicate() as ShaderMaterial var mat = $ColorRect.material.duplicate() as ShaderMaterial
mat.set_shader_parameter("artwork", texture) # TODO: make it common to all pieces mat.set_shader_param("artwork", texture) # TODO: make it common to all pieces
mat.set_shader_parameter("scale", Vector3(piece_scale.x, piece_scale.y, 1.0)) mat.set_shader_param("scale", Vector3(piece_scale.x, piece_scale.y, 1.0))
mat.set_shader_parameter("offset", Vector3(taquin_original_normalized_position.x, taquin_original_normalized_position.y, 0.0)) mat.set_shader_param("offset", Vector3(taquin_original_normalized_position.x, taquin_original_normalized_position.y, 0.0))
mat.set_shader_parameter("reflection", false) mat.set_shader_param("reflection", false)
$ColorRect.material = mat $ColorRect.material = mat
func set_reflection(value: bool) -> void: func set_reflection(value: bool) -> void:
var mat = $ColorRect.material as ShaderMaterial var mat = $ColorRect.material as ShaderMaterial
mat.set_shader_parameter("reflection", value) mat.set_shader_param("reflection", value)
func debug_print(name: String): func debug_print(name: String):
print("%s order: %s" % [name, order]) print("%s order: %s" % [name, order])

View file

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

View file

@ -1,11 +1,11 @@
[gd_scene load_steps=19 format=3 uid="uid://b5sfgghyt7kn3"] [gd_scene load_steps=19 format=2]
[ext_resource type="Script" uid="uid://cqq4ynmtdbb8q" path="res://src/Piece.gd" id="1"] [ext_resource path="res://src/Piece.gd" type="Script" id=1]
[ext_resource type="Texture2D" uid="uid://b87nwpig87ssi" path="res://assets/artworks/escher_lizards.jpg" id="3"] [ext_resource path="res://assets/artworks/escher_lizards.jpg" type="Texture" id=3]
[sub_resource type="VisualShaderNodeExpression" id="1"] [sub_resource type="VisualShaderNodeExpression" id=1]
output_port_for_preview = 0 output_port_for_preview = 0
size = Vector2(657, 584) size = Vector2( 657, 584 )
expression = "// https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm expression = "// https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
vec2 rel_p = input.xy - vec2(0.5, 0.5); vec2 rel_p = input.xy - vec2(0.5, 0.5);
float box_size = 0.4; float box_size = 0.4;
@ -20,15 +20,15 @@ vec2 d_thick = abs(rel_p) - box_thick;
float dist_thick = length(max(d_thick, 0.0)) + min(max(d_thick.x, d_thick.y), 0.0); float dist_thick = length(max(d_thick, 0.0)) + min(max(d_thick.x, d_thick.y), 0.0);
is_thickness = rel_p.y > 0.0 && dist_thick > (0.5 - box_size);" is_thickness = rel_p.y > 0.0 && dist_thick > (0.5 - box_size);"
[sub_resource type="VisualShaderNodeColorConstant" id="2"] [sub_resource type="VisualShaderNodeColorConstant" id=2]
constant = Color(0.733333, 0.34902, 0.0666667, 1) constant = Color( 0.733333, 0.34902, 0.0666667, 1 )
[sub_resource type="VisualShaderNodeSwitch" id="3"] [sub_resource type="VisualShaderNodeSwitch" id=3]
output_port_for_preview = 0 output_port_for_preview = 0
[sub_resource type="VisualShaderNodeExpression" id="4"] [sub_resource type="VisualShaderNodeExpression" id=4]
output_port_for_preview = 0 output_port_for_preview = 0
size = Vector2(545, 407) size = Vector2( 545, 407 )
expression = "float speed = 2.0; expression = "float speed = 2.0;
float delta = mod(t * speed, 3) - 1.0; float delta = mod(t * speed, 3) - 1.0;
float slope = 1.5; float slope = 1.5;
@ -37,61 +37,65 @@ if (abs(input0.x - ((1.0 - input0.y + delta) / slope)) < thickness) {
output0 = vec3(0.5); output0 = vec3(0.5);
}" }"
[sub_resource type="VisualShaderNodeColorOp" id="5"] [sub_resource type="VisualShaderNodeColorOp" id=5]
[sub_resource type="VisualShaderNodeInput" id="6"] [sub_resource type="VisualShaderNodeInput" id=6]
input_name = "time" input_name = "time"
[sub_resource type="VisualShaderNodeSwitch" id="7"] [sub_resource type="VisualShaderNodeSwitch" id=7]
[sub_resource type="VisualShaderNodeBooleanParameter" id="8"] [sub_resource type="VisualShaderNodeBooleanUniform" id=8]
parameter_name = "reflection" uniform_name = "reflection"
[sub_resource type="VisualShaderNodeTexture2DParameter" id="9"] [sub_resource type="VisualShaderNodeTextureUniform" id=9]
output_port_for_preview = 0 output_port_for_preview = 0
parameter_name = "artwork" uniform_name = "artwork"
texture_type = 1 texture_type = 1
[sub_resource type="VisualShaderNodeInput" id="10"] [sub_resource type="VisualShaderNodeInput" id=10]
output_port_for_preview = 0 output_port_for_preview = 0
input_name = "uv" input_name = "uv"
[sub_resource type="VisualShaderNodeVectorOp" id="11"] [sub_resource type="VisualShaderNodeVectorOp" id=11]
output_port_for_preview = 0 output_port_for_preview = 0
default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(0.25, 0.25, 1)] default_input_values = [ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0.25, 0.25, 1 ) ]
operator = 2 operator = 2
[sub_resource type="VisualShaderNodeVectorOp" id="12"] [sub_resource type="VisualShaderNodeVectorOp" id=12]
default_input_values = [0, Vector3(0, 0, 0), 1, Vector3(0.8, 0.1, 0)] default_input_values = [ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0.8, 0.1, 0 ) ]
[sub_resource type="VisualShaderNodeVec3Parameter" id="13"] [sub_resource type="VisualShaderNodeVec3Uniform" id=13]
parameter_name = "scale" uniform_name = "scale"
[sub_resource type="VisualShaderNodeVec3Parameter" id="14"] [sub_resource type="VisualShaderNodeVec3Uniform" id=14]
parameter_name = "offset" uniform_name = "offset"
[sub_resource type="VisualShader" id="15"] [sub_resource type="VisualShader" id=15]
code = "shader_type canvas_item; code = "shader_type canvas_item;
render_mode blend_mix;
uniform bool reflection; uniform bool reflection;
uniform sampler2D artwork : source_color;
uniform vec3 scale; uniform vec3 scale;
uniform vec3 offset; uniform vec3 offset;
uniform sampler2D artwork : hint_albedo;
void vertex() {
// Output:0
}
void fragment() { void fragment() {
// Input:4 // Input:4
vec2 n_out4p0 = UV; vec3 n_out4p0 = vec3(UV, 0.0);
uint n_out13p0;
uint n_out13p1;
// Expression:13 // Expression:13
bool n_out13p0;
bool n_out13p1;
n_out13p0 = false;
n_out13p1 = false;
{ {
// https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm // https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
vec2 rel_p = int(n_out4p0.x).xy - vec2(0.5, 0.5); vec2 rel_p = n_out4p0.xy - vec2(0.5, 0.5);
float box_size = 0.4; float box_size = 0.4;
vec2 box = vec2(box_size, box_size); vec2 box = vec2(box_size, box_size);
vec2 d = abs(rel_p) - box; // mirroring vec2 d = abs(rel_p) - box; // mirroring
@ -105,86 +109,102 @@ void fragment() {
n_out13p1 = rel_p.y > 0.0 && dist_thick > (0.5 - box_size); n_out13p1 = rel_p.y > 0.0 && dist_thick > (0.5 - box_size);
} }
// Color:15
vec3 n_out15p0 = vec3(0.733333, 0.349020, 0.066667);
float n_out15p1 = 1.000000;
// ColorConstant:15 // BooleanUniform:24
vec4 n_out15p0 = vec4(0.733333, 0.349020, 0.066667, 1.000000);
// BooleanParameter:24
bool n_out24p0 = reflection; bool n_out24p0 = reflection;
// VectorUniform:7
// Vector3Parameter:7
vec3 n_out7p0 = scale; vec3 n_out7p0 = scale;
// VectorOp:5 // VectorOp:5
vec3 n_out5p0 = vec3(n_out4p0, 0.0) * n_out7p0; vec3 n_out5p0 = n_out4p0 * n_out7p0;
// VectorUniform:8
// Vector3Parameter:8
vec3 n_out8p0 = offset; vec3 n_out8p0 = offset;
// VectorOp:6 // VectorOp:6
vec3 n_out6p0 = n_out5p0 + n_out8p0; vec3 n_out6p0 = n_out5p0 + n_out8p0;
// TextureUniform:25
vec3 n_out25p0;
float n_out25p1;
{
vec4 n_tex_read = texture(artwork, n_out6p0.xy);
n_out25p0 = n_tex_read.rgb;
n_out25p1 = n_tex_read.a;
}
// Input:22 // Input:22
float n_out22p0 = TIME; float n_out22p0 = TIME;
int n_out19p0;
// Expression:19 // Expression:19
n_out19p0 = 0; vec3 n_out19p0;
n_out19p0 = vec3(0.0, 0.0, 0.0);
{ {
float speed = 2.0; float speed = 2.0;
float delta = mod(n_out22p0 * speed, 3) - 1.0; float delta = mod(n_out22p0 * speed, 3) - 1.0;
float slope = 1.5; float slope = 1.5;
float thickness = 0.05; float thickness = 0.05;
if (abs(int(n_out6p0.x).x - ((1.0 - int(n_out6p0.x).y + delta) / slope)) < thickness) { if (abs(n_out6p0.x - ((1.0 - n_out6p0.y + delta) / slope)) < thickness) {
n_out19p0 = vec3(0.5); n_out19p0 = vec3(0.5);
} }
} }
// ColorOp:21 // ColorOp:21
vec3 n_out21p0 = vec3(1.0) - (vec3(1.0) - ) * (vec3(1.0) - vec3(float(n_out19p0))); vec3 n_out21p0 = vec3(1.0) - (vec3(1.0) - n_out25p0) * (vec3(1.0) - n_out19p0);
// VectorSwitch:23
vec3 n_out23p0;
if(n_out24p0)
{
n_out23p0 = n_out21p0;
}
else
{
n_out23p0 = n_out25p0;
}
float n_out23p0; // VectorSwitch:17
// Switch:23 vec3 n_out17p0;
n_out23p0 = mix(, n_out21p0.x, float(n_out24p0)); if(n_out13p1)
{
n_out17p0 = n_out15p0;
float n_out17p0; }
// Switch:17 else
n_out17p0 = mix(n_out23p0, n_out15p0.x, float(n_out13p1 > 0u ? true : false)); {
n_out17p0 = n_out23p0;
}
// Output:0 // Output:0
COLOR.rgb = vec3(n_out17p0); COLOR.rgb = n_out17p0;
COLOR.a = float(n_out13p0); COLOR.a = n_out13p0 ? 1.0 : 0.0;
}
void light() {
// Output:0
} }
" "
mode = 1 mode = 1
flags/light_only = false flags/light_only = false
nodes/fragment/0/position = Vector2(1680, 260) nodes/fragment/0/position = Vector2( 1680, 260 )
nodes/fragment/4/node = SubResource("10") nodes/fragment/4/node = SubResource( 10 )
nodes/fragment/4/position = Vector2(0, 260) nodes/fragment/4/position = Vector2( 0, 260 )
nodes/fragment/5/node = SubResource("11") nodes/fragment/5/node = SubResource( 11 )
nodes/fragment/5/position = Vector2(280, -20) nodes/fragment/5/position = Vector2( 280, -20 )
nodes/fragment/6/node = SubResource("12") nodes/fragment/6/node = SubResource( 12 )
nodes/fragment/6/position = Vector2(540, 140) nodes/fragment/6/position = Vector2( 540, 140 )
nodes/fragment/7/node = SubResource("13") nodes/fragment/7/node = SubResource( 13 )
nodes/fragment/7/position = Vector2(-20, 60) nodes/fragment/7/position = Vector2( -20, 60 )
nodes/fragment/8/node = SubResource("14") nodes/fragment/8/node = SubResource( 14 )
nodes/fragment/8/position = Vector2(300, 240) nodes/fragment/8/position = Vector2( 300, 240 )
nodes/fragment/13/node = SubResource("1") nodes/fragment/13/node = SubResource( 1 )
nodes/fragment/13/position = Vector2(340, 400) nodes/fragment/13/position = Vector2( 340, 400 )
nodes/fragment/13/size = Vector2(657, 584) nodes/fragment/13/size = Vector2( 657, 584 )
nodes/fragment/13/input_ports = "0,1,input;" nodes/fragment/13/input_ports = "0,1,input;"
nodes/fragment/13/output_ports = "0,2,alpha_mask;1,2,is_thickness;" nodes/fragment/13/output_ports = "0,2,alpha_mask;1,2,is_thickness;"
nodes/fragment/13/expression = "// https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm nodes/fragment/13/expression = "// https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
@ -200,13 +220,13 @@ vec2 box_thick = vec2(box_size, box_size - thickness);
vec2 d_thick = abs(rel_p) - box_thick; vec2 d_thick = abs(rel_p) - box_thick;
float dist_thick = length(max(d_thick, 0.0)) + min(max(d_thick.x, d_thick.y), 0.0); float dist_thick = length(max(d_thick, 0.0)) + min(max(d_thick.x, d_thick.y), 0.0);
is_thickness = rel_p.y > 0.0 && dist_thick > (0.5 - box_size);" is_thickness = rel_p.y > 0.0 && dist_thick > (0.5 - box_size);"
nodes/fragment/15/node = SubResource("2") nodes/fragment/15/node = SubResource( 2 )
nodes/fragment/15/position = Vector2(1480, -40) nodes/fragment/15/position = Vector2( 1480, -40 )
nodes/fragment/17/node = SubResource("3") nodes/fragment/17/node = SubResource( 3 )
nodes/fragment/17/position = Vector2(1460, 80) nodes/fragment/17/position = Vector2( 1460, 80 )
nodes/fragment/19/node = SubResource("4") nodes/fragment/19/node = SubResource( 4 )
nodes/fragment/19/position = Vector2(420, -500) nodes/fragment/19/position = Vector2( 420, -500 )
nodes/fragment/19/size = Vector2(545, 407) nodes/fragment/19/size = Vector2( 545, 407 )
nodes/fragment/19/input_ports = "0,1,input0;1,0,t;" nodes/fragment/19/input_ports = "0,1,input0;1,0,t;"
nodes/fragment/19/output_ports = "0,1,output0;" nodes/fragment/19/output_ports = "0,1,output0;"
nodes/fragment/19/expression = "float speed = 2.0; nodes/fragment/19/expression = "float speed = 2.0;
@ -216,44 +236,51 @@ float thickness = 0.05;
if (abs(input0.x - ((1.0 - input0.y + delta) / slope)) < thickness) { if (abs(input0.x - ((1.0 - input0.y + delta) / slope)) < thickness) {
output0 = vec3(0.5); output0 = vec3(0.5);
}" }"
nodes/fragment/21/node = SubResource("5") nodes/fragment/21/node = SubResource( 5 )
nodes/fragment/21/position = Vector2(1220, -200) nodes/fragment/21/position = Vector2( 1220, -200 )
nodes/fragment/22/node = SubResource("6") nodes/fragment/22/node = SubResource( 6 )
nodes/fragment/22/position = Vector2(160, -300) nodes/fragment/22/position = Vector2( 160, -300 )
nodes/fragment/23/node = SubResource("7") nodes/fragment/23/node = SubResource( 7 )
nodes/fragment/23/position = Vector2(1200, 20) nodes/fragment/23/position = Vector2( 1200, 20 )
nodes/fragment/24/node = SubResource("8") nodes/fragment/24/node = SubResource( 8 )
nodes/fragment/24/position = Vector2(1200, -60) nodes/fragment/24/position = Vector2( 1200, -60 )
nodes/fragment/25/node = SubResource("9") nodes/fragment/25/node = SubResource( 9 )
nodes/fragment/25/position = Vector2(840, 20) nodes/fragment/25/position = Vector2( 840, 20 )
nodes/fragment/connections = PackedInt32Array(5, 0, 6, 0, 13, 0, 0, 1, 4, 0, 5, 0, 4, 0, 13, 0, 13, 1, 17, 0, 15, 0, 17, 1, 17, 0, 0, 0, 8, 0, 6, 1, 7, 0, 5, 1, 19, 0, 21, 1, 22, 0, 19, 1, 6, 0, 19, 0, 24, 0, 23, 0, 21, 0, 23, 1, 23, 0, 17, 2, 25, 0, 23, 2, 25, 0, 21, 0) nodes/fragment/connections = PoolIntArray( 5, 0, 6, 0, 13, 0, 0, 1, 4, 0, 5, 0, 4, 0, 13, 0, 13, 1, 17, 0, 15, 0, 17, 1, 17, 0, 0, 0, 8, 0, 6, 1, 7, 0, 5, 1, 19, 0, 21, 1, 22, 0, 19, 1, 6, 0, 19, 0, 24, 0, 23, 0, 21, 0, 23, 1, 23, 0, 17, 2, 6, 0, 25, 0, 25, 0, 23, 2, 25, 0, 21, 0 )
[sub_resource type="ShaderMaterial" id="ShaderMaterial_e6sxn"] [sub_resource type="ShaderMaterial" id=16]
shader = SubResource("15") shader = SubResource( 15 )
shader_param/reflection = false
shader_param/scale = Vector3( 0.25, 0.25, 1 )
shader_param/offset = Vector3( 0, 0, 0 )
shader_param/artwork = ExtResource( 3 )
[node name="Piece" type="Node2D"] [node name="Piece" type="Node2D"]
script = ExtResource("1") script = ExtResource( 1 )
texture = ExtResource("3") texture = ExtResource( 3 )
[node name="ColorRect" type="ColorRect" parent="."] [node name="ColorRect" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_e6sxn") material = SubResource( 16 )
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_right = 160.0 margin_right = 160.0
offset_bottom = 160.0 margin_bottom = 160.0
mouse_filter = 2 mouse_filter = 2
color = Color(0.7393426, 0.3112301, 0.2024486, 1) __meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="ColorRect"] [node name="Label" type="Label" parent="ColorRect"]
visible = false visible = false
clip_contents = true margin_left = 10.0
layout_mode = 0 margin_top = 10.0
offset_left = 10.0 margin_right = 50.0
offset_top = 10.0 margin_bottom = 50.0
offset_right = 50.0 rect_scale = Vector2( 3, 3 )
offset_bottom = 50.0 rect_clip_content = true
scale = Vector2(3, 3)
size_flags_vertical = 1 size_flags_vertical = 1
theme_override_colors/font_color = Color(0, 0, 0, 1) custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "0" text = "0"
__meta__ = {
"_edit_use_anchors_": false
}

View file

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

View file

@ -1,4 +1,4 @@
@tool tool
class_name Taquin class_name Taquin
extends Control extends Control
@ -19,12 +19,12 @@ const _state_transitions = {
const Piece = preload("res://src/Piece.tscn") const Piece = preload("res://src/Piece.tscn")
const Utils = preload("res://src/Utils.gd") const Utils = preload("res://src/Utils.gd")
@export var rows: int = NewGamePanel.normal_rows export var rows: int = NewGamePanel.normal_rows
@export var columns: int = NewGamePanel.normal_columns export var columns: int = NewGamePanel.normal_columns
@export var shuffle_iterations: int = NewGamePanel.normal_iterations export var shuffle_iterations: int = NewGamePanel.normal_iterations
@export var artwork_texture: Texture2D export var artwork_texture: Texture
@export var current_state: State = State.MAIN export(State) var current_state = State.MAIN
@export var autoload_fresh_game := true export var autoload_fresh_game := true
var board_size := Vector2.ZERO var board_size := Vector2.ZERO
var interpiece := 4 var interpiece := 4
@ -50,11 +50,11 @@ var current_touch_slide := Vector2.ZERO
var local_min_position := Vector2.ZERO var local_min_position := Vector2.ZERO
var local_max_position := Vector2.ZERO var local_max_position := Vector2.ZERO
var hint_active := false: get = get_hint_active, set = set_hint_active var hint_active := false setget set_hint_active, get_hint_active
#var _artwork_path := NewGamePanel.default_artwork_path #var _artwork_path := NewGamePanel.default_artwork_path
@onready var hint_tween = $HintTween onready var hint_tween = $HintTween
func position_for_index(index: Vector2, size: int) -> Vector2: func position_for_index(index: Vector2, size: int) -> Vector2:
return padding + Vector2(index.x * (size + interpiece), index.y * (size + interpiece)) return padding + Vector2(index.x * (size + interpiece), index.y * (size + interpiece))
@ -73,13 +73,13 @@ func compute_padding(piece_size: int) -> Vector2:
func _ready() -> void: func _ready() -> void:
$AnimationPlayer/MockPiece.visible = false $AnimationPlayer/MockPiece.visible = false
$GPUParticles2D.emitting = false $Particles2D.emitting = false
board_size.x = min(size.x, size.y) board_size.x = min(rect_size.x, rect_size.y)
board_size.y = board_size.x board_size.y = board_size.x
$Background.size = board_size $Background.rect_size = board_size
$Background.position = (size - $Background.size) / 2 $Background.rect_position = (rect_size - $Background.rect_size) / 2
$Background.set_anchors_preset(Control.PRESET_CENTER) $Background.set_anchors_preset(Control.PRESET_CENTER)
rng.randomize() rng.randomize()
@ -87,7 +87,7 @@ func _ready() -> void:
if autoload_fresh_game: if autoload_fresh_game:
start_fresh() start_fresh()
if artwork_texture == null: if artwork_texture == null:
artwork_texture = $NewGamePanel.default_artwork_texture artwork_texture = NewGamePanel.default_artwork_texture
new_game(NewGamePanel.normal_columns, NewGamePanel.normal_rows, NewGamePanel.normal_iterations, artwork_texture) new_game(NewGamePanel.normal_columns, NewGamePanel.normal_rows, NewGamePanel.normal_iterations, artwork_texture)
func _unhandled_input(event): func _unhandled_input(event):
@ -98,7 +98,7 @@ func _gui_input(event):
if $AnimationPlayer.is_playing(): if $AnimationPlayer.is_playing():
# Disable input during animation # Disable input during animation
return return
if hint_active or hint_tween: if hint_active or hint_tween.is_active():
return return
match current_state: match current_state:
@ -218,7 +218,7 @@ func sliding_piece_for_direction(direction) -> Piece:
if (destination.x < 0 || destination.x >= columns if (destination.x < 0 || destination.x >= columns
|| destination.y < 0 || destination.y >= rows): || destination.y < 0 || destination.y >= rows):
print("/!\\ Impossible move") print("\/!\\ Impossible move")
return null return null
var piece = pieces[destination.x][destination.y] var piece = pieces[destination.x][destination.y]
@ -238,7 +238,7 @@ func move_piece(direction, speed: float) -> bool:
assert(moving_piece_animation != null) assert(moving_piece_animation != null)
assert(moving_piece_animation.get_track_count() > 0) assert(moving_piece_animation.get_track_count() > 0)
var moving_piece_track_index: int = moving_piece_animation.find_track(current_animation_path, Animation.TYPE_ANIMATION) var moving_piece_track_index: int = moving_piece_animation.find_track(current_animation_path)
assert(moving_piece_track_index != -1) assert(moving_piece_track_index != -1)
@ -273,7 +273,7 @@ func commit_slide(audio: bool, check_solved: bool):
ensure_validity() ensure_validity()
reset_slide() reset_slide()
#update() update()
if check_solved: if check_solved:
check_solved() check_solved()
@ -347,11 +347,11 @@ func transition_to(state):
current_state = state current_state = state
match current_state: match current_state:
State.WINNING: State.WINNING:
$GPUParticles2D.emitting = true $Particles2D.emitting = true
set_pieces_reflection(true) set_pieces_reflection(true)
$Timer.start(-1) $Timer.start(-1)
State.GAME_OVER: State.GAME_OVER:
$GPUParticles2D.emitting = false $Particles2D.emitting = false
$Timer.stop() $Timer.stop()
emit_signal("state_changed", previous_state, current_state) emit_signal("state_changed", previous_state, current_state)
@ -377,7 +377,7 @@ func save() -> Dictionary:
func load(saved_state) -> bool: func load(saved_state) -> bool:
print("load save state: ", saved_state) print("load save state: ", saved_state)
if not saved_state.has_all(["rows", "columns", "pieces", "hidden_piece"]): if not saved_state.has_all(["rows", "columns", "pieces", "hidden_piece"]):
#assert(false, "Invalid save state") assert(false, "Invalid save state")
return false return false
rows = saved_state["rows"] rows = saved_state["rows"]
columns = saved_state["columns"] columns = saved_state["columns"]
@ -388,7 +388,7 @@ func load(saved_state) -> bool:
init(saved_state["pieces"], saved_state["hidden_piece"], artwork_texture) init(saved_state["pieces"], saved_state["hidden_piece"], artwork_texture)
return true return true
func init(pieces_order: Array, hidden_piece: int, artwork: Texture2D) -> void: func init(pieces_order: Array, hidden_piece: int, artwork: Texture) -> void:
var piece_size: int = compute_piece_size() var piece_size: int = compute_piece_size()
padding = compute_padding(piece_size) padding = compute_padding(piece_size)
print("piece size: ", piece_size) print("piece size: ", piece_size)
@ -403,7 +403,7 @@ func init(pieces_order: Array, hidden_piece: int, artwork: Texture2D) -> void:
for c in range(columns): for c in range(columns):
var pieces_row: Array = [] var pieces_row: Array = []
for r in range(rows): for r in range(rows):
var piece = Piece.instantiate() var piece = Piece.instance()
# Uniforms # Uniforms
piece.size = piece_size piece.size = piece_size
@ -433,7 +433,7 @@ func init(pieces_order: Array, hidden_piece: int, artwork: Texture2D) -> void:
pieces.append(pieces_row) pieces.append(pieces_row)
assert(missing_piece != null) assert(missing_piece != null)
func new_game(columns: int, rows: int, shuffle_iterations: int, artwork_texture: Texture2D) -> void: func new_game(columns: int, rows: int, shuffle_iterations: int, artwork_texture: Texture) -> void:
self.columns = columns self.columns = columns
self.rows = rows self.rows = rows
self.shuffle_iterations = shuffle_iterations self.shuffle_iterations = shuffle_iterations
@ -447,8 +447,8 @@ func new_game(columns: int, rows: int, shuffle_iterations: int, artwork_texture:
func start_fresh(): func start_fresh():
if artwork_texture == null: if artwork_texture == null:
print_debug("Load texture from: ", $NewGamePanel.default_artwork_path) print_debug("Load texture from: ", NewGamePanel.default_artwork_path)
artwork_texture = Utils.load_texture_from_path($NewGamePanel.default_artwork_path) artwork_texture = Utils.load_texture_from_path(NewGamePanel.default_artwork_path)
new_game(NewGamePanel.normal_columns, NewGamePanel.normal_rows, NewGamePanel.normal_iterations, artwork_texture) new_game(NewGamePanel.normal_columns, NewGamePanel.normal_rows, NewGamePanel.normal_iterations, artwork_texture)

View file

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

View file

@ -4,7 +4,7 @@
[ext_resource path="res://src/Piece.tscn" type="PackedScene" id=2] [ext_resource path="res://src/Piece.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/sounds/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav" type="AudioStream" id=3] [ext_resource path="res://assets/sounds/PM_BBI_Bullet_Impact_Hit_Body_Flesh_2.wav" type="AudioStream" id=3]
[ext_resource path="res://assets/taqin_theme.tres" type="Theme" id=4] [ext_resource path="res://assets/taqin_theme.tres" type="Theme" id=4]
[ext_resource path="res://assets/artworks/escher_convex_concave.jpg" type="Texture2D" id=5] [ext_resource path="res://assets/artworks/escher_convex_concave.jpg" type="Texture" id=5]
[sub_resource type="Animation" id=1] [sub_resource type="Animation" id=1]
resource_name = "MovingPiece" resource_name = "MovingPiece"
@ -17,19 +17,19 @@ tracks/0/loop_wrap = true
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/keys = { tracks/0/keys = {
"times": PackedFloat32Array( 0, 0.2 ), "times": PoolRealArray( 0, 0.2 ),
"transitions": PackedFloat32Array( 1, 1 ), "transitions": PoolRealArray( 1, 1 ),
"update": 0, "update": 0,
"values": [ Vector2( 15, 15 ), Vector2( 175, 15 ) ] "values": [ Vector2( 15, 15 ), Vector2( 175, 15 ) ]
} }
[sub_resource type="Gradient" id=2] [sub_resource type="Gradient" id=2]
colors = PackedColorArray( 1, 1, 1, 1, 1, 0.140625, 0.140625, 1 ) colors = PoolColorArray( 1, 1, 1, 1, 1, 0.140625, 0.140625, 1 )
[sub_resource type="GradientTexture2D" id=3] [sub_resource type="GradientTexture" id=3]
gradient = SubResource( 2 ) gradient = SubResource( 2 )
[sub_resource type="ParticleProcessMaterial" id=4] [sub_resource type="ParticlesMaterial" id=4]
emission_shape = 2 emission_shape = 2
emission_box_extents = Vector3( 10, 5, 1 ) emission_box_extents = Vector3( 10, 5, 1 )
flag_disable_z = true flag_disable_z = true
@ -49,7 +49,7 @@ color_ramp = SubResource( 3 )
[node name="Taquin" type="Control"] [node name="Taquin" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
custom_minimum_size = Vector2( 540, 540 ) rect_min_size = Vector2( 540, 540 )
theme = ExtResource( 4 ) theme = ExtResource( 4 )
script = ExtResource( 1 ) script = ExtResource( 1 )
__meta__ = { __meta__ = {
@ -62,10 +62,10 @@ anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.5 anchor_bottom = 0.5
offset_left = -300.0 margin_left = -300.0
offset_top = -300.0 margin_top = -300.0
offset_right = 300.0 margin_right = 300.0
offset_bottom = 300.0 margin_bottom = 300.0
mouse_filter = 2 mouse_filter = 2
color = Color( 0.12549, 0.235294, 0.337255, 1 ) color = Color( 0.12549, 0.235294, 0.337255, 1 )
__meta__ = { __meta__ = {
@ -80,11 +80,11 @@ visible = false
position = Vector2( 15, 15 ) position = Vector2( 15, 15 )
[node name="PlaceholderTexture" type="ColorRect" parent="AnimationPlayer/MockPiece"] [node name="PlaceholderTexture" type="ColorRect" parent="AnimationPlayer/MockPiece"]
offset_right = 160.0 margin_right = 160.0
offset_bottom = 160.0 margin_bottom = 160.0
color = Color( 0.137255, 0.976471, 0.0196078, 1 ) color = Color( 0.137255, 0.976471, 0.0196078, 1 )
[node name="GPUParticles2D" type="GPUParticles2D" parent="."] [node name="Particles2D" type="Particles2D" parent="."]
position = Vector2( 253, 262 ) position = Vector2( 253, 262 )
rotation = -1.5708 rotation = -1.5708
emitting = false emitting = false

View file

@ -1,4 +1,4 @@
static func load_texture_from_path(path: String) -> Texture2D: static func load_texture_from_path(path: String) -> Texture:
var img = Image.new() var img = Image.new()
var texture = ImageTexture.new() var texture = ImageTexture.new()
if img.load(path) != OK: if img.load(path) != OK:
@ -7,9 +7,12 @@ static func load_texture_from_path(path: String) -> Texture2D:
texture.create_from_image(img) texture.create_from_image(img)
return texture return texture
static func deserialize_texture(path: String) -> Texture2D: static func deserialize_texture(path: String) -> Texture:
var file := FileAccess.open(path, FileAccess.READ) var file := File.new()
if file.open(path, File.READ) != OK:
return null
var img: Image = file.get_var(true) var img: Image = file.get_var(true)
file.close()
var img_tex = ImageTexture.new() var img_tex = ImageTexture.new()
img_tex.create_from_image(img) img_tex.create_from_image(img)
return img_tex return img_tex

View file

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