﻿using UnityEngine;
using System.Collections;
using UnityEngine.Networking;

public class PlayerController : NetworkBehaviour {

	public float speed = 7f;
	public int maxField = 4;

	public void Update () {
		if (!isLocalPlayer) return;

		this.transform.position = new Vector3(transform.position.x, Mathf.Clamp(transform.position.y, -maxField, maxField));

		if (Input.GetKey(KeyCode.UpArrow)) {
			transform.Translate(new Vector3(0f, speed * Time.deltaTime));
		} else if(Input.GetKey(KeyCode.DownArrow)) {
			transform.Translate(new Vector3(0f, -speed * Time.deltaTime));
		}
	}

}