diff --git a/CMPT306_Fall2017/Assets/CMPT306_Fall2017.unity b/CMPT306_Fall2017/Assets/CMPT306_Fall2017.unity index 468924ab042128477ded200381eabb81bf4c26cd..f013a2d676a29c947d1b27eb3dc253ba89faef73 100644 --- a/CMPT306_Fall2017/Assets/CMPT306_Fall2017.unity +++ b/CMPT306_Fall2017/Assets/CMPT306_Fall2017.unity @@ -1097,3 +1097,148 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1917853899 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1917853901} + - component: {fileID: 1917853900} + m_Layer: 0 + m_Name: Teather_control + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1917853900 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1917853899} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b099c732d3d72f44a8848536ac0c087f, type: 3} + m_Name: + m_EditorClassIdentifier: + startingHealth: 0 +--- !u!4 &1917853901 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1917853899} + 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: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2091671636 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2091671639} + - component: {fileID: 2091671638} + - component: {fileID: 2091671637} + - component: {fileID: 2091671640} + m_Layer: 0 + m_Name: Fighty_temp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!50 &2091671637 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2091671636} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 1 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!212 &2091671638 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2091671636} + 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: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.16, y: 0.16} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 +--- !u!4 &2091671639 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2091671636} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2091671640 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2091671636} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6ed4ad17d1b888e4f8cc6e6ae542fb9a, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/CMPT306_Fall2017/Assets/Scripts/Teather_Child.cs b/CMPT306_Fall2017/Assets/Scripts/Teather_Child.cs new file mode 100644 index 0000000000000000000000000000000000000000..8774c3a63934c82390e9473377d2ddd252edc9e7 --- /dev/null +++ b/CMPT306_Fall2017/Assets/Scripts/Teather_Child.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Teather_Child : MonoBehaviour { + + public GameObject left; + public GameObject right; + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + transform.localScale = new Vector2(Vector2.Distance(left.transform.position, right.transform.position), transform.localScale.y); + } +} diff --git a/CMPT306_Fall2017/Assets/Scripts/Teather_Child.cs.meta b/CMPT306_Fall2017/Assets/Scripts/Teather_Child.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..627f946d1b0b102996aa1bf39a4b825235103a9d --- /dev/null +++ b/CMPT306_Fall2017/Assets/Scripts/Teather_Child.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3b99857f6300f524c86692000bc5b334 +timeCreated: 1506341901 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CMPT306_Fall2017/Assets/Scripts/Teather_Parent.cs b/CMPT306_Fall2017/Assets/Scripts/Teather_Parent.cs new file mode 100644 index 0000000000000000000000000000000000000000..a31b31f545b8854d1c88ea234245085afa90f92c --- /dev/null +++ b/CMPT306_Fall2017/Assets/Scripts/Teather_Parent.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Teather_Parent : MonoBehaviour { + + public int health { get; private set; } + public int startingHealth; + + // Use this for initialization + void Start () { + health = startingHealth; + } + + // Update is called once per frame + void Update () { + + } + + /// <summary> + /// handles recieved damage message and applies damage to the teather + /// </summary> + /// <param name="damage"> the amount of damage to apply </param> + void damage(int damage) + { + health -= damage; + } +} diff --git a/CMPT306_Fall2017/Assets/Scripts/Teather_Parent.cs.meta b/CMPT306_Fall2017/Assets/Scripts/Teather_Parent.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..326458682ffc54ea2ca2de384ea50f6d1039c770 --- /dev/null +++ b/CMPT306_Fall2017/Assets/Scripts/Teather_Parent.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b099c732d3d72f44a8848536ac0c087f +timeCreated: 1506340298 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CMPT306_Fall2017/Assets/Scripts/basicMovement.cs b/CMPT306_Fall2017/Assets/Scripts/basicMovement.cs new file mode 100644 index 0000000000000000000000000000000000000000..50c2f1a1c26ab80f467c7ddbe0a41946500995e8 --- /dev/null +++ b/CMPT306_Fall2017/Assets/Scripts/basicMovement.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class basicMovement : MonoBehaviour +{ + + // Use this for initialization + void Start() + { + + } + + // Update is called once per frame + void Update() + { + var x = Input.GetAxis("Horizontal") * Time.deltaTime * 15.0f; + var z = Input.GetAxis("Vertical") * Time.deltaTime * 15f; + + transform.Translate(x, z, 0); + Vector3 MouseWorldPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0)); + transform.LookAt(MouseWorldPosition); + transform.rotation = Quaternion.Euler(new Vector3(0, 0, transform.rotation.eulerAngles.z)); + } +} diff --git a/CMPT306_Fall2017/Assets/Scripts/basicMovement.cs.meta b/CMPT306_Fall2017/Assets/Scripts/basicMovement.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..4e4954ff7b7a2efa0ccb0cdd3c4dbde38fbabe4a --- /dev/null +++ b/CMPT306_Fall2017/Assets/Scripts/basicMovement.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6ed4ad17d1b888e4f8cc6e6ae542fb9a +timeCreated: 1506342939 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CMPT306_Fall2017/ProjectSettings/Physics2DSettings.asset b/CMPT306_Fall2017/ProjectSettings/Physics2DSettings.asset index e3b2d0b3a6fb20d0ffd2a5b793df4ad228f3d8fa..ad732b00725fa825916aa03eb88b2fc803fbb0a8 100644 --- a/CMPT306_Fall2017/ProjectSettings/Physics2DSettings.asset +++ b/CMPT306_Fall2017/ProjectSettings/Physics2DSettings.asset @@ -4,7 +4,7 @@ Physics2DSettings: m_ObjectHideFlags: 0 serializedVersion: 3 - m_Gravity: {x: 0, y: -9.81} + m_Gravity: {x: 0, y: 0} m_DefaultMaterial: {fileID: 0} m_VelocityIterations: 8 m_PositionIterations: 3