From 0eabe14ee24b7540931146bd2cfb9fc30cfd07e7 Mon Sep 17 00:00:00 2001 From: dart Date: Sun, 3 Apr 2022 13:59:27 +0300 Subject: [PATCH] deathScreen and timer --- ldjam50/Assets/Scenes/SampleScene.unity | 433 +++++++++++++++++- ldjam50/Assets/Scripts/Character.cs | 15 + ldjam50/Assets/Scripts/DebugUI.cs | 6 +- ldjam50/Assets/Scripts/Gameplay.cs | 52 +++ ldjam50/Assets/Scripts/Gameplay.cs.meta | 11 + ldjam50/Assets/Sprites/UI.meta | 8 + ldjam50/Assets/Sprites/UI/1-0.png | 3 + ldjam50/Assets/Sprites/UI/1-0.png.meta | 108 +++++ .../UI/2edd9d1c2abcd10965c1284e796a4f94.jpg | 3 + .../2edd9d1c2abcd10965c1284e796a4f94.jpg.meta | 108 +++++ ldjam50/Assets/Sprites/UI/youdied.png | 3 + ldjam50/Assets/Sprites/UI/youdied.png.meta | 108 +++++ 12 files changed, 848 insertions(+), 10 deletions(-) create mode 100644 ldjam50/Assets/Scripts/Gameplay.cs create mode 100644 ldjam50/Assets/Scripts/Gameplay.cs.meta create mode 100644 ldjam50/Assets/Sprites/UI.meta create mode 100644 ldjam50/Assets/Sprites/UI/1-0.png create mode 100644 ldjam50/Assets/Sprites/UI/1-0.png.meta create mode 100644 ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg create mode 100644 ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg.meta create mode 100644 ldjam50/Assets/Sprites/UI/youdied.png create mode 100644 ldjam50/Assets/Sprites/UI/youdied.png.meta diff --git a/ldjam50/Assets/Scenes/SampleScene.unity b/ldjam50/Assets/Scenes/SampleScene.unity index f06246b..9a0d6f2 100644 --- a/ldjam50/Assets/Scenes/SampleScene.unity +++ b/ldjam50/Assets/Scenes/SampleScene.unity @@ -158,7 +158,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: -0.0039978, y: -43.914} - m_SizeDelta: {x: 232.88, y: 21.9572} + m_SizeDelta: {x: 224.12, y: 21.9572} m_Pivot: {x: 0, y: 1} --- !u!114 &158288057 MonoBehaviour: @@ -279,8 +279,83 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: -0.0039978, y: -65.871} - m_SizeDelta: {x: 232.88, y: 21.9572} + m_SizeDelta: {x: 224.12, y: 21.9572} m_Pivot: {x: 0, y: 1} +--- !u!1 &257659393 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 257659394} + - component: {fileID: 257659396} + - component: {fileID: 257659395} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &257659394 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 257659393} + 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_Children: [] + m_Father: {fileID: 962340577} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &257659395 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 257659393} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2924528, g: 0.2924528, b: 0.2924528, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: c052104a4cb29798a8881fb590f738e9, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &257659396 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 257659393} + m_CullTransparentMesh: 1 --- !u!114 &338359682 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 4520856288189812233, guid: d58051113365413fe9782fa6b28125fc, type: 3} @@ -372,7 +447,7 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 1869821417} + m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &522920934 @@ -408,7 +483,9 @@ MonoBehaviour: verInpText: {fileID: 1586286654} characterHealthText: {fileID: 158288057} characterDamageText: {fileID: 162628500} + timerText: {fileID: 1506820046} character: {fileID: 338359682} + gameplay: {fileID: 1483883356} --- !u!4 &522920936 Transform: m_ObjectHideFlags: 0 @@ -422,7 +499,7 @@ Transform: m_Children: - {fileID: 1061288648} m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &679042026 GameObject: @@ -454,6 +531,138 @@ Transform: m_Father: {fileID: 1682053527} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &732765870 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 732765871} + m_Layer: 0 + m_Name: Death Screen + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &732765871 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 732765870} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.8847423, y: 1.6799449, z: -0.5426142} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 962340577} + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &962340576 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 962340577} + - component: {fileID: 962340580} + - component: {fileID: 962340579} + - component: {fileID: 962340578} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &962340577 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 962340576} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 257659394} + - {fileID: 1650900606} + m_Father: {fileID: 732765871} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &962340578 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 962340576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &962340579 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 962340576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &962340580 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 962340576} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &1061288647 GameObject: m_ObjectHideFlags: 0 @@ -625,7 +834,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 1137981222306597008, guid: d58051113365413fe9782fa6b28125fc, type: 3} propertyPath: m_RootOrder - value: 0 + value: 2 objectReference: {fileID: 0} - target: {fileID: 1137981222306597008, guid: d58051113365413fe9782fa6b28125fc, type: 3} propertyPath: m_LocalPosition.x @@ -679,6 +888,10 @@ PrefabInstance: propertyPath: moveSpeed value: 0.02 objectReference: {fileID: 0} + - target: {fileID: 4520856288189812233, guid: d58051113365413fe9782fa6b28125fc, type: 3} + propertyPath: mainCamera + value: + objectReference: {fileID: 519420028} - target: {fileID: 8006084803627600395, guid: d58051113365413fe9782fa6b28125fc, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -743,8 +956,134 @@ Transform: m_Children: - {fileID: 1080547518} m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1483883354 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1483883355} + - component: {fileID: 1483883356} + m_Layer: 0 + m_Name: Gameplay + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1483883355 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1483883354} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.11249548, y: -1.3275816, z: -2.2409081} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1483883356 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1483883354} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc38bb79a5b3bcf1cbfe445f8947bc62, type: 3} + m_Name: + m_EditorClassIdentifier: + character: {fileID: 1869821414} + overMind: {fileID: 1682053525} + timeOnStart: 30 + DeathScreen: {fileID: 0} +--- !u!1 &1506820044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1506820045} + - component: {fileID: 1506820047} + - component: {fileID: 1506820046} + m_Layer: 5 + m_Name: Text (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1506820045 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1506820044} + 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_Children: [] + m_Father: {fileID: 1588408215} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: -0.0039978, y: -87.828} + m_SizeDelta: {x: 224.12, y: 21.9572} + m_Pivot: {x: 0, y: 1} +--- !u!114 &1506820046 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1506820044} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: New Text +--- !u!222 &1506820047 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1506820044} + m_CullTransparentMesh: 1 --- !u!1 &1560770443 GameObject: m_ObjectHideFlags: 0 @@ -810,7 +1149,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: -0.003982544, y: -21.957} - m_SizeDelta: {x: 232.88, y: 21.9572} + m_SizeDelta: {x: 224.12, y: 21.9572} m_Pivot: {x: 0, y: 1} --- !u!114 &1586286654 MonoBehaviour: @@ -885,6 +1224,7 @@ RectTransform: - {fileID: 1586286653} - {fileID: 158288056} - {fileID: 162628502} + - {fileID: 1506820045} m_Father: {fileID: 1061288648} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -893,6 +1233,81 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1650900605 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1650900606} + - component: {fileID: 1650900608} + - component: {fileID: 1650900607} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1650900606 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650900605} + 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_Children: [] + m_Father: {fileID: 962340577} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 545.5679, y: 68.1959} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &1650900607 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650900605} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 9a63a2881f7e8fe78b392dcfb16cacf5, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1650900608 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650900605} + m_CullTransparentMesh: 1 --- !u!1 &1682053525 GameObject: m_ObjectHideFlags: 0 @@ -945,7 +1360,7 @@ Transform: - {fileID: 679042027} - {fileID: 1560770444} m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1785741448 PrefabInstance: @@ -1076,7 +1491,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1794908886 GameObject: @@ -1155,7 +1570,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: -0.000015258789, y: 0} - m_SizeDelta: {x: 232.88, y: 21.9572} + m_SizeDelta: {x: 224.12, y: 21.9572} m_Pivot: {x: 0, y: 1} --- !u!1 &1869821414 stripped GameObject: diff --git a/ldjam50/Assets/Scripts/Character.cs b/ldjam50/Assets/Scripts/Character.cs index f0615dd..3dbdcc1 100644 --- a/ldjam50/Assets/Scripts/Character.cs +++ b/ldjam50/Assets/Scripts/Character.cs @@ -11,6 +11,7 @@ public class Character : MonoBehaviour [SerializeField] private float moveSpeed; [SerializeField] private GameObject characterSprite; [SerializeField] private Animator characterAnimator; + [SerializeField] private GameObject mainCamera; private float horInpt; private float verInpt; @@ -54,6 +55,15 @@ void Update() characterAnimator.SetBool("IsRun", true); transform.position += new Vector3(0,verInpt * moveSpeed,0); } + + MoveCamera(); + } + + + + private void MoveCamera() + { + mainCamera.transform.position = new Vector3(transform.position.x, transform.position.y,-10); } public StatReturn GetStats() @@ -71,4 +81,9 @@ public void ApplyDamage(float damage) { health -= damage; } + + public float GetHealth() + { + return health; + } } diff --git a/ldjam50/Assets/Scripts/DebugUI.cs b/ldjam50/Assets/Scripts/DebugUI.cs index 1ff22b6..edca855 100644 --- a/ldjam50/Assets/Scripts/DebugUI.cs +++ b/ldjam50/Assets/Scripts/DebugUI.cs @@ -10,8 +10,10 @@ public class DebugUI : MonoBehaviour [SerializeField] private Text characterHealthText; [SerializeField] private Text characterDamageText; + [SerializeField] private Text timerText; [SerializeField] private Character character; + [SerializeField] private Gameplay gameplay; // Start is called before the first frame update @@ -29,6 +31,8 @@ void Update() characterHealthText.text = "health = " + characterStats.Health; characterDamageText.text = "damage = " + characterStats.Damage; - + + timerText.text = "timer = " + gameplay.GetTimer(); + } } diff --git a/ldjam50/Assets/Scripts/Gameplay.cs b/ldjam50/Assets/Scripts/Gameplay.cs new file mode 100644 index 0000000..0478d25 --- /dev/null +++ b/ldjam50/Assets/Scripts/Gameplay.cs @@ -0,0 +1,52 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Gameplay : MonoBehaviour +{ + [SerializeField] private GameObject character; + private Character _characterCharacterClass; + [SerializeField] private GameObject overMind; + [SerializeField] private float timeOnStart; + [SerializeField] private GameObject DeathScreen; + private float _time; + private GameStates _curGameState; + public enum GameStates + { + Game, + GameOver, + NewAbility + } + // Start is called before the first frame update + void Start() + { + _curGameState = GameStates.Game; + _time = timeOnStart; + _characterCharacterClass = character.GetComponent(); + } + + // Update is called once per frame + void Update() + { + if (_time < 0 || _characterCharacterClass.GetHealth() <= 0) + { + _curGameState = GameStates.GameOver; + } + if (_curGameState == GameStates.Game) + { + _time -= Time.deltaTime; + } + if (_curGameState == GameStates.GameOver) + { + character.SetActive(false); + overMind.SetActive(false); + + DeathScreen.SetActive(true); + } + } + + public float GetTimer() + { + return _time; + } +} diff --git a/ldjam50/Assets/Scripts/Gameplay.cs.meta b/ldjam50/Assets/Scripts/Gameplay.cs.meta new file mode 100644 index 0000000..3ddfdec --- /dev/null +++ b/ldjam50/Assets/Scripts/Gameplay.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc38bb79a5b3bcf1cbfe445f8947bc62 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ldjam50/Assets/Sprites/UI.meta b/ldjam50/Assets/Sprites/UI.meta new file mode 100644 index 0000000..86c15ed --- /dev/null +++ b/ldjam50/Assets/Sprites/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ba0ee4b016381138b7eed2e152ef1a2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ldjam50/Assets/Sprites/UI/1-0.png b/ldjam50/Assets/Sprites/UI/1-0.png new file mode 100644 index 0000000..ec60e8d --- /dev/null +++ b/ldjam50/Assets/Sprites/UI/1-0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c22493f07babeb02fb7d9f40ec4440408407a59584cf4fc4edffad7fca8ddd7 +size 504 diff --git a/ldjam50/Assets/Sprites/UI/1-0.png.meta b/ldjam50/Assets/Sprites/UI/1-0.png.meta new file mode 100644 index 0000000..3e5718c --- /dev/null +++ b/ldjam50/Assets/Sprites/UI/1-0.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 0f5c81a66e416fe13a9c6d970a219a03 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + 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: 100 + 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 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg b/ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg new file mode 100644 index 0000000..ab598fd --- /dev/null +++ b/ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d36bbb9fbf1908837a59641dc9dfc937dfe5fdea090584b4366c6a2df3a3ebff +size 12437 diff --git a/ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg.meta b/ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg.meta new file mode 100644 index 0000000..9e9957b --- /dev/null +++ b/ldjam50/Assets/Sprites/UI/2edd9d1c2abcd10965c1284e796a4f94.jpg.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: c052104a4cb29798a8881fb590f738e9 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 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: 100 + 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 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 128 + resizeAlgorithm: 1 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 1 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ldjam50/Assets/Sprites/UI/youdied.png b/ldjam50/Assets/Sprites/UI/youdied.png new file mode 100644 index 0000000..17c84e6 --- /dev/null +++ b/ldjam50/Assets/Sprites/UI/youdied.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77dfd815ce5a090ef74b5a3d9fae75784a3b24fa3c236796c5240550d6c83a8e +size 328 diff --git a/ldjam50/Assets/Sprites/UI/youdied.png.meta b/ldjam50/Assets/Sprites/UI/youdied.png.meta new file mode 100644 index 0000000..37f3bc2 --- /dev/null +++ b/ldjam50/Assets/Sprites/UI/youdied.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 9a63a2881f7e8fe78b392dcfb16cacf5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 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: 100 + 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 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: