Beispiel #1
0
        public FormGameTable(List <IPlayer> players, GameSettings gameSettings)
        {
            InitializeComponent();

            synchronizationContext = SynchronizationContext.Current;
            cancellationToken      = tokenSource.Token;

            DoubleBuffered = true;

            this.gameSettings = gameSettings;
            this.players      = players;
            playersStats      = new PlayersStats(gameSettings.NumberOfGames);

            if (gameSettings.Performance)
            {
                progressBarPerformance.Visible = true;
            }

            initializePlayerControls();

            setAllCardBacks();
            setCardsDictionary();

            game = new TexasHoldem(players, BettingRule.NoLimit, gameSettings.SmallBlind, gameSettings.BigBlind, playersStats);

            game.GameEvent += new Game.GameHandler(UpdateGui);

            Show();

            gameLoop(new Progress <int>(percent => progressBarPerformance.Value = percent));
        }
 // Start is called before the first frame update
 void Start()
 {
     stat = new PlayersStats();
     //MainCam.gameObject.SetActive(false);
     //PersonalCam.gameObject.SetActive(true);
     spawnPlayers();
 }
Beispiel #3
0
 private void Start()
 {
     //side = team.TeamA;
     stats = new PlayersStats();
     if (PV.IsMine)
     {
         rb = gameObject.GetComponent <Rigidbody2D>();
     }
     temp = stats.rechargeRate;
 }
Beispiel #4
0
    private void Awake()
    {
        stats      = GameObject.Find("GameManager").GetComponent <PlayersStats>();
        shieldObj1 = GameObject.Find("ShieldObj1");
        shieldObj2 = GameObject.Find("ShieldObj2");

        playerOneSlider = GameObject.Find("PlayerOneHealth").GetComponent <Slider>();
        playerTwoSlider = GameObject.Find("PlayerTwoHealth").GetComponent <Slider>();

        crosshairOne = GameObject.Find("CrosshairOne").GetComponent <MeshRenderer>();
        crosshairTwo = GameObject.Find("CrosshairTwo").GetComponent <MeshRenderer>();
    }
Beispiel #5
0
    //Awake is always called before any Start functions
    void Awake()
    {
        playerOneTransform = playerOne.transform;
        playerTwoTransform = playerTwo.transform;
        paused             = false;
        //Debug.Log(playerTwoTransform.position);
        //Check if instance already exists
        // if (instance == null)

        //if not, set instance to this
        //	instance = this;

        //If instance already exists and it's not this:
        //else if (instance != this)

        //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
        //	Destroy (gameObject);
        playerStats = this.GetComponent <PlayersStats>();
        //Sets this to not be destroyed when reloading scene
        //DontDestroyOnLoad (gameObject);

        Countdown();
    }
Beispiel #6
0
 public static void KillPlayer(PlayersStats player)          // kill player, resets score
 {
     Destroy(player.gameObject);
     Score.scoreValue = 0;
     gm.StartCoroutine(gm.RespawnPlayer());
 }
Beispiel #7
0
 private void Awake()
 {
     stats      = GameObject.Find("GameManager").GetComponent <PlayersStats>();
     shieldObj1 = GameObject.Find("ShieldObj1");
 }