using UnityEngine;
using System.Collections;

public class MoveMaze : MonoBehaviour {
	public float velocidad;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {

		if (PlayerPrefs.GetInt ("pauselvl2") != 1) {

			if(Input.GetKey(KeyCode.A)){
				this.transform.Rotate(new Vector3(0,0,-13* Time.deltaTime));
			}
			if(Input.GetKey(KeyCode.D)){
				this.transform.Rotate(new Vector3(0,0,13* Time.deltaTime));
			}
			if(Input.GetKey(KeyCode.W)){
				this.transform.Rotate(new Vector3(-13* Time.deltaTime,0,0));
			}
			if(Input.GetKey(KeyCode.S)){
				this.transform.Rotate(new Vector3(13* Time.deltaTime,0,0));
			}
			#if UNITY_ANDROID


			Debug.Log(Input.acceleration.x+" "+Input.acceleration.y+" "+Input.acceleration.z);
			if(Input.acceleration.x>0.2){
				this.transform.Rotate(new Vector3(0,0,velocidad*Time.deltaTime));
			}
			if(Input.acceleration.x<-0.2){
				this.transform.Rotate(new Vector3(0,0,-velocidad*Time.deltaTime));
			}
			if(Input.acceleration.y>0.2){
				this.transform.Rotate(new Vector3(-velocidad*Time.deltaTime,0,0));
			}
			if(Input.acceleration.y<-0.2){
				this.transform.Rotate(new Vector3(velocidad*Time.deltaTime,0,0));
			}

//			this.transform.Rotate(new Vector3(0,0,Input.acceleration.z*Time.deltaTime));
			//this.transform.Rotate(new Vector3(-Input.acceleration.y*Time.deltaTime*10,0,0));

			#endif
		}
	}
}
