diff --git a/Game 1/Assets/Animations/Explosion.anim b/Game 1/Assets/Animations/Explosion.anim index 4727544..e220575 100644 --- a/Game 1/Assets/Animations/Explosion.anim +++ b/Game 1/Assets/Animations/Explosion.anim @@ -20,27 +20,27 @@ AnimationClip: - curve: - time: 0 value: {fileID: 21300000, guid: 881bd5958f68ce247b9a4f5efecbb941, type: 3} - - time: 0.1 + - time: 0.083333336 value: {fileID: 21300000, guid: d3a8897c2d6f8ce448f3ad959a265f74, type: 3} - - time: 0.2 + - time: 0.16666667 value: {fileID: 21300000, guid: a3ab2886f68aaeb45b9389f4cfac0552, type: 3} - - time: 0.3 + - time: 0.25 value: {fileID: 21300000, guid: 216dcb0bcaca0ca41a80571977743aa4, type: 3} - - time: 0.4 + - time: 0.33333334 value: {fileID: 21300000, guid: c447e916fd09fa64a9434fd8eb266c1f, type: 3} - - time: 0.5 + - time: 0.41666666 value: {fileID: 21300000, guid: 84c5fa4b9faddba478c05f6efa1caa97, type: 3} - - time: 0.6 + - time: 0.5 value: {fileID: 21300000, guid: 44c161753e16f9c42b4b66366d3bc056, type: 3} - - time: 0.7 + - time: 0.5833333 value: {fileID: 21300000, guid: cf25e726d7293e5408e59948fdf21884, type: 3} - - time: 0.8 + - time: 0.6666667 value: {fileID: 21300000, guid: 9583288c1726a0446b0e9d3f30047cbc, type: 3} attribute: m_Sprite path: classID: 212 script: {fileID: 0} - m_SampleRate: 10 + m_SampleRate: 12 m_WrapMode: 0 m_Bounds: m_Center: {x: 0, y: 0, z: 0} @@ -69,12 +69,12 @@ AnimationClip: m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 - m_StopTime: 0.90000004 + m_StopTime: 0.75 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 @@ -89,4 +89,11 @@ AnimationClip: m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 m_GenerateMotionCurves: 0 - m_Events: [] + m_Events: + - time: 0.5833333 + functionName: DeleteOnComplete + data: + objectReferenceParameter: {fileID: 0} + floatParameter: 0 + intParameter: 0 + messageOptions: 0 diff --git a/Game 1/Assets/Animations/Explosion.anim.meta b/Game 1/Assets/Animations/Explosion.anim.meta index a79ecb3..cfdac5b 100644 --- a/Game 1/Assets/Animations/Explosion.anim.meta +++ b/Game 1/Assets/Animations/Explosion.anim.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: d33da4890b8c06245acb5521780c04e7 -timeCreated: 1504560403 +timeCreated: 1504642671 licenseType: Free NativeFormatImporter: mainObjectFileID: 7400000 diff --git a/Game 1/Assets/Animations/Explosion.controller b/Game 1/Assets/Animations/Explosion.controller index 33834e6..dcca635 100644 --- a/Game 1/Assets/Animations/Explosion.controller +++ b/Game 1/Assets/Animations/Explosion.controller @@ -11,7 +11,7 @@ AnimatorController: m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer - m_StateMachine: {fileID: 1107124966039000128} + m_StateMachine: {fileID: 1107450737580238592} m_Mask: {fileID: 0} m_Motions: [] m_Behaviours: [] @@ -21,7 +21,7 @@ AnimatorController: m_IKPass: 0 m_SyncedLayerAffectsTiming: 0 m_Controller: {fileID: 9100000} ---- !u!1102 &1102155469024640798 +--- !u!1102 &1102044952823616290 AnimatorState: serializedVersion: 5 m_ObjectHideFlags: 1 @@ -44,7 +44,7 @@ AnimatorState: m_SpeedParameter: m_MirrorParameter: m_CycleOffsetParameter: ---- !u!1107 &1107124966039000128 +--- !u!1107 &1107450737580238592 AnimatorStateMachine: serializedVersion: 5 m_ObjectHideFlags: 1 @@ -53,8 +53,8 @@ AnimatorStateMachine: m_Name: Base Layer m_ChildStates: - serializedVersion: 1 - m_State: {fileID: 1102155469024640798} - m_Position: {x: 200, y: 0, z: 0} + m_State: {fileID: 1102044952823616290} + m_Position: {x: 300, y: 108, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -64,4 +64,4 @@ AnimatorStateMachine: m_EntryPosition: {x: 50, y: 120, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} - m_DefaultState: {fileID: 1102155469024640798} + m_DefaultState: {fileID: 1102044952823616290} diff --git a/Game 1/Assets/Animations/Explosion.controller.meta b/Game 1/Assets/Animations/Explosion.controller.meta index c89962a..2da98d5 100644 --- a/Game 1/Assets/Animations/Explosion.controller.meta +++ b/Game 1/Assets/Animations/Explosion.controller.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 546e5e4795abb4a4c8fe0394df79437d -timeCreated: 1504560404 +guid: 199880b47555b8643a17c2000501e0ea +timeCreated: 1504642671 licenseType: Free NativeFormatImporter: mainObjectFileID: 9100000 diff --git a/Game 1/Assets/Prefabs/Explosion.prefab b/Game 1/Assets/Prefabs/Explosion.prefab index e46e7cf..df39554 100644 --- a/Game 1/Assets/Prefabs/Explosion.prefab +++ b/Game 1/Assets/Prefabs/Explosion.prefab @@ -9,18 +9,20 @@ Prefab: m_Modifications: [] m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1584202889639542} + m_RootGameObject: {fileID: 1183751695519662} m_IsPrefabParent: 1 ---- !u!1 &1584202889639542 +--- !u!1 &1183751695519662 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4294117729170242} - - component: {fileID: 212637867282857650} - - component: {fileID: 95900756836741872} + - component: {fileID: 4224959689937078} + - component: {fileID: 212754038393971786} + - component: {fileID: 95598204179832612} + - component: {fileID: 114562294083830174} + - component: {fileID: 114448192127375214} m_Layer: 0 m_Name: Explosion m_TagString: Untagged @@ -28,29 +30,29 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4294117729170242 +--- !u!4 &4224959689937078 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1584202889639542} + m_GameObject: {fileID: 1183751695519662} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1, y: -2, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 4.18, y: -1.481241, z: 0} + m_LocalScale: {x: 2, y: 2, z: 2} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!95 &95900756836741872 +--- !u!95 &95598204179832612 Animator: serializedVersion: 3 m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1584202889639542} + m_GameObject: {fileID: 1183751695519662} m_Enabled: 1 m_Avatar: {fileID: 0} - m_Controller: {fileID: 9100000, guid: 546e5e4795abb4a4c8fe0394df79437d, type: 2} + m_Controller: {fileID: 9100000, guid: 199880b47555b8643a17c2000501e0ea, type: 2} m_CullingMode: 0 m_UpdateMode: 0 m_ApplyRootMotion: 0 @@ -58,12 +60,35 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 ---- !u!212 &212637867282857650 +--- !u!114 &114448192127375214 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1183751695519662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62c625961f56be543920756f3b84d197, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114562294083830174 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1183751695519662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 93cb9d08b2b4f164d95fa992385774e9, type: 3} + m_Name: + m_EditorClassIdentifier: + player: {fileID: 0} +--- !u!212 &212754038393971786 SpriteRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1584202889639542} + m_GameObject: {fileID: 1183751695519662} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -89,7 +114,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 10 m_Sprite: {fileID: 21300000, guid: 881bd5958f68ce247b9a4f5efecbb941, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 diff --git a/Game 1/Assets/Prefabs/Explosion.prefab.meta b/Game 1/Assets/Prefabs/Explosion.prefab.meta index a98ff15..dcffed6 100644 --- a/Game 1/Assets/Prefabs/Explosion.prefab.meta +++ b/Game 1/Assets/Prefabs/Explosion.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: a1abe71ed18e0fb48af6d7851ad2146e -timeCreated: 1504560651 +guid: 5fb9f5ec9fd5a3e408f63285d4eddf7d +timeCreated: 1504652977 licenseType: Free NativeFormatImporter: mainObjectFileID: 100100000 diff --git a/Game 1/Assets/Prefabs/Rocket.prefab b/Game 1/Assets/Prefabs/Rocket.prefab new file mode 100644 index 0000000..9a22cf8 --- /dev/null +++ b/Game 1/Assets/Prefabs/Rocket.prefab @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1704205186022040} + m_IsPrefabParent: 1 +--- !u!1 &1704205186022040 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4430175170869306} + - component: {fileID: 212087158994003038} + - component: {fileID: 50380909930719022} + - component: {fileID: 114447255421982072} + - component: {fileID: 61260587973320418} + m_Layer: 0 + m_Name: Rocket + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4430175170869306 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1704205186022040} + 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: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!50 &50380909930719022 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1704205186022040} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 0 + m_Material: {fileID: 0} + m_Interpolate: 1 + m_SleepingMode: 1 + m_CollisionDetection: 1 + m_Constraints: 0 +--- !u!61 &61260587973320418 +BoxCollider2D: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1704205186022040} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.6, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1.5625, y: 0.390625} + newSize: {x: 1.5625, y: 0.390625} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.21, y: 0.21} + m_EdgeRadius: 0 +--- !u!114 &114447255421982072 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1704205186022040} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 38c418fc426cea441a9f41f0771ec5c8, type: 3} + m_Name: + m_EditorClassIdentifier: + player: {fileID: 0} + explosionPrefab: {fileID: 1183751695519662, guid: 5fb9f5ec9fd5a3e408f63285d4eddf7d, + type: 2} +--- !u!212 &212087158994003038 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1704205186022040} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + 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_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + 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: 21300000, guid: f23de763eab733a4c84fe2ee17c95f32, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1.5625, y: 0.390625} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 diff --git a/Game 1/Assets/Prefabs/Rocket.prefab.meta b/Game 1/Assets/Prefabs/Rocket.prefab.meta new file mode 100644 index 0000000..4a08112 --- /dev/null +++ b/Game 1/Assets/Prefabs/Rocket.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 34e7aebb9fac79643b1a3450a3891e90 +timeCreated: 1504654990 +licenseType: Free +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Game 1/Assets/Prefabs/Saw.prefab b/Game 1/Assets/Prefabs/Saw.prefab new file mode 100644 index 0000000..79ee0ef --- /dev/null +++ b/Game 1/Assets/Prefabs/Saw.prefab @@ -0,0 +1,99 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1052280587920524} + m_IsPrefabParent: 1 +--- !u!1 &1052280587920524 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118735178573924} + - component: {fileID: 212779659227184502} + - component: {fileID: 58295540487747480} + m_Layer: 0 + m_Name: Saw + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118735178573924 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1052280587920524} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -24.392323, y: -21.679274, z: 0} + 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!58 &58295540487747480 +CircleCollider2D: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1052280587920524} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Radius: 0.7050781 +--- !u!212 &212779659227184502 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1052280587920524} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + 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_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + 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: 21300000, guid: 4548b5a94a73ffc4a9d8a96b4c46bee4, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1.3945312, y: 1.4101562} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 diff --git a/Game 1/Assets/Prefabs/Saw.prefab.meta b/Game 1/Assets/Prefabs/Saw.prefab.meta new file mode 100644 index 0000000..744c3dd --- /dev/null +++ b/Game 1/Assets/Prefabs/Saw.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bf4119e4aa28f2d4aa04722cb5c2deb2 +timeCreated: 1504644467 +licenseType: Free +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Game 1/Assets/Scripts/AnimationEventFunctions.meta b/Game 1/Assets/Scripts/AnimationEventFunctions.meta new file mode 100644 index 0000000..f167a9a --- /dev/null +++ b/Game 1/Assets/Scripts/AnimationEventFunctions.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6972a0bb549a27a4a9b11f69d15a5119 +folderAsset: yes +timeCreated: 1504644409 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Game 1/Assets/Scripts/AnimationEventFunctions/AnimEventFunctions.cs b/Game 1/Assets/Scripts/AnimationEventFunctions/AnimEventFunctions.cs new file mode 100644 index 0000000..20317e1 --- /dev/null +++ b/Game 1/Assets/Scripts/AnimationEventFunctions/AnimEventFunctions.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class AnimEventFunctions : MonoBehaviour { + + public void DeleteOnComplete() + { + Destroy(gameObject); + } +} diff --git a/Game 1/Assets/Scripts/AnimationEventFunctions/AnimEventFunctions.cs.meta b/Game 1/Assets/Scripts/AnimationEventFunctions/AnimEventFunctions.cs.meta new file mode 100644 index 0000000..a6d09fd --- /dev/null +++ b/Game 1/Assets/Scripts/AnimationEventFunctions/AnimEventFunctions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 62c625961f56be543920756f3b84d197 +timeCreated: 1504644420 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Game 1/Assets/Scripts/CameraController.cs b/Game 1/Assets/Scripts/CameraController.cs new file mode 100644 index 0000000..233a372 --- /dev/null +++ b/Game 1/Assets/Scripts/CameraController.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CameraController : MonoBehaviour { + + public GameObject player; + + private Vector3 offset; + private Vector3 newPosition; + + private float minX, maxX, minY, maxY; + + void Start () { + offset = transform.position - player.transform.position; + + minX = 0.0f; + maxX = 0.0f; + minY = 0.0f; + maxY = 18.0f; + } + + void LateUpdate () { + newPosition = player.transform.position + offset; + + if(newPosition.x >= minX && newPosition.x <= maxX && newPosition.y >= minY && newPosition.y <= maxY) + transform.position = newPosition; + + } +} diff --git a/Game 1/Assets/Scripts/CameraController.cs.meta b/Game 1/Assets/Scripts/CameraController.cs.meta new file mode 100644 index 0000000..32ab67f --- /dev/null +++ b/Game 1/Assets/Scripts/CameraController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 82066df26cc71bd46bc0762b0aba7372 +timeCreated: 1504643500 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Game 1/Assets/Scripts/Explosion.cs b/Game 1/Assets/Scripts/Explosion.cs new file mode 100644 index 0000000..5cacdf8 --- /dev/null +++ b/Game 1/Assets/Scripts/Explosion.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Explosion : MonoBehaviour { + + public PlayerController player; + private float MAX_PLAYER_DIST = 3.0f; + + void Start () { + Vector3 playerPos = player.transform.position; + float dist = (playerPos - transform.position).magnitude; + if (dist < MAX_PLAYER_DIST) + { + Rigidbody2D playerBody = player.GetComponent(); + Vector2 force = (playerPos - transform.position).normalized * (MAX_PLAYER_DIST - dist) * 15.0f; + playerBody.AddForce(force, ForceMode2D.Impulse); + } + } +} diff --git a/Game 1/Assets/Scripts/Explosion.cs.meta b/Game 1/Assets/Scripts/Explosion.cs.meta new file mode 100644 index 0000000..655dfaf --- /dev/null +++ b/Game 1/Assets/Scripts/Explosion.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 93cb9d08b2b4f164d95fa992385774e9 +timeCreated: 1504641875 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Game 1/Assets/Scripts/PlayerController.cs b/Game 1/Assets/Scripts/PlayerController.cs index 54e2dbd..24327be 100644 --- a/Game 1/Assets/Scripts/PlayerController.cs +++ b/Game 1/Assets/Scripts/PlayerController.cs @@ -1,18 +1,21 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEngine.UI; // Simple script for a test I need to do public class PlayerController : MonoBehaviour { public float jumpPower; - public AnimationClip explosion; - private AnimationClip explode; + public GameObject rocketPrefab; + + public Text winText; // Use this for initialization void Start () { - explode = (AnimationClip)Instantiate(explosion, Camera.main.ScreenToWorldPoint(Input.mousePosition), Quaternion.identity); + } // Update is called once per frame @@ -25,9 +28,22 @@ public class PlayerController : MonoBehaviour { if (Input.GetMouseButtonDown(0)) { - explode.Play(); - Debug.Log("Explosion at: " + Input.mousePosition); + Vector2 rocketPos = transform.position; + GameObject rocket = Instantiate(rocketPrefab, rocketPos, Quaternion.identity); + rocket.GetComponent().player = this; + } + } + + void OnTriggerEnter2D(Collider2D other) + { + //Check the provided Collider2D parameter other to see if it is tagged "PickUp", if it is... + if (other.gameObject.CompareTag ("Finish Line")) { + winText.text = "You Win!"; + } + + // Deathbox and saws restart level + if (other.gameObject.CompareTag ("Deathbox")) { + SceneManager.LoadScene(SceneManager.GetActiveScene().name); } - } } diff --git a/Game 1/Assets/Scripts/RocketController.cs b/Game 1/Assets/Scripts/RocketController.cs new file mode 100644 index 0000000..b5c9b29 --- /dev/null +++ b/Game 1/Assets/Scripts/RocketController.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RocketController : MonoBehaviour { + + public PlayerController player; + public GameObject explosionPrefab; + private float ROCKET_SPEED = 20.0f; + + private void Start() + { + Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); + Vector2 playerPos = player.transform.position; + Vector2 rocketDir = (mousePos - playerPos).normalized; + float angle = Mathf.Atan2(rocketDir.y, rocketDir.x) * Mathf.Rad2Deg; + Quaternion rotation = Quaternion.AngleAxis(angle, Vector3.forward); + transform.rotation = rotation; + Rigidbody2D rocketBody = GetComponent(); + Vector2 force = rocketDir * ROCKET_SPEED; + rocketBody.AddForce(force, ForceMode2D.Impulse); + } + + void OnCollisionEnter2D(Collision2D collision) + { + if (collision.gameObject.layer == LayerMask.NameToLayer("Player")) + { + Debug.Log("Player Collision Detected"); + return; + } + + Vector3 explosionPos = transform.position; + explosionPos.z = 0; + GameObject explosion = Instantiate(explosionPrefab, explosionPos, Quaternion.identity); + explosion.GetComponent().player = player; + Destroy(gameObject); + } +} diff --git a/Game 1/Assets/Scripts/RocketController.cs.meta b/Game 1/Assets/Scripts/RocketController.cs.meta new file mode 100644 index 0000000..7d2215f --- /dev/null +++ b/Game 1/Assets/Scripts/RocketController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 38c418fc426cea441a9f41f0771ec5c8 +timeCreated: 1504654288 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Game 1/ProjectSettings/ProjectVersion.txt b/Game 1/ProjectSettings/ProjectVersion.txt index a211ccd..97bb79d 100644 --- a/Game 1/ProjectSettings/ProjectVersion.txt +++ b/Game 1/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.1.1f1 +m_EditorVersion: 2017.1.1f1 \ No newline at end of file diff --git a/Game 1/ProjectSettings/TagManager.asset b/Game 1/ProjectSettings/TagManager.asset index 1c92a78..0f4d140 100644 --- a/Game 1/ProjectSettings/TagManager.asset +++ b/Game 1/ProjectSettings/TagManager.asset @@ -3,7 +3,8 @@ --- !u!78 &1 TagManager: serializedVersion: 2 - tags: [] + tags: + - Finish Line layers: - Default - TransparentFX @@ -13,7 +14,7 @@ TagManager: - UI - - - - + - Player - - -