feat: work in progress for Stereo Madness level (#43)

Co-authored-by: Djelal BOUDJI <djelal@gmail.com>
This commit is contained in:
djelalb 2025-03-05 16:55:48 +01:00 committed by GitHub
parent 7918d310b6
commit 8c29e86ca6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 266 additions and 14 deletions

View File

@ -39,42 +39,56 @@
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "ObstacleBlock",
"x": 9.0,
"y": -3.0,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "KillZone",
"x": 10.800000190734864,
"y": -3.200000047683716,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "ObstacleBlock",
"x": 12.5,
"y": -3.0,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "ObstacleBlock",
"x": 12.5,
"y": -2.0,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "KillZone",
"x": 14.199999809265137,
"y": -3.200000047683716,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "ObstacleBlock",
"x": 16.0,
"y": -3.0,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "ObstacleBlock",
"x": 16.0,
"y": -2.0,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "ObstacleBlock",
"x": 16.0,
"y": -1.0,
"scaleX": -1.0,
@ -109,14 +123,14 @@
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "ObstacleBlock",
"x": 36.0,
"y": -3.0,
"scaleX": 2.0,
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "ObstacleBlock",
"x": 49.70000076293945,
"y": -3.0,
"scaleX": 2.0,
@ -144,7 +158,7 @@
"scaleY": -1.0
},
{
"type": "ObstacleBloc",
"type": "ObstacleBlock",
"x": 63.400001525878909,
"y": -2.299999952316284,
"scaleX": 2.0,
@ -156,6 +170,41 @@
"y": -0.699999988079071,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "SmallObstacleBlock",
"x": 71.80000305175781,
"y": -0.10000000149011612,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "SmallObstacleBlock",
"x": 75.69999694824219,
"y": 1.399999976158142,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "SmallObstacleBlock",
"x": 79.5999984741211,
"y": 2.700000047683716,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "SmallObstacleBlock",
"x": 83.5,
"y": 4.0,
"scaleX": -1.0,
"scaleY": -1.0
},
{
"type": "SmallObstacleBlock",
"x": 87.4000015258789,
"y": 5.300000190734863,
"scaleX": -1.0,
"scaleY": -1.0
}
]
}

View File

@ -10,8 +10,9 @@ GameObject:
m_Component:
- component: {fileID: 8817250240787629228}
- component: {fileID: 2237815875453143941}
- component: {fileID: 4992961836766527843}
m_Layer: 0
m_Name: ObstacleBloc
m_Name: ObstacleBlock
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -89,6 +90,52 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!61 &4992961836766527843
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1790982024455392374}
m_Enabled: 1
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 5.14, y: 5.14}
newSize: {x: 5.14, y: 5.14}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Size: {x: 5.14, y: 5.14}
m_EdgeRadius: 0
--- !u!1 &1882526919763485512
GameObject:
m_ObjectHideFlags: 0

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3b4ca5c432a93494a8a9e48bb0508895
guid: dd285a9498603a54c96ad07ca4b71792
PrefabImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2519134808436458680
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2286968971515576394}
- component: {fileID: 3126039836224747003}
- component: {fileID: 7184260430798707271}
m_Layer: 0
m_Name: SmallObstacleBlock
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2286968971515576394
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2519134808436458680}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 12.002766, y: 3.1724167, z: 0}
m_LocalScale: {x: 0.2, y: 0.1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &3126039836224747003
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2519134808436458680}
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_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
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: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 5988276385878164123, guid: f5e8531ea5d7ff8428546fe8683ebdb3, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5.14, y: 5.14}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!61 &7184260430798707271
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2519134808436458680}
m_Enabled: 1
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 5.14, y: 5.14}
newSize: {x: 5.14, y: 5.14}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Size: {x: 5.14, y: 5.14}
m_EdgeRadius: 0

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f72a9121f3b777940967f68c64745002
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -3,10 +3,23 @@ using UnityEngine;
public class PlayerCamera : MonoBehaviour
{
public GameObject playerObject;
public const float MIN_Y_FOLLOW = 2.0f;
private float initialY;
public void Update()
private void Start()
{
transform.position = new Vector3(playerObject.transform.position.x, transform.position.y, transform.position.z);
// transform.position = new Vector3(player.transform.position.x, player.transform.position.y, transform.position.z);
initialY = transform.position.y;
}
private void Update()
{
float targetY = initialY;
if (playerObject.transform.position.y > MIN_Y_FOLLOW)
{
targetY = playerObject.transform.position.y;
}
transform.position = new Vector3(playerObject.transform.position.x, targetY, transform.position.z);
}
}