From a04f7504c10406d383168485cc21d5f049e6ceeb Mon Sep 17 00:00:00 2001 From: Giovani Date: Sat, 1 Feb 2020 08:58:17 -0500 Subject: [PATCH] Fixed issue with wall jump and added event controls --- Assets/Scenes/LevelOne.unity | 456 +----------------- Assets/Scripts/EventControlsDisplay.cs | 12 +- Assets/Sprites/Controls.meta | 8 + Assets/Sprites/Controls/Control W.asset | 36 ++ Assets/Sprites/Controls/Control W.asset.meta | 8 + Assets/Sprites/Controls/Control W.png | Bin 0 -> 78 bytes Assets/Sprites/Controls/Control W.png.meta | 103 ++++ Assets/Sprites/Controls/Plus.asset | 36 ++ Assets/Sprites/Controls/Plus.asset.meta | 8 + Assets/Sprites/Controls/Plus.png | Bin 0 -> 78 bytes Assets/Sprites/Controls/Plus.png.meta | 110 +++++ Assets/Sprites/Palette/Event Controls.prefab | 220 +++++++++ .../Palette/Event Controls.prefab.meta | 7 + 13 files changed, 564 insertions(+), 440 deletions(-) create mode 100644 Assets/Sprites/Controls.meta create mode 100644 Assets/Sprites/Controls/Control W.asset create mode 100644 Assets/Sprites/Controls/Control W.asset.meta create mode 100644 Assets/Sprites/Controls/Control W.png create mode 100644 Assets/Sprites/Controls/Control W.png.meta create mode 100644 Assets/Sprites/Controls/Plus.asset create mode 100644 Assets/Sprites/Controls/Plus.asset.meta create mode 100644 Assets/Sprites/Controls/Plus.png create mode 100644 Assets/Sprites/Controls/Plus.png.meta create mode 100644 Assets/Sprites/Palette/Event Controls.prefab create mode 100644 Assets/Sprites/Palette/Event Controls.prefab.meta diff --git a/Assets/Scenes/LevelOne.unity b/Assets/Scenes/LevelOne.unity index ff0e550..f359037 100644 --- a/Assets/Scenes/LevelOne.unity +++ b/Assets/Scenes/LevelOne.unity @@ -249,7 +249,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: camera: {fileID: 1146013791} - tile: {fileID: 11400000, guid: 45e32cdeeb7c7994cbd282d9fd4279ec, type: 2} + controlTiles: + - {fileID: 11400000, guid: e9392359bf3de5a488020d4288c77800, type: 2} + plusTile: {fileID: 11400000, guid: d66a38cd85f109a42868a5040b5c892b, type: 2} --- !u!1 &1008122161 GameObject: m_ObjectHideFlags: 0 @@ -315,7 +317,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: player: {fileID: 1671840916} - offsetY: 5 + offsetY: 2 interpolate: 0.2 --- !u!20 &1146013791 stripped Camera: @@ -758,42 +760,18 @@ CompositeCollider2D: m_ColliderPaths: - m_Collider: {fileID: 2120494080} m_ColliderPaths: - - - X: 60000041 - Y: -100 - - X: 60000100 - Y: -41 - - X: 60000100 - Y: 9999900 - - X: 140000041 - Y: 9999900 - - X: 140000100 - Y: 9999959 - - X: 140000100 - Y: 20000041 - - X: 140000041 - Y: 20000100 - - X: 60000100 - Y: 20000100 - - X: 60000100 - Y: 40000041 - - X: 60000041 - Y: 40000100 - - X: 50000100 - Y: 40000100 - - X: 50000100 - Y: 50000041 - - X: 50000041 - Y: 50000100 - - X: 9999959 - Y: 50000100 - - X: 9999900 - Y: 50000041 - - X: 9999900 - Y: -9999900 + - - X: 300000000 + Y: -30000000 + - X: 30000100 + Y: -30000000 + - X: 30000100 + Y: -30000041 + - X: 30000041 + Y: -30000100 - X: -10000041 - Y: -9999900 + Y: -30000100 - X: -10000100 - Y: -9999959 + Y: -30000041 - X: -10000100 Y: -30000000 - X: -160000000 @@ -802,30 +780,10 @@ CompositeCollider2D: Y: -40000000 - X: 300000000 Y: -40000000 - - X: 300000000 - Y: -30000000 - - X: 30000100 - Y: -30000000 - - X: 30000100 - Y: -100 m_CompositePaths: m_Paths: - - {x: 29.999971, y: -4} - {x: 29.999971, y: -3} - - {x: 3.00001, y: -2.9999707} - - {x: 3.0000393, y: -0.00001} - - {x: 6.00001, y: 0.0000252} - - {x: 6.000039, y: 0.99999} - - {x: 14.00001, y: 1.0000252} - - {x: 13.999974, y: 2.00001} - - {x: 6.00001, y: 2.0000393} - - {x: 5.9999747, y: 4.00001} - - {x: 5.00001, y: 4.000039} - - {x: 4.9999747, y: 5.00001} - - {x: 0.99999, y: 4.9999747} - - {x: 0.9999606, y: -0.99999} - - {x: -1.00001, y: -1.0000252} - - {x: -1.0000395, y: -3} - {x: -16, y: -3.0000293} - {x: -15.999971, y: -4} m_VertexDistance: 0.0005 @@ -1336,393 +1294,15 @@ Tilemap: m_ObjectToInstantiate: {fileID: 0} m_TileFlags: 1 m_ColliderType: 1 - - first: {x: -1, y: -3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 0, y: -3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: -3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: -3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: -1, y: -2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 0, y: -2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: -2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: -2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: -1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: -1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: 0, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: 0, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 3, y: 0, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 4, y: 0, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 5, y: 0, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 3, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 4, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 5, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 6, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 7, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 8, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 9, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 10, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 11, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 12, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 13, y: 1, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: 2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: 2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 3, y: 2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 4, y: 2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 5, y: 2, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: 3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: 3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 3, y: 3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 4, y: 3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 5, y: 3, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 1, y: 4, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 2, y: 4, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 3, y: 4, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 - - first: {x: 4, y: 4, z: 0} - second: - m_TileIndex: 0 - m_TileSpriteIndex: 0 - m_TileMatrixIndex: 0 - m_TileColorIndex: 0 - m_ObjectToInstantiate: {fileID: 0} - m_TileFlags: 1 - m_ColliderType: 1 m_AnimatedTiles: {} m_TileAssetArray: - - m_RefCount: 88 + - m_RefCount: 46 m_Data: {fileID: 11400000, guid: 45e32cdeeb7c7994cbd282d9fd4279ec, type: 2} m_TileSpriteArray: - - m_RefCount: 88 + - m_RefCount: 46 m_Data: {fileID: 21300000, guid: 37077009adda5004cad02be3083a5bff, type: 3} m_TileMatrixArray: - - m_RefCount: 88 + - m_RefCount: 46 m_Data: e00: 1 e01: 0 @@ -1741,7 +1321,7 @@ Tilemap: e32: 0 e33: 1 m_TileColorArray: - - m_RefCount: 88 + - m_RefCount: 46 m_Data: {r: 1, g: 1, b: 1, a: 1} m_AnimationFrameRate: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Scripts/EventControlsDisplay.cs b/Assets/Scripts/EventControlsDisplay.cs index e1356ed..cd5131a 100644 --- a/Assets/Scripts/EventControlsDisplay.cs +++ b/Assets/Scripts/EventControlsDisplay.cs @@ -6,9 +6,10 @@ using UnityEngine.Tilemaps; public class EventControlsDisplay : MonoBehaviour { [SerializeField] private Camera camera; + [SerializeField] private Tile[] controlTiles; + [SerializeField] private Tile plusTile; private Tilemap tilemap; - [SerializeField] private Tile tile; void Start() { @@ -17,6 +18,13 @@ public class EventControlsDisplay : MonoBehaviour void Update() { - tilemap.SetTile(new Vector3Int((int)camera.transform.position.x, (int)camera.transform.position.y, (int)camera.transform.position.z), tile); + tilemap.SetTile(GetCameraTilePosition(), plusTile); + } + + Vector3Int GetCameraTilePosition() + { + return new Vector3Int((int)camera.transform.position.x, + (int)camera.transform.position.y, + (int)camera.transform.position.z); } } diff --git a/Assets/Sprites/Controls.meta b/Assets/Sprites/Controls.meta new file mode 100644 index 0000000..5b027c5 --- /dev/null +++ b/Assets/Sprites/Controls.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 394b12e250ac73549b5a1bd20b0c4910 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/Controls/Control W.asset b/Assets/Sprites/Controls/Control W.asset new file mode 100644 index 0000000..2eafb4d --- /dev/null +++ b/Assets/Sprites/Controls/Control W.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0} + m_Name: Control W + m_EditorClassIdentifier: + m_Sprite: {fileID: 21300000, guid: 940d08f541b1e9c45af44e43a58cc021, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Transform: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_InstancedGameObject: {fileID: 0} + m_Flags: 1 + m_ColliderType: 1 diff --git a/Assets/Sprites/Controls/Control W.asset.meta b/Assets/Sprites/Controls/Control W.asset.meta new file mode 100644 index 0000000..a0eadc0 --- /dev/null +++ b/Assets/Sprites/Controls/Control W.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e9392359bf3de5a488020d4288c77800 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/Controls/Control W.png b/Assets/Sprites/Controls/Control W.png new file mode 100644 index 0000000000000000000000000000000000000000..8eb1b1ecc13b6e1d2375151866134cd7a040340c GIT binary patch literal 78 zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1|(O0oL2{=L_J*`LpWrU|M0W$cr!i aF)*;jval%k!i aF)*;jval%k