using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;
public class main : MonoBehaviour{

  public float range,ihorizm,ivertm;
  public Text textOutput0,textOutput1,textOutput2,textOutput3;
  public Text textOutputB1,textOutputB2;
  public int hgarbage1,vgarbage1,ubaxis,counter,counter2;
  public int keybd,keybd0,keybd1,keybd2,keybd3;
  public float xpos,ypos,xyspeed,xoff,yoff;
  public float xpos0,ypos0,xyspeed0,xoff0,yoff0;
  public float xpos1,ypos1,xyspeed1,xoff1,yoff1;
  public float xpos2,ypos2,xyspeed2,xoff2,yoff2;
  public float xpos3,ypos3,xyspeed3,xoff3,yoff3;
  public GameObject sprite0,sprite1,sprite2,sprite3;

  void Start(){
    counter=0;xyspeed=.1f;
    xpos=450;ypos=250;xoff=-360;yoff=-225;
    xpos0=0;ypos0=3;xoff0=0;yoff0=0;
    xpos1=3;ypos1=0;xoff1=0;yoff1=0;
    xpos2=0;ypos2=-3;xoff2=0;yoff2=0;
    xpos3=-3;ypos3=0;xoff3=0;yoff3=0;
    }

  void Update (){

    float ihoriz=Input.GetAxis("Horizontal");
    float ivert=Input.GetAxis("Vertical");
    hgarbage1=0;ubaxis=0;

    if (xpos<-0){xpos=0;}
    if (xpos>720){xpos=720;}
    if (ypos<0){ypos=0;}
    if (ypos>450){ypos=450;}

    keybd0=0;
    if (Input.GetKey(KeyCode.UpArrow)){keybd0+=4;ypos0-=xyspeed;}
    if (Input.GetKey(KeyCode.DownArrow)){keybd0+=8;ypos0+=xyspeed;}
    if (Input.GetKey(KeyCode.LeftArrow)){keybd0+=1;xpos0-=xyspeed;}
    if (Input.GetKey(KeyCode.RightArrow)){keybd0+=2;xpos0+=xyspeed;}

    keybd1=0;
    if (Input.GetKey(KeyCode.W)){keybd1+=4;ypos1-=xyspeed;}
    if (Input.GetKey(KeyCode.S)){keybd1+=8;ypos1+=xyspeed;}
    if (Input.GetKey(KeyCode.A)){keybd1+=1;xpos1-=xyspeed;}
    if (Input.GetKey(KeyCode.D)){keybd1+=2;xpos1+=xyspeed;}

    keybd2=0;
    if (Input.GetKey(KeyCode.T)){keybd2+=4;ypos2-=xyspeed;}
    if (Input.GetKey(KeyCode.G)){keybd2+=8;ypos2+=xyspeed;}
    if (Input.GetKey(KeyCode.F)){keybd2+=1;xpos2-=xyspeed;}
    if (Input.GetKey(KeyCode.H)){keybd2+=2;xpos2+=xyspeed;}

    keybd3=0;
    if (Input.GetKey(KeyCode.I)){keybd3+=4;ypos3-=xyspeed;}
    if (Input.GetKey(KeyCode.K)){keybd3+=8;ypos3+=xyspeed;}
    if (Input.GetKey(KeyCode.J)){keybd3+=1;xpos3-=xyspeed;}
    if (Input.GetKey(KeyCode.L)){keybd3+=2;xpos3+=xyspeed;}


    counter2=(counter/50)%1000;

/*
    float xPos=ihoriz*range;float yPos=ivert*range;
    transform.position=new Vector3(xPos,yPos,0);
*/

/*
    textOutput0.text=xpos0.ToString("F0")+","+ypos0.ToString("F0")+","+keybd0.ToString("F0");
    textOutput1.text=xpos1.ToString("F0")+","+ypos1.ToString("F0")+","+keybd1.ToString("F0");
    textOutput2.text=xpos2.ToString("F0")+","+ypos2.ToString("F0")+","+keybd2.ToString("F0");
    textOutput3.text=xpos3.ToString("F0")+","+ypos3.ToString("F0")+","+keybd3.ToString("F0");


    //textOutput1.text="GetAxis: "+ubaxis.ToString("F0");
    //textOutput2.text="GetKey: "+keybd.ToString("F0");
    //textOutput3.text=xpos.ToString("F0")+","+ypos.ToString("F0");
    textOutputB1.text=counter2.ToString("F0");
    textOutputB2.text=counter2.ToString("F0");
*/
    sprite0.transform.position = new Vector3(xpos0+xoff0,.5f,(ypos0+yoff0)*-1);
    sprite1.transform.position = new Vector3(xpos1+xoff1,.5f,(ypos1+yoff1)*-1);
    sprite2.transform.position = new Vector3(xpos2+xoff2,.5f,(ypos2+yoff2)*-1);
    sprite3.transform.position = new Vector3(xpos3+xoff3,.5f,(ypos3+yoff3)*-1);


    counter+=1;

    }}





