diff --git a/.idea/.idea.SpringJam2026/.idea/workspace.xml b/.idea/.idea.SpringJam2026/.idea/workspace.xml index 369b004..58a394d 100644 --- a/.idea/.idea.SpringJam2026/.idea/workspace.xml +++ b/.idea/.idea.SpringJam2026/.idea/workspace.xml @@ -6,11 +6,16 @@ - - + + + + + + + + - + @@ -40,23 +46,23 @@ - { + "keyToString": { + "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true", + "Attach to Unity Editor.Attach to Unity Editor.executor": "Debug", + "ModuleVcsDetector.initialDetectionPerformed": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.git.unshallow": "true", + "git-widget-placeholder": "main", + "ignore.virus.scanning.warn.message": "true", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "vue.rearranger.settings.migration": "true" } -}]]> +} - + diff --git a/Assets/Audio/SFX.meta b/Assets/Audio/SFX.meta new file mode 100644 index 0000000..ddef356 --- /dev/null +++ b/Assets/Audio/SFX.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bff06c94c30a74e4d9a941ee0f422091 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/SFX/bump.aiff b/Assets/Audio/SFX/bump.aiff new file mode 100644 index 0000000..1501ac7 Binary files /dev/null and b/Assets/Audio/SFX/bump.aiff differ diff --git a/Assets/Audio/SFX/bump.aiff.meta b/Assets/Audio/SFX/bump.aiff.meta new file mode 100644 index 0000000..b9c6a3e --- /dev/null +++ b/Assets/Audio/SFX/bump.aiff.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 7c28608e819f6574193756354a7974fe +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/SFX/jump.mp3 b/Assets/Audio/SFX/jump.mp3 new file mode 100644 index 0000000..c71fdfa --- /dev/null +++ b/Assets/Audio/SFX/jump.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c89de454c43191d66197d3ef8f5edfbfe856ae18c8b3c9808f54b1bfa9336403 +size 3792 diff --git a/Assets/Audio/SFX/jump.mp3.meta b/Assets/Audio/SFX/jump.mp3.meta new file mode 100644 index 0000000..733766e --- /dev/null +++ b/Assets/Audio/SFX/jump.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0734beac3512cee4783e5a66f9df87bb +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 1 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/SFX/pickup.mp3 b/Assets/Audio/SFX/pickup.mp3 new file mode 100644 index 0000000..7c58291 --- /dev/null +++ b/Assets/Audio/SFX/pickup.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a25c8f24fc51c1a26689d779635d5a98030055e8516843c4430859529175a16a +size 38209 diff --git a/Assets/Audio/SFX/pickup.mp3.meta b/Assets/Audio/SFX/pickup.mp3.meta new file mode 100644 index 0000000..d7ecda3 --- /dev/null +++ b/Assets/Audio/SFX/pickup.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 4f190d6dc258d8f4b843f97dd0e5d2db +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 1 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/SFX/spring.wav b/Assets/Audio/SFX/spring.wav new file mode 100644 index 0000000..4cfadeb --- /dev/null +++ b/Assets/Audio/SFX/spring.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd156db0002e22f9538958defc9dd407f6b1a5734fbdb98b8d0a3373bae64168 +size 294304 diff --git a/Assets/Audio/SFX/spring.wav.meta b/Assets/Audio/SFX/spring.wav.meta new file mode 100644 index 0000000..6b9526d --- /dev/null +++ b/Assets/Audio/SFX/spring.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 07e96691431e68849b974e73b4e1dc2c +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 1 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Catepillar/Fall.anim b/Assets/Prefabs/Catepillar/Fall.anim index 525b68e..9da04ea 100644 --- a/Assets/Prefabs/Catepillar/Fall.anim +++ b/Assets/Prefabs/Catepillar/Fall.anim @@ -23,7 +23,7 @@ AnimationClip: - time: 0 value: {fileID: -2070610911, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} attribute: m_Sprite - path: + path: Sprite classID: 212 script: {fileID: 0} flags: 2 @@ -35,7 +35,7 @@ AnimationClip: m_ClipBindingConstant: genericBindings: - serializedVersion: 2 - path: 0 + path: 850496168 attribute: 0 script: {fileID: 0} typeID: 212 diff --git a/Assets/Prefabs/Catepillar/Idle.anim b/Assets/Prefabs/Catepillar/Idle.anim index bfb942d..43a4d02 100644 --- a/Assets/Prefabs/Catepillar/Idle.anim +++ b/Assets/Prefabs/Catepillar/Idle.anim @@ -23,7 +23,7 @@ AnimationClip: - time: 0 value: {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} attribute: m_Sprite - path: + path: Sprite classID: 212 script: {fileID: 0} flags: 2 @@ -35,7 +35,7 @@ AnimationClip: m_ClipBindingConstant: genericBindings: - serializedVersion: 2 - path: 0 + path: 850496168 attribute: 0 script: {fileID: 0} typeID: 212 diff --git a/Assets/Prefabs/Catepillar/Jump.anim b/Assets/Prefabs/Catepillar/Jump.anim index 87681a0..6952bf6 100644 --- a/Assets/Prefabs/Catepillar/Jump.anim +++ b/Assets/Prefabs/Catepillar/Jump.anim @@ -23,7 +23,7 @@ AnimationClip: - time: 0 value: {fileID: 9201126744234322706, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} attribute: m_Sprite - path: + path: Sprite classID: 212 script: {fileID: 0} flags: 2 @@ -35,7 +35,7 @@ AnimationClip: m_ClipBindingConstant: genericBindings: - serializedVersion: 2 - path: 0 + path: 850496168 attribute: 0 script: {fileID: 0} typeID: 212 @@ -55,7 +55,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Prefabs/Catepillar/Player.controller b/Assets/Prefabs/Catepillar/Player.controller index 4a2fa39..bc572a8 100644 --- a/Assets/Prefabs/Catepillar/Player.controller +++ b/Assets/Prefabs/Catepillar/Player.controller @@ -10,7 +10,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 4 m_ConditionEvent: vspeed - m_EventTreshold: 0 + m_EventTreshold: -0.2 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 705262314255223608} m_Solo: 0 @@ -70,7 +70,7 @@ AnimatorStateMachine: m_Position: {x: 290, y: 10, z: 0} - serializedVersion: 1 m_State: {fileID: 705262314255223608} - m_Position: {x: 570, y: -40, z: 0} + m_Position: {x: 50, y: -70, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: - {fileID: 2479910129929821769} @@ -93,7 +93,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 4 m_ConditionEvent: vspeed - m_EventTreshold: 0 + m_EventTreshold: -0.2 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 705262314255223608} m_Solo: 0 @@ -107,7 +107,7 @@ AnimatorStateTransition: m_HasFixedDuration: 0 m_InterruptionSource: 0 m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_CanTransitionToSelf: 0 --- !u!1102 &-4553251249938837047 AnimatorState: serializedVersion: 6 @@ -282,7 +282,7 @@ AnimatorStateTransition: m_HasFixedDuration: 0 m_InterruptionSource: 0 m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_CanTransitionToSelf: 0 --- !u!1101 &3950393567183418223 AnimatorStateTransition: m_ObjectHideFlags: 1 diff --git a/Assets/Prefabs/Catepillar/Player.prefab b/Assets/Prefabs/Catepillar/Player.prefab index 1c3633a..f05b63c 100644 --- a/Assets/Prefabs/Catepillar/Player.prefab +++ b/Assets/Prefabs/Catepillar/Player.prefab @@ -13,9 +13,10 @@ GameObject: - component: {fileID: 849756540516150458} - component: {fileID: 4169369283586250626} - component: {fileID: 3534034070345576868} + - component: {fileID: 4576448781989217082} m_Layer: 0 m_Name: Player - m_TagString: Untagged + m_TagString: Player m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -93,7 +94,7 @@ CapsuleCollider2D: m_CompositeOperation: 0 m_CompositeOrder: 0 m_Offset: {x: 0.23512886, y: 0.114549875} - m_Size: {x: 1, y: 0.65625} + m_Size: {x: 1, y: 0.75} m_Direction: 1 --- !u!50 &4169369283586250626 Rigidbody2D: @@ -134,9 +135,50 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 35cab81567d235b489aef6d0fa17c729, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::Player.Movement - runSpeed: 1 - springPower: 0 - spriteRenderer: {fileID: 0} + runSpeed: 4 + springPower: 12 + jumpForce: 5 + airJumpForce: 10 + spriteRenderer: {fileID: 342790821639359709} + turnDelay: 0.08 + interactReference: {fileID: 1781555164194001046, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3} + impactPauseTime: 0.2 + bouncePower: 5 + animator: {fileID: 2598533458249844269} + jumpSound: {fileID: 8300000, guid: 0734beac3512cee4783e5a66f9df87bb, type: 3} + pickupSound: {fileID: 8300000, guid: 4f190d6dc258d8f4b843f97dd0e5d2db, type: 3} + springSound: {fileID: 8300000, guid: 07e96691431e68849b974e73b4e1dc2c, type: 3} + bumpSound: {fileID: 8300000, guid: 7c28608e819f6574193756354a7974fe, type: 3} +--- !u!114 &4576448781989217082 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7621021177568661959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.PlayerInput + m_Actions: {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3} + m_NotificationBehavior: 3 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: [] + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_ControlsChangedEvent: + m_PersistentCalls: + m_Calls: [] + m_ActionEvents: [] + m_NeverAutoSwitchControlSchemes: 0 + m_DefaultControlScheme: + m_DefaultActionMap: Player + m_SplitScreenIndex: -1 + m_Camera: {fileID: 0} --- !u!1 &8270890549788907285 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Catepillar/Walk.anim b/Assets/Prefabs/Catepillar/Walk.anim index ffe81ed..d7ca364 100644 --- a/Assets/Prefabs/Catepillar/Walk.anim +++ b/Assets/Prefabs/Catepillar/Walk.anim @@ -21,11 +21,11 @@ AnimationClip: - serializedVersion: 2 curve: - time: 0 - value: {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} - - time: 0.083333336 value: {fileID: -835469789631162461, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} + - time: 0.083333336 + value: {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} attribute: m_Sprite - path: + path: Sprite classID: 212 script: {fileID: 0} flags: 2 @@ -37,7 +37,7 @@ AnimationClip: m_ClipBindingConstant: genericBindings: - serializedVersion: 2 - path: 0 + path: 850496168 attribute: 0 script: {fileID: 0} typeID: 212 @@ -46,8 +46,8 @@ AnimationClip: isIntCurve: 0 isSerializeReferenceCurve: 0 pptrCurveMapping: - - {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} - {fileID: -835469789631162461, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} + - {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3} m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} diff --git a/Assets/Scenes/Bootstrap.unity b/Assets/Scenes/Bootstrap.unity index 4bb67b4..06e504f 100644 --- a/Assets/Scenes/Bootstrap.unity +++ b/Assets/Scenes/Bootstrap.unity @@ -324,7 +324,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!114 &1671688484 MonoBehaviour: m_ObjectHideFlags: 0 @@ -361,7 +361,7 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1671688483} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 4b256c4001284134990a2af43c375455, type: 3} m_Name: diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 1be320e..7a930ef 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -705,7 +705,7 @@ Transform: m_GameObject: {fileID: 972659586} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -995,7 +995,7 @@ MonoBehaviour: m_RefResolutionX: 256 m_RefResolutionY: 154 m_CropFrame: 2 - m_GridSnapping: 1 + m_GridSnapping: 0 m_FilterMode: 0 m_UpscaleRT: 0 m_PixelSnapping: 0 @@ -1016,11 +1016,6 @@ MonoBehaviour: m_EditorClassIdentifier: Assembly-CSharp::Cam camSpeed: 20 yOffset: 1 ---- !u!212 &1111270482 stripped -SpriteRenderer: - m_CorrespondingSourceObject: {fileID: 342790821639359709, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - m_PrefabInstance: {fileID: 2062647807} - m_PrefabAsset: {fileID: 0} --- !u!1 &1552194188 GameObject: m_ObjectHideFlags: 0 @@ -1047,7 +1042,7 @@ Transform: m_GameObject: {fileID: 1552194188} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.73, y: -0.4, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -4981,7 +4976,7 @@ Transform: m_GameObject: {fileID: 1718672489} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -4.37, y: 12.95, z: 0} + m_LocalPosition: {x: -2.46, y: 10.74, z: 0} m_LocalScale: {x: 0.8, y: 0.8, z: 0.8} m_ConstrainProportionsScale: 0 m_Children: @@ -5150,41 +5145,6 @@ BoxCollider2D: m_AutoTiling: 0 m_Size: {x: 2, y: 0.5} m_EdgeRadius: 0 ---- !u!1 &1892581088 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 7621021177568661959, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - m_PrefabInstance: {fileID: 2062647807} - m_PrefabAsset: {fileID: 0} ---- !u!114 &1892581094 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1892581088} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} - m_Name: - m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.PlayerInput - m_Actions: {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3} - m_NotificationBehavior: 3 - m_UIInputModule: {fileID: 0} - m_DeviceLostEvent: - m_PersistentCalls: - m_Calls: [] - m_DeviceRegainedEvent: - m_PersistentCalls: - m_Calls: [] - m_ControlsChangedEvent: - m_PersistentCalls: - m_Calls: [] - m_ActionEvents: [] - m_NeverAutoSwitchControlSchemes: 0 - m_DefaultControlScheme: - m_DefaultActionMap: Player - m_SplitScreenIndex: -1 - m_Camera: {fileID: 1102711993} --- !u!1 &2032829252 GameObject: m_ObjectHideFlags: 0 @@ -5247,7 +5207,7 @@ Transform: m_GameObject: {fileID: 2032829252} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2.85, y: 10.4, z: 0} + m_LocalPosition: {x: 2.59, y: 8.82, z: 0} m_LocalScale: {x: 0.8, y: 0.8, z: 0.8} m_ConstrainProportionsScale: 0 m_Children: @@ -5262,38 +5222,14 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 849756540516150458, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: m_Size.y - value: 0.75 + - target: {fileID: 342790821639359709, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} + propertyPath: m_SortingOrder + value: 1 objectReference: {fileID: 0} - - target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: runSpeed - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: jumpForce - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: turnDelay - value: 0.08 - objectReference: {fileID: 0} - - target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: springPower - value: 12 - objectReference: {fileID: 0} - - target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: airJumpForce - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: spriteRenderer + - target: {fileID: 4576448781989217082, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} + propertyPath: m_Camera value: - objectReference: {fileID: 1111270482} - - target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: interactReference - value: - objectReference: {fileID: 1781555164194001046, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3} + objectReference: {fileID: 1102711993} - target: {fileID: 6196444245332325679, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} propertyPath: m_LocalPosition.x value: -6.31 @@ -5338,17 +5274,10 @@ PrefabInstance: propertyPath: m_Name value: Player objectReference: {fileID: 0} - - target: {fileID: 7621021177568661959, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - propertyPath: m_TagString - value: Player - objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: - - targetCorrespondingSourceObject: {fileID: 7621021177568661959, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} - insertIndex: -1 - addedObject: {fileID: 1892581094} + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3} --- !u!1660057539 &9223372036854775807 SceneRoots: diff --git a/Assets/Scripts/Management/SFX.cs b/Assets/Scripts/Management/SFX.cs index abd58cd..2acde0b 100644 --- a/Assets/Scripts/Management/SFX.cs +++ b/Assets/Scripts/Management/SFX.cs @@ -21,7 +21,7 @@ namespace Management private AudioSource _audioSource; // Playing clip registry. Used as data source to limit amount of times a clip will play simultaneously - private Dictionary _clipsInProgress; + private Dictionary _clipsInProgress = new Dictionary(); /// /// Plpays the given audio clip through the audio driver diff --git a/Assets/Scripts/Player/Movement.cs b/Assets/Scripts/Player/Movement.cs index 5ace56b..7354df4 100644 --- a/Assets/Scripts/Player/Movement.cs +++ b/Assets/Scripts/Player/Movement.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using Management; using UnityEngine; @@ -10,6 +11,9 @@ namespace Player public class Movement : MonoBehaviour { private static readonly int Spring = Animator.StringToHash("spring"); + private static readonly int Grounded = Animator.StringToHash("grounded"); + private static readonly int Speed = Animator.StringToHash("speed"); + private static readonly int Vspeed = Animator.StringToHash("vspeed"); [SerializeField] private float runSpeed; [SerializeField] private float springPower; [SerializeField] private float jumpForce; @@ -17,6 +21,15 @@ namespace Player [SerializeField] private SpriteRenderer spriteRenderer; [SerializeField] private float turnDelay; [SerializeField] private InputActionReference interactReference; + [SerializeField] private float impactPauseTime; + [SerializeField] private float bouncePower; + [SerializeField] private Animator animator; + + [Header("Audio")] + [SerializeField] private AudioClip jumpSound; + [SerializeField] private AudioClip pickupSound; + [SerializeField] private AudioClip springSound; + [SerializeField] private AudioClip bumpSound; private Animator _springAnimator; private Rigidbody2D _rb; @@ -66,6 +79,8 @@ namespace Player _groundedCheckTimer += Time.deltaTime; _turnDelayTimer += Time.deltaTime; + if (!_autoDrive && Mathf.Abs(_rb.linearVelocityX) > 0.1f) + _facingLeft = _rb.linearVelocity.x < 0; spriteRenderer.flipX = !_facingLeft; if (_springAnimator && _jumpPressedThisFrame) { @@ -87,7 +102,6 @@ namespace Player if (!_grounded && _airJumpCharges > 0 && _jumpPressedThisFrame) { - Debug.Log(_airJumpDir); _airJump = true; } @@ -98,6 +112,7 @@ namespace Player { if (_jump) { + Services.Instance.SFX.PlayOneShot(jumpSound); _jump = false; _grounded = false; _rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse); @@ -105,13 +120,17 @@ namespace Player if (_airJump) { + Services.Instance.SFX.PlayOneShot(jumpSound); + StartCoroutine(ImpactPause(impactPauseTime)); _airJump = false; _airJumpCharges--; + _rb.linearVelocity = Vector3.zero; _rb.AddForce(_airJumpDir * airJumpForce, ForceMode2D.Impulse); } if (_fireSpring) { + Services.Instance.SFX.PlayOneShot(springSound); _fireSpring = false; _rb.linearVelocityX = 0; _rb.AddForce(Vector2.up * springPower, ForceMode2D.Impulse); @@ -120,14 +139,26 @@ namespace Player { _rb.linearVelocityX = _facingLeft ? -runSpeed : runSpeed; } + + animator.SetBool(Grounded, _grounded); + animator.SetFloat(Speed, Mathf.Abs(_rb.linearVelocity.x)); + animator.SetFloat(Vspeed, _rb.linearVelocity.y); } + private IEnumerator ImpactPause(float pauseTime) + { + Time.timeScale = 0f; + yield return new WaitForSecondsRealtime(pauseTime); + Time.timeScale = 1f; + } + private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.layer == LayerMask.NameToLayer("Spring")) _springAnimator = other.gameObject.GetComponent(); if (other.gameObject.layer == LayerMask.NameToLayer("Pickup")) { + Services.Instance.SFX.PlayOneShot(pickupSound); _airJumpCharges++; Destroy(other.gameObject); } @@ -166,6 +197,9 @@ namespace Player { _facingLeft = !_facingLeft; _turnDelayTimer = 0f; + if (!_autoDrive) + _rb.AddForce(new Vector2(x, 0f) * bouncePower, ForceMode2D.Impulse); + Services.Instance.SFX.PlayOneShot(bumpSound); break; } }