Skip to content
Snippets Groups Projects
Commit 093f599c authored by clg544's avatar clg544
Browse files

Added comments to new code.

parent 0bb01957
No related branches found
No related tags found
2 merge requests!8Develop,!3Feature physics
......@@ -36,10 +36,13 @@ public class PlayerCameraScript : MonoBehaviour
}
/**
* Does a smooth movement towards the set target, based on speed variables.
*/
private void CameraTracking()
{
/* Adjust the Camera value to the right Z-plane */
Vector3 target = myTarget.transform.position;
Vector3 target = myTarget.transform.position;
target.z = myCamera.transform.position.z;
/* Camera speeds up as player leaves centre */
......
......@@ -3,12 +3,13 @@ using System.Collections;
public class PlayerCameraTargetScript : MonoBehaviour
{
/* Player target movement variables */
[SerializeField]
float ACCEL;
float MAX_SPEED;
Vector3 accel_scale;
/* Maximum target movement speeds, independant for screen ratios */
[SerializeField]
float MAX_X;
[SerializeField]
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerParentScript : MonoBehaviour {
[SerializeField]
......@@ -14,13 +14,14 @@ public class PlayerParentScript : MonoBehaviour {
Transform playerTwoTransform;
// Use this for initialization
void Start () {
playerOneTransform = PlayerOne.GetComponent<Transform>();
void Start () {
playerOneTransform = PlayerOne.GetComponent<Transform>();
playerTwoTransform = PlayerTwo.GetComponent<Transform>();
}
// Update is called once per frame
}
// Update is called once per frame
void Update () {
this.transform.position = (playerOneTransform.position + playerTwoTransform.position) / 2;
}
}
/* Move to Players centre */
this.transform.position = (playerOneTransform.position + playerTwoTransform.position) / 2;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment