コード例 #1
0
ファイル: maingame.cs プロジェクト: Malkeet1212/car-race-
        public void SetupRaceTrack()
        {
            bett[0] = new Bettor()
            {
                myPictureBox = carPB1,
                starting     = raceTrackPictureBox.Left,
                raceLength   = raceTrackPictureBox.Width - carPB1.Width,
                rando        = myRandomizer
            };
            bett[1] = new Bettor()
            {
                myPictureBox = carPB2,
                starting     = raceTrackPictureBox.Left,
                raceLength   = raceTrackPictureBox.Width - carPB2.Width,
                rando        = myRandomizer
            };
            bett[2] = new Bettor()
            {
                myPictureBox = carPb3,
                starting     = raceTrackPictureBox.Left,
                raceLength   = raceTrackPictureBox.Width - carPb3.Width,
                rando        = myRandomizer
            };
            bett[3] = new Bettor()
            {
                myPictureBox = carpb4,
                starting     = raceTrackPictureBox.Left,
                raceLength   = raceTrackPictureBox.Width - carpb4.Width,
                rando        = myRandomizer
            };


            racers[0] = new racer("gill", 50, playerrb1, player1Label);//it is setting the player name and their money
            racers[1] = new racer("askarn", 50, playerrb2, player2Label);
            racers[2] = new racer("simer", 50, playerrb3, player3Label);

            foreach (var guy in racers)
            {
                guy.Bets(0, 0);
                guy.UpdateLb();
            }
            minimumBetLabel.Text = "Minimum bet: " + miniBet + " bucks";
            betupdown.Minimum    = miniBet;
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: karanbir1997/CarRace-master
        public void playerplay()
        {
            players[0] = new Bettor()
            {
                carPicturebox = RacerPB1,
                start_race    = Pbrace.Left,
                Fullrace      = Pbrace.Width - RacerPB1.Width,
                rad           = randmon
            };
            players[1] = new Bettor()
            {
                carPicturebox = RacerPB2,
                start_race    = Pbrace.Left,
                Fullrace      = Pbrace.Width - RacerPB2.Width,
                rad           = randmon
            };
            players[2] = new Bettor()
            {
                carPicturebox = racerPb3,
                start_race    = Pbrace.Left,
                Fullrace      = Pbrace.Width - racerPb3.Width,
                rad           = randmon
            };
            players[3] = new Bettor()
            {
                carPicturebox = racerpb4,
                start_race    = Pbrace.Left,
                Fullrace      = Pbrace.Width - racerpb4.Width,
                rad           = randmon
            };


            cars[0] = new cars("peter", 50, PeteRAdio, player1Label);
            cars[1] = new cars("sam", 50, samradio, player2Label);
            cars[2] = new cars("jef", 50, Jeffradio, player3Label);

            foreach (var guy in cars)
            {
                guy.Bets(0, 0);
                guy.racerupdate();
            }
            minimumBetLabel.Text = "1";
            playerud.Minimum     = bet;
        }