From f684297232dcade5775d94f05a59de159e63bd2f Mon Sep 17 00:00:00 2001 From: miepzerino <o.skotnik@gmail.com> Date: Fri, 29 Dec 2023 03:24:16 +0000 Subject: [PATCH] Added background --- Assets/Sprites/BG/Grass.png.meta | 127 +++++++ Assets/Scripts/PlayerController.cs | 8 Assets/Scenes/GameplayScene.unity | 525 ++++++++++++++++++++++++++++ Assets/Sprites/BG/Ground.png.meta | 127 +++++++ Assets/Sprites/BG/Sky.png | 0 Assets/Scripts/Tiling.cs | 83 ++++ Assets/Characters/Player/player_drill_left_right.anim | 20 Assets/Characters/Player/player_drill_down.anim | 20 Assets/Sprites/BG/Grass.png | 0 Assets/Sprites/BG.meta | 8 Assets/Sprites/BG/Ground.png | 0 Assets/Sprites/BG/Sky.png.meta | 127 +++++++ Assets/Scripts/Tiling.cs.meta | 11 Assets/Scripts/GenerateTileMap.cs | 8 14 files changed, 1,035 insertions(+), 29 deletions(-) diff --git a/Assets/Characters/Player/player_drill_down.anim b/Assets/Characters/Player/player_drill_down.anim index 73af135..6a8462d 100644 --- a/Assets/Characters/Player/player_drill_down.anim +++ b/Assets/Characters/Player/player_drill_down.anim @@ -20,8 +20,8 @@ - serializedVersion: 3 time: 0 value: {x: 0, y: 0, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 980} + outSlope: {x: 0, y: 0, z: 980} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} @@ -29,8 +29,8 @@ - serializedVersion: 3 time: 1 value: {x: 0, y: 0, z: 980} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 980} + outSlope: {x: 0, y: 0, z: 980} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} @@ -273,18 +273,18 @@ - serializedVersion: 3 time: 0 value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + inSlope: 980 + outSlope: 980 + tangentMode: 34 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1 value: 980 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + inSlope: 980 + outSlope: 980 + tangentMode: 34 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 diff --git a/Assets/Characters/Player/player_drill_left_right.anim b/Assets/Characters/Player/player_drill_left_right.anim index bbc1d57..7d09328 100644 --- a/Assets/Characters/Player/player_drill_left_right.anim +++ b/Assets/Characters/Player/player_drill_left_right.anim @@ -20,8 +20,8 @@ - serializedVersion: 3 time: 0 value: {x: 0, y: 0, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 980} + outSlope: {x: 0, y: 0, z: 980} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} @@ -29,8 +29,8 @@ - serializedVersion: 3 time: 1 value: {x: 0, y: 0, z: 980} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 980} + outSlope: {x: 0, y: 0, z: 980} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} @@ -387,18 +387,18 @@ - serializedVersion: 3 time: 0 value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + inSlope: 980 + outSlope: 980 + tangentMode: 34 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 1 value: 980 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + inSlope: 980 + outSlope: 980 + tangentMode: 34 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 diff --git a/Assets/Scenes/GameplayScene.unity b/Assets/Scenes/GameplayScene.unity index 742f20d..2b3c334 100644 --- a/Assets/Scenes/GameplayScene.unity +++ b/Assets/Scenes/GameplayScene.unity @@ -1868,6 +1868,160 @@ - {fileID: 1235149191} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &734382260 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 734382261} + - component: {fileID: 734382264} + - component: {fileID: 734382263} + - component: {fileID: 734382262} + m_Layer: 0 + m_Name: DeepGround + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &734382261 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 734382260} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -213, z: 0} + m_LocalScale: {x: 10, y: -10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 796676099} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &734382262 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 734382260} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bff9938391d7202429e3508a7efde6eb, type: 3} + m_Name: + m_EditorClassIdentifier: + offsetX: 2 + offsetY: 2 + hasRightBuddy: 0 + hasLeftBuddy: 0 + hasTopBuddy: 1 + hasBottomBuddy: 0 + reverseScale: 1 +--- !u!114 &734382263 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 734382260} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 051afb118ce1a7f459dc727505508d77, type: 3} + m_Name: + m_EditorClassIdentifier: + cam: {fileID: 519420031} + followTarget: {fileID: 254538002} +--- !u!212 &734382264 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 734382260} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 1963190711 + m_SortingLayer: -2 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 58a6eeb45a0e2674ab35114433129f28, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 22.5, y: 12} + m_AdaptiveModeThreshold: 0.412 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &796676098 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 796676099} + m_Layer: 0 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &796676099 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 796676098} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1223747238} + - {fileID: 1049982787} + - {fileID: 2045670860} + - {fileID: 734382261} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &851154475 GameObject: m_ObjectHideFlags: 0 @@ -2472,6 +2626,125 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1042147644} m_CullTransparentMesh: 1 +--- !u!1 &1049982786 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1049982787} + - component: {fileID: 1049982790} + - component: {fileID: 1049982789} + - component: {fileID: 1049982788} + m_Layer: 0 + m_Name: HighSky + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1049982787 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1049982786} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 208, z: -2} + m_LocalScale: {x: 10, y: -10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 796676099} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1049982788 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1049982786} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bff9938391d7202429e3508a7efde6eb, type: 3} + m_Name: + m_EditorClassIdentifier: + offsetX: 2 + offsetY: 2 + hasRightBuddy: 0 + hasLeftBuddy: 0 + hasTopBuddy: 0 + hasBottomBuddy: 1 + reverseScale: 1 +--- !u!114 &1049982789 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1049982786} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 051afb118ce1a7f459dc727505508d77, type: 3} + m_Name: + m_EditorClassIdentifier: + cam: {fileID: 519420031} + followTarget: {fileID: 254538002} +--- !u!212 &1049982790 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1049982786} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 1963190711 + m_SortingLayer: -2 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 7d5be99b0261348468ab492c35422f1b, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 84.12234, y: 61.8624} + m_AdaptiveModeThreshold: 0.349 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &1082973124 GameObject: m_ObjectHideFlags: 0 @@ -2695,6 +2968,125 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1219825711} m_CullTransparentMesh: 1 +--- !u!1 &1223747237 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1223747238} + - component: {fileID: 1223747240} + - component: {fileID: 1223747239} + - component: {fileID: 1223747241} + m_Layer: 0 + m_Name: Sky + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1223747238 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1223747237} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 68, z: -2} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 796676099} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1223747239 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1223747237} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 051afb118ce1a7f459dc727505508d77, type: 3} + m_Name: + m_EditorClassIdentifier: + cam: {fileID: 519420031} + followTarget: {fileID: 254538002} +--- !u!212 &1223747240 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1223747237} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 1963190711 + m_SortingLayer: -2 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 7d5be99b0261348468ab492c35422f1b, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 84.12234, y: 61.8624} + m_AdaptiveModeThreshold: 0.349 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1223747241 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1223747237} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bff9938391d7202429e3508a7efde6eb, type: 3} + m_Name: + m_EditorClassIdentifier: + offsetX: 2 + offsetY: 2 + hasRightBuddy: 0 + hasLeftBuddy: 0 + hasTopBuddy: 0 + hasBottomBuddy: 1 + reverseScale: 1 --- !u!1 &1235149190 GameObject: m_ObjectHideFlags: 0 @@ -4338,7 +4730,7 @@ m_GameObject: {fileID: 1919262556} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -128, y: -257, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -4675,9 +5067,6 @@ m_Script: {fileID: 11500000, guid: 000b2ca4a3c14d04e8c8a5c1084c700f, type: 3} m_Name: m_EditorClassIdentifier: - maxWidth: 256 - maxHeight: 384 - maxGroundHeight: 256 forestRuleTile: {fileID: 11400000, guid: e77c00aec3ec74f4a9ec15ef63c3f9a7, type: 2} borderTile: {fileID: 11400000, guid: dcef846474e534b45ab3b175559c19a2, type: 2} ores: @@ -4772,12 +5161,12 @@ m_Component: - component: {fileID: 2010473986} m_Layer: 0 - m_Name: Background + m_Name: Background2 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &2010473986 Transform: m_ObjectHideFlags: 0 @@ -4796,6 +5185,125 @@ - {fileID: 1029677423} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2045670859 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2045670860} + - component: {fileID: 2045670862} + - component: {fileID: 2045670861} + - component: {fileID: 2045670863} + m_Layer: 0 + m_Name: Ground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2045670860 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045670859} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -72, z: -1} + m_LocalScale: {x: 10, y: 10, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 796676099} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2045670861 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045670859} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 051afb118ce1a7f459dc727505508d77, type: 3} + m_Name: + m_EditorClassIdentifier: + cam: {fileID: 519420031} + followTarget: {fileID: 254538002} +--- !u!212 &2045670862 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045670859} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 1963190711 + m_SortingLayer: -2 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 58a6eeb45a0e2674ab35114433129f28, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 22.5, y: 12} + m_AdaptiveModeThreshold: 0.412 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &2045670863 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045670859} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bff9938391d7202429e3508a7efde6eb, type: 3} + m_Name: + m_EditorClassIdentifier: + offsetX: 2 + offsetY: 2 + hasRightBuddy: 0 + hasLeftBuddy: 0 + hasTopBuddy: 1 + hasBottomBuddy: 0 + reverseScale: 1 --- !u!1 &2064964499 GameObject: m_ObjectHideFlags: 0 @@ -5131,6 +5639,10 @@ propertyPath: m_Name value: GameManager objectReference: {fileID: 0} + - target: {fileID: 8598998496262044661, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -5213,6 +5725,7 @@ - {fileID: 257677327013671455} - {fileID: 1624236512} - {fileID: 2010473986} + - {fileID: 796676099} - {fileID: 727795133} - {fileID: 75655679957548990} - {fileID: 2064964503} diff --git a/Assets/Scripts/GenerateTileMap.cs b/Assets/Scripts/GenerateTileMap.cs index 231f61a..7069661 100644 --- a/Assets/Scripts/GenerateTileMap.cs +++ b/Assets/Scripts/GenerateTileMap.cs @@ -32,9 +32,9 @@ public class GenerateTileMap : MonoBehaviour { public int? seed; - public int maxWidth = 256; - public int maxHeight = 384; - public int maxGroundHeight = 256; + public static int maxWidth = 256; + public static int maxHeight = 384; + public static int maxGroundHeight = 256; private float scale; private float offsetX; private float offsetY; @@ -56,6 +56,8 @@ } SetSettingsFromSeed(seed.Value); + + transform.position = new Vector3((maxWidth / 2) * -1, (maxGroundHeight + 1) * -1, transform.position.z); } public void SetSettingsFromSeed(int seed) diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index d31b599..5edb404 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -267,6 +267,10 @@ public void OnMove(InputAction.CallbackContext context) { + if (!health.IsAlive) + { + return; + } moveInput = context.ReadValue<Vector2>(); IsMoving = moveInput.x != 0; @@ -372,6 +376,10 @@ public void TakeDamage(int damage) { health.Hit(damage); + if (!health.IsAlive) + { + rb.velocity = Vector3.zero; + } } public void TakeFallDamage(int fallDamage) diff --git a/Assets/Scripts/Tiling.cs b/Assets/Scripts/Tiling.cs new file mode 100644 index 0000000..ce70561 --- /dev/null +++ b/Assets/Scripts/Tiling.cs @@ -0,0 +1,83 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[RequireComponent(typeof(SpriteRenderer))] +public class Tiling : MonoBehaviour +{ + public int offsetX = 2; + public int offsetY = 2; + + public bool hasRightBuddy = false; + public bool hasLeftBuddy = false; + public bool hasTopBuddy = false; + public bool hasBottomBuddy = false; + + public bool reverseScale = false; + + private float spriteWidth = 0f; + private float spriteHeight = 0f; + private Camera cam; + private Transform myTransform; + + private void Awake() + { + cam = Camera.main; + myTransform = transform; + } + // Start is called before the first frame update + void Start() + { + SpriteRenderer spriteRenderer = GetComponent<SpriteRenderer>(); + spriteWidth = spriteRenderer.sprite.bounds.size.x; + spriteHeight = spriteRenderer.sprite.bounds.size.y; + + //GenerateBackground(); + } + + // Update is called once per frame + void Update() + { + if (!hasLeftBuddy || !hasRightBuddy) + { + float camHorizontalExtend = cam.orthographicSize * Screen.width / Screen.height; + + float edgeVisiblePositionRight = (transform.position.x + spriteWidth / 2) - camHorizontalExtend; + float edgeVisiblePositionLeft = (transform.position.x - spriteWidth / 2) + camHorizontalExtend; + + if (cam.transform.position.x >= edgeVisiblePositionRight - offsetX && !hasRightBuddy) + { + MakeNewRightOrLeftBuddy(1); + hasRightBuddy = true; + } + else if (cam.transform.position.x <= edgeVisiblePositionLeft + offsetX && !hasLeftBuddy) + { + MakeNewRightOrLeftBuddy(-1); + hasLeftBuddy = true; + } + } + } + + private void MakeNewRightOrLeftBuddy(int rightOrLeft) + { + Vector3 newPosition = new Vector3(myTransform.position.x + spriteWidth * rightOrLeft, myTransform.position.y, myTransform.position.z); + Transform newBuddy = Instantiate(myTransform, newPosition, myTransform.rotation); + + if (reverseScale) + { + newBuddy.localScale = new Vector3(newBuddy.localScale.x * -1, newBuddy.localScale.y, newBuddy.localScale.z); + } + + newBuddy.parent = myTransform.parent; + newBuddy.name = myTransform.name; + + if (rightOrLeft > 0) + { + newBuddy.GetComponent<Tiling>().hasLeftBuddy = true; + } + else if (rightOrLeft < 0) + { + newBuddy.GetComponent<Tiling>().hasRightBuddy = true; + } + } +} diff --git a/Assets/Scripts/Tiling.cs.meta b/Assets/Scripts/Tiling.cs.meta new file mode 100644 index 0000000..edd6680 --- /dev/null +++ b/Assets/Scripts/Tiling.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bff9938391d7202429e3508a7efde6eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/BG.meta b/Assets/Sprites/BG.meta new file mode 100644 index 0000000..ab10a90 --- /dev/null +++ b/Assets/Sprites/BG.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e94c8ebeef920794fa542ecab05cd35d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/BG/Grass.png b/Assets/Sprites/BG/Grass.png new file mode 100644 index 0000000..f2e41da --- /dev/null +++ b/Assets/Sprites/BG/Grass.png Binary files differ diff --git a/Assets/Sprites/BG/Grass.png.meta b/Assets/Sprites/BG/Grass.png.meta new file mode 100644 index 0000000..a61f222 --- /dev/null +++ b/Assets/Sprites/BG/Grass.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: c5f6946615bdcd54496d9a9f79a87857 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 16 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/BG/Ground.png b/Assets/Sprites/BG/Ground.png new file mode 100644 index 0000000..72485a6 --- /dev/null +++ b/Assets/Sprites/BG/Ground.png Binary files differ diff --git a/Assets/Sprites/BG/Ground.png.meta b/Assets/Sprites/BG/Ground.png.meta new file mode 100644 index 0000000..a586fe9 --- /dev/null +++ b/Assets/Sprites/BG/Ground.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 58a6eeb45a0e2674ab35114433129f28 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 16 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/BG/Sky.png b/Assets/Sprites/BG/Sky.png new file mode 100644 index 0000000..1a15777 --- /dev/null +++ b/Assets/Sprites/BG/Sky.png Binary files differ diff --git a/Assets/Sprites/BG/Sky.png.meta b/Assets/Sprites/BG/Sky.png.meta new file mode 100644 index 0000000..953a9d7 --- /dev/null +++ b/Assets/Sprites/BG/Sky.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 7d5be99b0261348468ab492c35422f1b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 16 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: -- Gitblit v1.9.3