diff --git a/Assets/Scenes/Demos/KingAbilitesTest.unity b/Assets/Scenes/Demos/KingAbilitesTest.unity index 92ce348..08fc320 100644 --- a/Assets/Scenes/Demos/KingAbilitesTest.unity +++ b/Assets/Scenes/Demos/KingAbilitesTest.unity @@ -134,6 +134,7 @@ GameObject: - component: {fileID: 14049524} - component: {fileID: 14049523} - component: {fileID: 14049522} + - component: {fileID: 14049527} - component: {fileID: 14049525} - component: {fileID: 14049521} m_Layer: 0 @@ -143,8 +144,8 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!136 &14049521 -CapsuleCollider: +--- !u!65 &14049521 +BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} @@ -153,10 +154,9 @@ CapsuleCollider: m_Material: {fileID: 0} m_IsTrigger: 1 m_Enabled: 1 - m_Radius: 0.5000001 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} + serializedVersion: 2 + m_Size: {x: 1.2, y: 2.2, z: 1.2} + m_Center: {x: 0.000000059604645, y: 0.1, z: -0.00000008940697} --- !u!23 &14049522 MeshRenderer: m_ObjectHideFlags: 0 @@ -232,6 +232,20 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 204dc1e4ca638924caabaa45df29d9d1, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!136 &14049527 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 14049520} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &36280875 GameObject: m_ObjectHideFlags: 0 @@ -1281,7 +1295,7 @@ SphereCollider: m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Radius: 0.52 + m_Radius: 0.53 m_Center: {x: 0, y: 0, z: 0} --- !u!1 &781589953 GameObject: @@ -1378,6 +1392,71 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 781589953} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &955887404 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 3559681995605743320, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_Height + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3607330906377400225, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_TagString + value: Player + objectReference: {fileID: 0} + - target: {fileID: 5633209979457551608, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_Name + value: DebugPlayerPrefab + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalPosition.x + value: 2.839548 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalPosition.y + value: 0.15000153 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalPosition.z + value: 1.3515663 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6926740475113451123, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 362ca97b75c291a47ab81d628a81f440, type: 3} --- !u!1 &1007956072 GameObject: m_ObjectHideFlags: 0 @@ -6953,272 +7032,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1691817601} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1802338225 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1802338232} - - component: {fileID: 1802338231} - - component: {fileID: 1802338230} - - component: {fileID: 1802338229} - - component: {fileID: 1802338228} - - component: {fileID: 1802338227} - - component: {fileID: 1802338226} - - component: {fileID: 1802338233} - m_Layer: 0 - m_Name: Player - m_TagString: Player - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1802338226 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3} - m_Name: - m_EditorClassIdentifier: - maxVel: 25 - minVel: 2 - curVel: 0 - acc: 0.1 - jumpPow: 300 - jumpNum: 2 - traction: 3 - kickPow: 0 - recovTime: 0 - playerGrav: 20 - hasBlink: 0 - hasGlider: 0 - hasGrapple: 0 - hasWallrun: 0 - hasNitro: 0 - hasDash: 0 - playerPoints: 15 ---- !u!114 &1802338227 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 22ae0d31c49624d4fb9990f2f5f72fd9, type: 3} - m_Name: - m_EditorClassIdentifier: - pStats: {fileID: 0} - vel: {x: 0, y: 0, z: 0} - isGrounded: 0 - groundCheckDistance: 0.05 - minAngle: -30 - maxAngle: 45 - sensitivity: 486 ---- !u!143 &1802338228 -CharacterController: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Height: 2 - m_Radius: 0.5 - m_SlopeLimit: 45 - m_StepOffset: 0.3 - m_SkinWidth: 0.08 - m_MinMoveDistance: 0.001 - m_Center: {x: 0, y: 0, z: 0} ---- !u!136 &1802338229 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1802338230 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, 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: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1802338231 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1802338232 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1, y: 1.69, z: 1} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1926202700} - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!54 &1802338233 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1802338225} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_UseGravity: 1 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!1 &1926202699 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1926202700} - - component: {fileID: 1926202702} - - component: {fileID: 1926202701} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1926202700 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1926202699} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 1.6, z: -4} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1802338232} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!81 &1926202701 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1926202699} - m_Enabled: 1 ---- !u!20 &1926202702 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1926202699} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 --- !u!1 &1931305507 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Demos/KingImp.unity b/Assets/Scenes/Demos/KingImp.unity index f8208fa..bb542eb 100644 --- a/Assets/Scenes/Demos/KingImp.unity +++ b/Assets/Scenes/Demos/KingImp.unity @@ -1359,7 +1359,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: speed: 40 - rotSpeed: 100 --- !u!135 &1061226461 SphereCollider: m_ObjectHideFlags: 0 @@ -1429,14 +1428,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1061226459} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} m_LocalPosition: {x: -42, y: 30, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1735805362} m_Father: {fileID: 0} m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!1 &1179063825 GameObject: m_ObjectHideFlags: 0 @@ -1867,13 +1866,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1735805359} - m_LocalRotation: {x: 0.15304591, y: 0.6903456, z: -0.15304591, w: 0.6903456} + m_LocalRotation: {x: 0.2164396, y: 0, z: 0, w: 0.97629607} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1061226464} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 25, y: 90, z: 0} + m_LocalEulerAnglesHint: {x: 25, y: 0, z: 0} --- !u!1 &2130130028 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/KingScripts/KingAbilities/Boulder.cs b/Assets/Scripts/KingAbilities/Boulder.cs similarity index 85% rename from Assets/Scripts/KingScripts/KingAbilities/Boulder.cs rename to Assets/Scripts/KingAbilities/Boulder.cs index 861602e..0540903 100644 --- a/Assets/Scripts/KingScripts/KingAbilities/Boulder.cs +++ b/Assets/Scripts/KingAbilities/Boulder.cs @@ -12,11 +12,12 @@ public class Boulder : MonoBehaviour void OnTriggerEnter(Collider other) { if (other.tag == "Player") { + Debug.Log("Crunch"); GameObject player = other.gameObject;//Turns the collider into a game object Vector3 Dir = boulder.velocity;//Finds the bolder's velocity float Power = boulder.velocity.magnitude * 250;//Finds the power of the boulder by using it's velocity and a scaler Dir = Vector3.Normalize(Dir);//Normalizes the vector to be used as a knockback direction - player.GetComponent().AddImpact(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed + player.GetComponent().getHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed } } diff --git a/Assets/Scripts/KingScripts/KingAbilities/Boulder.cs.meta b/Assets/Scripts/KingAbilities/Boulder.cs.meta similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Boulder.cs.meta rename to Assets/Scripts/KingAbilities/Boulder.cs.meta diff --git a/Assets/Scripts/KingAbilities/Bumper.cs b/Assets/Scripts/KingAbilities/Bumper.cs new file mode 100644 index 0000000..b60c5e0 --- /dev/null +++ b/Assets/Scripts/KingAbilities/Bumper.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Bumper : MonoBehaviour { + + // Is called whenever something collides with the bumper + void OnTriggerEnter(Collider other) { + Debug.Log("Bump!"); + if (other.tag == "Player") {//Checks if the other object is the player + float DirBumpX = other.GetComponent().vel.x * -1;//Inverts the Player Velocity x + float DirBumpZ = other.GetComponent().vel.z * -1;//Inverts the Player Velocity y + Vector3 DirBump = new Vector3(DirBumpX, .01f, DirBumpZ);//Creates a direction to launch the player + DirBump = Vector3.Normalize(DirBump);//Normalizes the vector to be used as a bump direction + other.GetComponent().getHit(DirBump, 50); //Launches tthe player directly away from the bumper + } + } +} diff --git a/Assets/Scripts/KingScripts/KingAbilities/Bumper.cs.meta b/Assets/Scripts/KingAbilities/Bumper.cs.meta similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Bumper.cs.meta rename to Assets/Scripts/KingAbilities/Bumper.cs.meta diff --git a/Assets/Scripts/KingScripts/KingAbilities/Goo.cs b/Assets/Scripts/KingAbilities/Goo.cs similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Goo.cs rename to Assets/Scripts/KingAbilities/Goo.cs diff --git a/Assets/Scripts/KingScripts/KingAbilities/Goo.cs.meta b/Assets/Scripts/KingAbilities/Goo.cs.meta similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Goo.cs.meta rename to Assets/Scripts/KingAbilities/Goo.cs.meta diff --git a/Assets/Scripts/KingScripts/KingAbilities/Hail.cs b/Assets/Scripts/KingAbilities/Hail.cs similarity index 87% rename from Assets/Scripts/KingScripts/KingAbilities/Hail.cs rename to Assets/Scripts/KingAbilities/Hail.cs index debbacb..ff043b8 100644 --- a/Assets/Scripts/KingScripts/KingAbilities/Hail.cs +++ b/Assets/Scripts/KingAbilities/Hail.cs @@ -30,7 +30,7 @@ public class Hail : MonoBehaviour void OnTriggerEnter(Collider other) { if (other.tag == "Player") { GameObject player = other.gameObject;//Turns the collider into a game object - float Power = hail.velocity.magnitude * 100;//Finds the power of the hail by using it's velocity and a scaler + float Power = hail.velocity.magnitude * 10;//Finds the power of the hail by using it's velocity and a scaler //Find the dirrection of launch by finding the direction between the two points of the player and the Hail float px = player.transform.position.x; float pz = player.transform.position.z; @@ -38,7 +38,7 @@ public class Hail : MonoBehaviour float hz = hail.transform.position.z; //Direction pointing away from the center of the Hail Vector3 Dir = new Vector3(px - hx, 0, pz - hz); - player.GetComponent().AddImpact(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed + player.GetComponent().getHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed } } diff --git a/Assets/Scripts/KingScripts/KingAbilities/Hail.cs.meta b/Assets/Scripts/KingAbilities/Hail.cs.meta similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Hail.cs.meta rename to Assets/Scripts/KingAbilities/Hail.cs.meta diff --git a/Assets/Scripts/KingScripts/KingAbilities/HailArea.cs b/Assets/Scripts/KingAbilities/HailArea.cs similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/HailArea.cs rename to Assets/Scripts/KingAbilities/HailArea.cs diff --git a/Assets/Scripts/KingScripts/KingAbilities/HailArea.cs.meta b/Assets/Scripts/KingAbilities/HailArea.cs.meta similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/HailArea.cs.meta rename to Assets/Scripts/KingAbilities/HailArea.cs.meta diff --git a/Assets/Scripts/KingScripts/KingAbilities/Slime.cs b/Assets/Scripts/KingAbilities/Slime.cs similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Slime.cs rename to Assets/Scripts/KingAbilities/Slime.cs diff --git a/Assets/Scripts/KingScripts/KingAbilities/Slime.cs.meta b/Assets/Scripts/KingAbilities/Slime.cs.meta similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Slime.cs.meta rename to Assets/Scripts/KingAbilities/Slime.cs.meta diff --git a/Assets/Scripts/KingScripts/KingAbilities/Wind.cs b/Assets/Scripts/KingAbilities/Wind.cs similarity index 83% rename from Assets/Scripts/KingScripts/KingAbilities/Wind.cs rename to Assets/Scripts/KingAbilities/Wind.cs index 7ddc9ca..363cb94 100644 --- a/Assets/Scripts/KingScripts/KingAbilities/Wind.cs +++ b/Assets/Scripts/KingAbilities/Wind.cs @@ -14,6 +14,6 @@ public class Wind : MonoBehaviour // Update is called once per frame void OnTriggerStay(Collider other) { - other.GetComponent().AddImpact(DirWind, 1); + other.GetComponent().AddImpact(DirWind, 1); } } diff --git a/Assets/Scripts/KingScripts/KingAbilities/Wind.cs.meta b/Assets/Scripts/KingAbilities/Wind.cs.meta similarity index 100% rename from Assets/Scripts/KingScripts/KingAbilities/Wind.cs.meta rename to Assets/Scripts/KingAbilities/Wind.cs.meta diff --git a/Assets/Scripts/KingScripts/KingAbilities.meta b/Assets/Scripts/KingScripts/KingAbilities.meta deleted file mode 100644 index af519db..0000000 --- a/Assets/Scripts/KingScripts/KingAbilities.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 14595e0094b28384c8078f76053166e3 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/KingScripts/KingAbilities/Bumper.cs b/Assets/Scripts/KingScripts/KingAbilities/Bumper.cs deleted file mode 100644 index 75e145d..0000000 --- a/Assets/Scripts/KingScripts/KingAbilities/Bumper.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Bumper : MonoBehaviour { - - // Is called whenever something collides with the bumper - void OnTriggerEnter(Collider other) { - //Debug.Log("Bump!"); - GameObject player = other.gameObject;//Turns the collider into a game object - Vector3 DirBump = player.GetComponent().vel * -1;//Inverts the Player Velocity - DirBump = Vector3.Normalize(DirBump);//Normalizes the vector to be used as a bump direction - player.GetComponent().AddImpact(DirBump, 200); //Launches tthe player directly away from the bumper - } -} diff --git a/Assets/Scripts/KingScripts/KingMove.cs b/Assets/Scripts/KingScripts/KingMove.cs index 47277b2..2958da5 100644 --- a/Assets/Scripts/KingScripts/KingMove.cs +++ b/Assets/Scripts/KingScripts/KingMove.cs @@ -5,34 +5,43 @@ using UnityEngine; public class KingMove : MonoBehaviour { public float speed = 30.0f; - public float rotSpeed = 30.0f; private Vector3 newPos; + private Vector3 MountCent = new Vector3(0, 30, -80); + private bool RotStr = false; // Update is called once per frame void Update() { float translation = Input.GetAxis("HorizontalCam") * speed; - float rotation = Input.GetAxis("HorizontalCam") * rotSpeed; // Make it move 10 meters per second instead of 10 meters per frame... translation *= Time.deltaTime; - rotation *= Time.deltaTime; // Move translation along the object's z-axis if (transform.position.z <= 61 && transform.position.z >= -80) { - transform.Translate(0, 0, -translation);//Is negated to make the Left arrow go left and the right arraow go right - transform.rotation = Quaternion.Euler(0, 0, 0); + transform.Translate(translation, 0, 0);//Is negated to make the Left arrow go left and the right arraow go right + //transform.position = new Vector3(-42, 30, transform.position.z); + transform.rotation = Quaternion.Euler(0, 90, 0); + RotStr = false; } else if (transform.position.z > 61) { transform.position = new Vector3(-42, 30, 61);//Keeps them from going too far left } - else if (transform.position.z < -80) {//Once they rech a certain point they begin to cirlce around the mountain (radius of 42, x^2+z^2=42^2) - transform.Rotate(0, -rotation, 0);// Rotates the player as they move along the circumfurance - float z = transform.position.z - 0.5f; - float x = Mathf.Sqrt((42 * 42) - ((z + 80) * (z + 80)));//Add something based off translation to X and calculate the corespondent Z Z = sqrt(42^2-x^2)-80 - newPos = new Vector3(-x, 30, z); // make a Vector3 out of the new X and Z + else if (transform.position.z < -80) {//Once they rech a certain point they begin to cirlce around the mountain (radius of 42, x^2+(z+80)^2=42^2) + float x = transform.position.x; + x += translation; //Moves the player's X forward slightly + float z = -Mathf.Sqrt((42 * 42) - (x * x)) - 80; //Snaps the player onto a circle that is around the mountain, so the player orbits it smoothly + newPos = new Vector3(x, 30, z); //make a Vector3 out of the new X and Z transform.position = newPos;//Sets the player's new position on the cirlce + transform.LookAt(MountCent);//Rotates the player as they move along the circumfurance + /*if (RotStr == false) {//Rotates the player by 90 degrees once, to make LookAt work properly + transform.Rotate(0f, -90f, 0f); + RotStr = true; + }*/ + if (x < -42) {//Snaps the player back onto the horizontal track + transform.position = new Vector3(-42, 30, -80); + } } - else { + else {//If somehow the player disappears into the void, resets them Debug.Log("Aw, Beans"); transform.position = new Vector3(-42, 30, 0); } diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs index 7385db8..0579f37 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs @@ -386,7 +386,7 @@ public class dPlayerMovement : NetworkBehaviour } //Ragdoll Functions - private void getHit(Vector3 dir, float force){ + public void getHit(Vector3 dir, float force){ if(firstHit == false){ EnableRagdoll(); dir.Normalize(); diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs index 00d515a..e89c2c4 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs +++ b/Assets/Scripts/PlayerScripts/MovementAbilities/Nitro.cs @@ -18,19 +18,19 @@ public class Nitro : MonoBehaviour driver = FindObjectOfType(); } - // Update is called once per frame - void Update(){ - //once cooldowns are implemented, put this on one (a long one) - if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false){ - playerStats.CurVel = playerStats.MaxVel; - StartCoroutine(startCoolDown()); - } - } - private IEnumerator startCoolDown(){ - Debug.Log("start corotine"); - isOnCoolDown = true; - driver.startUICooldown("Nitro"); - yield return new WaitForSeconds(coolDown); - isOnCoolDown = false; - } + //// Update is called once per frame + //void Update(){ + // //once cooldowns are implemented, put this on one (a long one) + // if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false){ + // playerStats.CurVel = playerStats.MaxVel; + // StartCoroutine(startCoolDown()); + // } + //} + //private IEnumerator startCoolDown(){ + // Debug.Log("start corotine"); + // isOnCoolDown = true; + // driver.startUICooldown("Nitro"); + // yield return new WaitForSeconds(coolDown); + // isOnCoolDown = false; + //} } diff --git a/Assets/Scripts/PlayerScripts/PlayerMovement.cs b/Assets/Scripts/PlayerScripts/PlayerMovement.cs index 10a3fa5..80163da 100644 --- a/Assets/Scripts/PlayerScripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/PlayerMovement.cs @@ -370,7 +370,7 @@ public class PlayerMovement : NetworkBehaviour } //Ragdoll Functions - private void getHit(Vector3 dir, float force){ + public void getHit(Vector3 dir, float force){ if(firstHit == false){ EnableRagdoll(); dir.Normalize(); diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 8f49ba9..79da7b1 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -6,35 +6,35 @@ EditorUserSettings: serializedVersion: 4 m_ConfigSettings: RecentlyUsedScenePath-0: - value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6cb353d3e204cfa320d2a18 - flags: 0 - RecentlyUsedScenePath-1: value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3b36327717e1351027 flags: 0 - RecentlyUsedScenePath-2: + RecentlyUsedScenePath-1: value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3f31297717e1351027 flags: 0 - RecentlyUsedScenePath-3: + RecentlyUsedScenePath-2: value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb flags: 0 + RecentlyUsedScenePath-3: + value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25 + flags: 0 RecentlyUsedScenePath-4: - value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25 - flags: 0 - RecentlyUsedScenePath-5: value: 224247031146467c0c03096f3d2c4a1e02161124623d28393930 flags: 0 - RecentlyUsedScenePath-6: + RecentlyUsedScenePath-5: value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25 flags: 0 - RecentlyUsedScenePath-7: + RecentlyUsedScenePath-6: value: 22424703114646680e0b0227036c7b151b180b650d262f3d192c0e27d1e33136e7a923e7ee2e26 flags: 0 - RecentlyUsedScenePath-8: + RecentlyUsedScenePath-7: value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb flags: 0 - RecentlyUsedScenePath-9: + RecentlyUsedScenePath-8: value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb flags: 0 + RecentlyUsedScenePath-9: + value: 22424703114646680e0b0227036c7b151b180b650721283704240d7df7ee3d2cfb + flags: 0 UnityRemoteCompression: value: 337f73 flags: 0