Esempio n. 1
0
 void OnCollisionStay(Collision other)
 {
     if (other.gameObject.tag == "Player")
     {
         FirstSceneController.getInstance().setGameOver(-1);
     }
 }
Esempio n. 2
0
 void Start()
 {
     player    = FirstSceneController.getInstance().player;
     minX      = this.transform.position.x - 2.5f;
     minZ      = this.transform.position.z - 2.5f;
     patroling = true;
     time      = 3f;
 }
Esempio n. 3
0
    void FixedUpdate()
    {
        if (FirstSceneController.getInstance().gameOver != 0)
        {
            return;
        }

        float translationX = Input.GetAxis("Horizontal") * 6;
        float translationZ = Input.GetAxis("Vertical") * 6;

        translationX *= Time.deltaTime;
        translationZ *= Time.deltaTime;
        this.transform.Translate(translationX, 0, 0);
        this.transform.Translate(0, 0, translationZ);
    }
Esempio n. 4
0
    void FixedUpdate()
    {
        if (FirstSceneController.getInstance().gameOver != 0)
        {
            return;
        }

        if (patroling)
        {
            GoAhead();
        }
        else
        {
            Follow();
        }
    }
 void OnGUI()
 {
     if (FirstSceneController.getInstance().gameOver == -1)
     {
         GUIStyle style = new GUIStyle();
         style.normal.background = null;
         style.normal.textColor  = new Color(0, 0, 0);
         style.fontSize          = 40;
         GUI.TextField(new Rect(200, 150, 300, 50), "Player2 Wins!", style);
     }
     if (FirstSceneController.getInstance().gameOver == 1)
     {
         GUIStyle style = new GUIStyle();
         style.normal.background = null;
         style.normal.textColor  = new Color(0, 0, 0);
         style.fontSize          = 40;
         GUI.TextField(new Rect(200, 150, 300, 50), "Player1 Wins!", style);
     }
 }
Esempio n. 6
0
 void Start()
 {
     firstSceneController = FirstSceneController.getInstance();
 }
Esempio n. 7
0
 void CmdAddPlayer()
 {
     FirstSceneController.getInstance().addPlayer();
 }