Beispiel #1
0
    void Start()
    {
        Debug.Log("Local run");
        if (two_players)
        {
            Tetris_Players.Add(Create_Player(0));
            Tetris_Players.Add(Create_Player(0));
            foreach (Player Current_Player in Tetris_Players)
            {
                SetupPlayerControls(Current_Player, last_given);
                last_given += Tetris_consts.keys_per_player;
                if (last_given > (Motion_keys)(Tetris_Players.Count * Tetris_consts.keys_per_player))
                {
                    last_given = Motion_keys.left;
                }
            }
        }
        else
        {
            Tetris_Players.Add(Create_Player(0));
        }

        GameObject canvas = GameObject.Find("Canvas");

        Destroy(canvas);
        areas_to_render[0] = (Instantiate(PlayArea3D));
        areas_to_render[1] = (Instantiate(PlayArea3D));
        areas_to_render[1].transform.position = areas_to_render[0].transform.position + new Vector3(next_player_render_separation, 0, 0);
    }
Beispiel #2
0
 public void SetupPlayerControls(Player Current_Player, Motion_keys last_given)
 {
     for (int keys = 0; keys < Tetris_consts.keys_per_player; keys++)
     {
         Current_Player.mymotion[keys] = last_given + keys;
     }
 }