Beispiel #1
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent(InitGamePacket packet)
 {
     this.MainWindow = new Client.MonoGameWindow(packet, this.client);
     this.SuspendLayout();
     //
     // monoGameWindow1
     //
     this.MainWindow.Location = new System.Drawing.Point(0, 0);
     this.MainWindow.MouseHoverUpdatesOnly = false;
     this.MainWindow.Name     = "monoGameWindow1";
     this.MainWindow.Size     = new System.Drawing.Size(1440, 810);
     this.MainWindow.TabIndex = 0;
     this.MainWindow.Text     = "monoGameWindow1";
     //
     // GameWindow
     //
     this.ClientSize = new System.Drawing.Size(1440, 810);
     this.Controls.Add(this.MainWindow);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Name            = "GameWindow";
     this.ResumeLayout(false);
 }
Beispiel #2
0
        public Client_Game(InitGamePacket packet)
        {
            Keys[] player1Controls = { Keys.W, Keys.A, Keys.D, Keys.S };

            level.AddPlatform(new Platform(500, 550, 200, 25));
            level.AddPlatform(new Platform(200, 225, 100, 25));
            level.AddPlatform(new Platform(720, 785, 720, 25));
            level.AddPlatform(new Platform(720, 25, 720, 25));
            level.AddPlatform(new Platform(25, 405, 25, 355));
            level.AddPlatform(new Platform(1415, 405, 25, 355));
            level.AddPlatform(new Platform(1100, 325, 150, 25));

            playerID = packet.playerID;
            foreach (List <float> playerData in packet.players)
            {
                players.Add(new Player((int)playerData[0], (int)playerData[1], 17, 50, new Color((int)playerData[2], (int)playerData[3], (int)playerData[4]), player1Controls, true));
            }
            clientPlayer = new Player((int)packet.clientPlayerData[0], (int)packet.clientPlayerData[1], 17, 50, new Color((int)packet.clientPlayerData[2], (int)packet.clientPlayerData[3], (int)packet.clientPlayerData[4]), player1Controls, true);
            foreach (List <float> platformData in packet.level)
            {
                level.AddPlatform(new Platform((int)platformData[0], (int)platformData[1], (int)platformData[2], (int)platformData[3]));
            }
        }
Beispiel #3
0
 public MonoGameWindow(InitGamePacket packet, Client_Client client)
 {
     game        = new Client_Game(packet);
     this.client = client;
 }
Beispiel #4
0
 public GameWindow(InitGamePacket packet, Client_Client client)
 {
     this.client = client;
     InitializeComponent(packet);
 }