using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class keepInbounds : MonoBehaviour {
    private float GC_WIDTH = 28.4f;
    private float GC_HEIGHT = 16.0f;
    // Use this for initialization
    void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        if(transform.position.x < -1*GC_WIDTH)
        {
            transform.position = new Vector3(GC_WIDTH, transform.position.y, transform.position.z);
        }
        else if (transform.position.x > GC_WIDTH)
        {
            transform.position = new Vector3(-1*GC_WIDTH, transform.position.y, transform.position.z);
        }
        if (transform.position.y < -1 * GC_HEIGHT)
        {
            transform.position = new Vector3(transform.position.x, GC_HEIGHT-1.5f, transform.position.z);
        }
        else if (transform.position.y > GC_HEIGHT-1.5)
        {
            transform.position = new Vector3(transform.position.x, -1 * GC_HEIGHT, transform.position.z);
        }
    }
}
