From a39b3d8623cf50cfe371c57f75fa86ac41d3fff4 Mon Sep 17 00:00:00 2001
From: cocoatoucher
Date: Thu, 17 Jun 2021 11:59:27 +0200
Subject: [PATCH] Fixes for tiled map editor loading. Adding public support for
debugging collider tile maps. Adding discord channel to readme.
---
.../xcschemes/GlideDemo_iOS.xcscheme | 2 +-
.../PauseMenuViewController.swift | 2 +-
.../Collider Tiles.spriteatlas/Contents.json | 6 +++++
.../Sprite.imageset/Contents.json | 20 +++++++++++++++++
.../ground.imageset/Contents.json | 21 ++++++++++++++++++
.../ground.imageset/ground.png | Bin 0 -> 106 bytes
.../jump_wall_left.imageset/Contents.json | 21 ++++++++++++++++++
.../jump_wall_left.png | Bin 0 -> 168 bytes
.../jump_wall_right.imageset/Contents.json | 21 ++++++++++++++++++
.../jump_wall_right.png | Bin 0 -> 168 bytes
.../oneway.imageset/Contents.json | 21 ++++++++++++++++++
.../oneway.imageset/oneway.png | Bin 0 -> 106 bytes
.../slope_0_15.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_0_15.imageset/slope_0_15.png | Bin 0 -> 154 bytes
.../slope_0_3.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_0_3.imageset/slope_0_3.png | Bin 0 -> 107 bytes
.../slope_0_7.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_0_7.imageset/slope_0_7.png | Bin 0 -> 121 bytes
.../slope_11_8.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_11_8.imageset/slope_11_8.png | Bin 0 -> 101 bytes
.../slope_12_15.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_12_15.imageset/slope_12_15.png | Bin 0 -> 102 bytes
.../slope_15_0.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_15_0.imageset/slope_15_0.png | Bin 0 -> 155 bytes
.../slope_15_12.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_15_12.imageset/slope_15_12.png | Bin 0 -> 99 bytes
.../slope_15_8.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_15_8.imageset/slope_15_8.png | Bin 0 -> 114 bytes
.../slope_3_0.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_3_0.imageset/slope_3_0.png | Bin 0 -> 101 bytes
.../slope_4_7.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_4_7.imageset/slope_4_7.png | Bin 0 -> 104 bytes
.../slope_7_0.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_7_0.imageset/slope_7_0.png | Bin 0 -> 120 bytes
.../slope_7_4.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_7_4.imageset/slope_7_4.png | Bin 0 -> 100 bytes
.../slope_8_11.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_8_11.imageset/slope_8_11.png | Bin 0 -> 105 bytes
.../slope_8_15.imageset/Contents.json | 21 ++++++++++++++++++
.../slope_8_15.imageset/slope_8_15.png | Bin 0 -> 119 bytes
.../Sprite Atlas/Contents.json | 6 ++---
README.md | 11 ++++++++-
.../Models/GameControllerInterface.swift | 6 ++---
Sources/Scene/GlideScene.swift | 7 +++++-
Sources/Scene/GlideSceneDelegate.swift | 2 +-
.../TiledMapEditorSceneLoader.swift | 9 +++++---
Sources/UI/Model/NavigatableElement.swift | 2 +-
.../View/NavigatableButtonContentView.swift | 2 +-
Sources/iOS/TouchReceiverComponent.swift | 2 +-
...ionsController+GroundCollisionsTests.swift | 4 ++--
50 files changed, 440 insertions(+), 19 deletions(-)
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/Sprite.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/ground.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/ground.imageset/ground.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_left.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_left.imageset/jump_wall_left.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_right.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_right.imageset/jump_wall_right.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/oneway.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/oneway.imageset/oneway.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_15.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_15.imageset/slope_0_15.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_3.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_3.imageset/slope_0_3.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_7.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_7.imageset/slope_0_7.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_11_8.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_11_8.imageset/slope_11_8.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_12_15.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_12_15.imageset/slope_12_15.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_0.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_0.imageset/slope_15_0.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_12.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_12.imageset/slope_15_12.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_8.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_8.imageset/slope_15_8.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_3_0.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_3_0.imageset/slope_3_0.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_4_7.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_4_7.imageset/slope_4_7.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_0.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_0.imageset/slope_7_0.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_4.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_4.imageset/slope_7_4.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_11.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_11.imageset/slope_8_11.png
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_15.imageset/Contents.json
create mode 100644 Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_15.imageset/slope_8_15.png
diff --git a/Demo/GlideDemo.xcodeproj/xcshareddata/xcschemes/GlideDemo_iOS.xcscheme b/Demo/GlideDemo.xcodeproj/xcshareddata/xcschemes/GlideDemo_iOS.xcscheme
index 6e022c4..1a80f64 100644
--- a/Demo/GlideDemo.xcodeproj/xcshareddata/xcschemes/GlideDemo_iOS.xcscheme
+++ b/Demo/GlideDemo.xcodeproj/xcshareddata/xcschemes/GlideDemo_iOS.xcscheme
@@ -31,7 +31,7 @@
|!~
B92o!r
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_left.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_left.imageset/Contents.json
new file mode 100644
index 0000000..c0b7d56
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_left.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "jump_wall_left.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_left.imageset/jump_wall_left.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_left.imageset/jump_wall_left.png
new file mode 100644
index 0000000000000000000000000000000000000000..4b420fda14aa4a7ce2ef78ef13ce314e86b9599b
GIT binary patch
literal 168
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!6#=yXs@#Xw?AcwIy$lZxy-8q?;Ku(gUi(`m|
zU~+{}-IM>l(&qn+4ILPjJJ^$yT^zFZnRFcpQAkNpDzG(R+!6PPRpMf9V`l3`iL^s1
z2_{du4E``0OSuK-9i3p%m=JT|5VN@Nh3Pv?4jpmlbvV_q!9j8AG7AAlj>B?Ka&Od{
Q18rmQboFyt=akR{0P-F--v9sr
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_right.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_right.imageset/Contents.json
new file mode 100644
index 0000000..6be2af1
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_right.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "jump_wall_right.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_right.imageset/jump_wall_right.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/jump_wall_right.imageset/jump_wall_right.png
new file mode 100644
index 0000000000000000000000000000000000000000..5befb6481fe8f585b4e6312be8d657b7e059ee3f
GIT binary patch
literal 168
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!6#=yXs@#Xw?AcwIy$lZxy-8q?;Ku(gUi(`m|
zVDg^A$H(f~6cU&O6%KSnvn*op)b(Ll$F9a;-dn-QW1J9`Xwo**fK$SEC)1w12P^BF
zIaFuNePQx6Pl8A70WW)r{^HM_Tf&C|gb`z6W3(FP`
z?hFCJ2?C-A6tfzfd>GnhG>R88s!vk(XUSj^f2(50vVy4rXg-6dtDnm{r-UW|0#+*;
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_3.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_3.imageset/Contents.json
new file mode 100644
index 0000000..8c01dff
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_3.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "slope_0_3.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_3.imageset/slope_0_3.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_0_3.imageset/slope_0_3.png
new file mode 100644
index 0000000000000000000000000000000000000000..3202ab4066c47170e5113bac987c3865758e0443
GIT binary patch
literal 107
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`MxHK?Ar`&KCR~?(pKo9}w|4iD
z6AnxXF6Iof0!9-SFt+fh++-*@;L`alklBq_!VRdkbt><<^Ck|JK-~H?#%>a6xoMuw(;Y!@B&EwTdYWAJqKb6Mw<&;$UGA{!V0
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_12_15.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_12_15.imageset/Contents.json
new file mode 100644
index 0000000..da485e8
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_12_15.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "slope_12_15.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_12_15.imageset/slope_12_15.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_12_15.imageset/slope_12_15.png
new file mode 100644
index 0000000000000000000000000000000000000000..4035aa6c98a7bde0777dc1e7bca382d3056aad1a
GIT binary patch
literal 102
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`x}GkMAr`&K2@mdKI;Vst09OeZ{{R30
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_0.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_0.imageset/Contents.json
new file mode 100644
index 0000000..39c7d85
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_0.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "slope_15_0.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_0.imageset/slope_15_0.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_15_0.imageset/slope_15_0.png
new file mode 100644
index 0000000000000000000000000000000000000000..7764e1a630a3dfc32379a836edaafec401bfd2cb
GIT binary patch
literal 155
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|LOop^Lo5WB
zp1Cc^Ai%>KSarGWQRtx~JdY<%xbx=!O#zvuFvNCPF3+6Wr#o39J@8%n)RHh*u$8nFna3vB<=Njd4kq1G~?Z3^~(;D-DS$3=BCl*d8jsS2
B8}a}E
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_0.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_0.imageset/Contents.json
new file mode 100644
index 0000000..95af413
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_0.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "slope_7_0.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_0.imageset/slope_7_0.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_0.imageset/slope_7_0.png
new file mode 100644
index 0000000000000000000000000000000000000000..576490b65515f43423230161722316487a8f68e4
GIT binary patch
literal 120
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`_MR?|Ar`&KDGI_S?>hdRKL7+C
z>)a$1ZZVYfx=1&8D?2iCWFE<6*eGSlqY$cmhoQ*y5QDJlEO%ZBGoU%ol0+8f_%7NF
PG>XB~)z4*}Q$iB}O`{?8
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_4.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_4.imageset/Contents.json
new file mode 100644
index 0000000..9449970
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_4.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "slope_7_4.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_4.imageset/slope_7_4.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_7_4.imageset/slope_7_4.png
new file mode 100644
index 0000000000000000000000000000000000000000..6b855a0d83bdab9f1652105f9f3e37676f4da6ca
GIT binary patch
literal 100
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`+MX_sAr`&K2@2wKABL-OkqX`QbTX3o)$#K6#bkayple#^r^y$qhNelF{r5}E*A
CgdV5>
literal 0
HcmV?d00001
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_15.imageset/Contents.json b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_15.imageset/Contents.json
new file mode 100644
index 0000000..fbc9112
--- /dev/null
+++ b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_15.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "slope_8_15.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_15.imageset/slope_8_15.png b/Demo/Shared/SharedAssets.xcassets/Sprite Atlas/Collider Tiles.spriteatlas/slope_8_15.imageset/slope_8_15.png
new file mode 100644
index 0000000000000000000000000000000000000000..87b224afe8ed59fb8c041b4321e36706e49b8900
GIT binary patch
literal 119
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`cAhSdAr`&K2@$A
ze@u4b|C3kGcdXlaFWFMrm2E
iOS 14.0 / macOS 11.0 / tvOS 14.0
+
+
+
+
+
+
+
+
-
+
+
- Make a simple 2d platformer in half an hour, tutorial on YouTube:
diff --git a/Sources/Input/Models/GameControllerInterface.swift b/Sources/Input/Models/GameControllerInterface.swift
index 3c37701..3f82e2a 100644
--- a/Sources/Input/Models/GameControllerInterface.swift
+++ b/Sources/Input/Models/GameControllerInterface.swift
@@ -25,7 +25,7 @@
import Foundation
-protocol GameControllerInterface: class {
+protocol GameControllerInterface: AnyObject {
associatedtype ExtendedGamepad: ExtendedGamepadInterface
associatedtype MicroGamepad: MicroGamepadInterface
@@ -54,13 +54,13 @@ protocol ExtendedGamepadInterface {
var buttonMenu: Button { get }
}
-protocol GamepadButtonInterface: class {
+protocol GamepadButtonInterface: AnyObject {
associatedtype Button
var pressedChangedHandler: ((Button, Float, Bool) -> Void)? { get set }
}
-protocol GamepadDirectionPadInterface: class {
+protocol GamepadDirectionPadInterface: AnyObject {
associatedtype DirectionPad
var valueChangedHandler: ((DirectionPad, Float, Float) -> Void)? { get set }
diff --git a/Sources/Scene/GlideScene.swift b/Sources/Scene/GlideScene.swift
index 0dc3850..420ab96 100644
--- a/Sources/Scene/GlideScene.swift
+++ b/Sources/Scene/GlideScene.swift
@@ -165,7 +165,12 @@ open class GlideScene: SKScene {
return node
}()
- var isDebuggingCollisionTileMapNode: Bool = false {
+ /// Whether the collision tile map should be drawn or not.
+ /// Default value is `false`.
+ /// Compiler `DEBUG` flag should on for this to work.
+ /// A texture atlas for collision tiles should be provided
+ /// for loading collider tile map from a Tiled Map Editor file.
+ public var isDebuggingCollisionTileMapNode: Bool = false {
didSet {
updateCollisionTileMapNodeDebug()
}
diff --git a/Sources/Scene/GlideSceneDelegate.swift b/Sources/Scene/GlideSceneDelegate.swift
index f56defe..ee7f03e 100644
--- a/Sources/Scene/GlideSceneDelegate.swift
+++ b/Sources/Scene/GlideSceneDelegate.swift
@@ -25,7 +25,7 @@
import Foundation
-public protocol GlideSceneDelegate: class {
+public protocol GlideSceneDelegate: AnyObject {
/// Called when the paused states of the scene changes.
func glideScene(_ scene: GlideScene, didChangePaused paused: Bool)
diff --git a/Sources/TiledMapEditorSceneLoader/TiledMapEditorSceneLoader.swift b/Sources/TiledMapEditorSceneLoader/TiledMapEditorSceneLoader.swift
index a3860e8..0da2646 100644
--- a/Sources/TiledMapEditorSceneLoader/TiledMapEditorSceneLoader.swift
+++ b/Sources/TiledMapEditorSceneLoader/TiledMapEditorSceneLoader.swift
@@ -210,7 +210,11 @@ public class TiledMapEditorSceneLoader {
continue
}
let textureName = String(rawTextureName)
- let textureFromAtlas = collisionTilesTextureAtlas?.textureNamed(textureName) ?? decorationTilesTextureAtlas?.textureNamed(textureName)
+
+ var textureFromAtlas = collisionTilesTextureAtlas?.textureNames.contains(textureName) == true ? collisionTilesTextureAtlas?.textureNamed(textureName) : nil
+ if textureFromAtlas == nil {
+ textureFromAtlas = decorationTilesTextureAtlas?.textureNames.contains(textureName) == true ? decorationTilesTextureAtlas?.textureNamed(textureName) : nil
+ }
let texture = textureFromAtlas ?? SKTexture(imageNamed: textureName)
texture.filteringMode = .nearest
@@ -272,8 +276,7 @@ public class TiledMapEditorSceneLoader {
var matchingTileSet: LoadedTileSet?
for tileSet in tileSets {
- let tileIndex = firstNonEmptyTileIndex - tileSet.firstGid
- if case tileSet.range = tileIndex {
+ if firstNonEmptyTileIndex < tileSet.range.endIndex {
matchingTileSet = tileSet
break
}
diff --git a/Sources/UI/Model/NavigatableElement.swift b/Sources/UI/Model/NavigatableElement.swift
index 83b5d14..854c38b 100644
--- a/Sources/UI/Model/NavigatableElement.swift
+++ b/Sources/UI/Model/NavigatableElement.swift
@@ -26,7 +26,7 @@
import Foundation
/// Protocol to adopt for custom navigatable view classes.
-public protocol NavigatableElement: class {
+public protocol NavigatableElement: AnyObject {
/// Navigatable sibling element that's positioned above this element.
var upElement: NavigatableElement? { get set }
/// Navigatable sibling element that's positioned below this element.
diff --git a/Sources/UI/View/NavigatableButtonContentView.swift b/Sources/UI/View/NavigatableButtonContentView.swift
index 1b8f7f0..7c38843 100644
--- a/Sources/UI/View/NavigatableButtonContentView.swift
+++ b/Sources/UI/View/NavigatableButtonContentView.swift
@@ -26,7 +26,7 @@
import Foundation
/// Protocol to adopt for custom content view classes of navigatable buttons.
-public protocol NavigatableButtonContentView: class {
+public protocol NavigatableButtonContentView: AnyObject {
var isSelected: Bool { get set }
var isFocusedElement: Bool { get set }
var isTouchedDown: Bool { get set }
diff --git a/Sources/iOS/TouchReceiverComponent.swift b/Sources/iOS/TouchReceiverComponent.swift
index 1a04da1..fd9c28c 100644
--- a/Sources/iOS/TouchReceiverComponent.swift
+++ b/Sources/iOS/TouchReceiverComponent.swift
@@ -29,7 +29,7 @@ import GameplayKit
/// When adopted, component's entity will be able to manage touch inputs
/// on an iOS device.
-public protocol TouchReceiverComponent: class {
+public protocol TouchReceiverComponent: AnyObject {
/// Node for testing the hits of touches from the screen.
/// This should be a node with a non empty parent.
diff --git a/Tests/CollisionsTests/Ground Collisions/CollisionsController+GroundCollisionsTests.swift b/Tests/CollisionsTests/Ground Collisions/CollisionsController+GroundCollisionsTests.swift
index d3e4e2c..0e2eb1d 100644
--- a/Tests/CollisionsTests/Ground Collisions/CollisionsController+GroundCollisionsTests.swift
+++ b/Tests/CollisionsTests/Ground Collisions/CollisionsController+GroundCollisionsTests.swift
@@ -164,7 +164,7 @@ class CollisionsControllerGroundCollisionsTests: XCTestCase {
return
}
- _ = collisionsController.handleJumpWallTileContact(colliderMovement: colliderMovement, isJumpWallLeft: true, shouldCollideGround: true, tileIntersection: jumpWallIntersection)
+ collisionsController.handleJumpWallTileContact(colliderMovement: colliderMovement, isJumpWallLeft: true, shouldCollideGround: true, tileIntersection: jumpWallIntersection)
XCTAssertTrue(colliderMovement.collider.pushesLeftJumpWall)
}
@@ -186,7 +186,7 @@ class CollisionsControllerGroundCollisionsTests: XCTestCase {
return
}
- _ = collisionsController.handleJumpWallTileContact(colliderMovement: colliderMovement, isJumpWallLeft: false, shouldCollideGround: true, tileIntersection: jumpWallIntersection)
+ collisionsController.handleJumpWallTileContact(colliderMovement: colliderMovement, isJumpWallLeft: false, shouldCollideGround: true, tileIntersection: jumpWallIntersection)
XCTAssertTrue(colliderMovement.collider.pushesRightJumpWall)
}
}