示例#1
0
 void landing(int x, int y, GameObject gameobj)
 {
     Block_Pos.make_occupy(pos[0], pos[1], gameobj);
     Block_Pos.check_line_up(pos[0], pos[1]);
     if (control_enable)
     {
         Central.signal = true;
         control_enable = false;
     }
 }
示例#2
0
    /* public static void starting(int x, int y)
     * {
     *   //Random 2 number which will be the position
     *   pos[0] = x;
     *   pos[1] = y;
     *
     * }*/

    void Start()
    {
        if (color == 0)
        {
            gameObject.renderer.material.color = Color.yellow;
            gameObject.tag = "Yellow";
        }
        if (color == 1)
        {
            gameObject.renderer.material.color = Color.red;
            gameObject.tag = "Red";
        }
        if (color == 2)
        {
            gameObject.renderer.material.color = Color.green;
            gameObject.tag = "Green";
        }
        transform.position = Vector3.Lerp(transform.position, Block_Pos.get_pos(pos[0], pos[1]), 1);
        Block_Pos.make_occupy(pos[0], pos[1], gameObject);
    }
示例#3
0
    void Generate_virus()
    {
        //Set random and send to virus
        GameObject hmm = (GameObject)Instantiate(virus);

        hmm.name = "BasicVirus";
        int x, y, z;

        x = Random.Range(0, 8);
        y = Random.Range(0, 8);
        while (Block_Pos.is_occupy(x, y))
        {
            x = Random.Range(0, 8);
            y = Random.Range(0, 8);
        }
        hmm.SendMessage("Set_x", x);
        hmm.SendMessage("Set_y", y);
        z = Random.Range(0, 3);
        hmm.SendMessage("Set_type", z);
        Block_Pos.make_occupy(x, y, hmm);
    }