public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message)
 {
     message = base.MemberFieldUpdateMessage(message);
     message.Append(turnRight);
     message.Append(turnLeft);
     return(message);
 }
示例#2
0
 public void BroadcastUDP(GameObjectUpdate message)
 {
     foreach (Player client in clients)
     {
         client.SendUDP(message);
     }
 }
示例#3
0
 private void Update()
 {
     for (int i = 0; i <= GUIMaxIndex; i++)
     {
         if (GUIValid[i])
         {
             GUIUpdate[i].MyUpdate();
         }
     }
     for (int i = 0; i <= MapMaxIndex; i++)
     {
         if (MapValid[i])
         {
             MapUpdate[i].MyUpdate();
         }
     }
     for (int i = 0; i < PoolThingUpdate.Count; i++)
     {
         temp = PoolThingUpdate[i];
         for (int j = 0; j <= temp.maxArrayIndex; j++)
         {
             if (temp.isValid[j])
             {
                 temp.components[j].MyUpdate();
             }
         }
     }
     for (int i = 0; i <= PlayerMaxIndex; i++)
     {
         if (PlayerValid[i])
         {
             PlayerUpdate[i].MyUpdate();
         }
     }
     for (int i = 0; i < EnemyUpdate.Count; i++)
     {
         temp = EnemyUpdate[i];
         for (int j = 0; j <= temp.maxArrayIndex; j++)
         {
             if (temp.isValid[j])
             {
                 temp.components[j].MyUpdate();
             }
         }
     }
 }
        protected override void Update(GameTime gameTime)
        {
            float secondsElapsed = gameTime.ElapsedGameTime.Milliseconds / 1000.0f;

            this.serverConnection.UpdateControlState(gameTime);

            //haddle all available messages.  this is done again after the gameObject updates but before draw
            Queue <GameObjectUpdate> messageQueue = this.serverConnection.DequeueAllIncomingUDP();

            while (messageQueue.Count > 0)
            {
                GameObjectUpdate m = messageQueue.Dequeue();
                m.Apply(this, gameTime);
            }

            base.Update(gameTime);
            this.GameObjectCollection.ClientUpdate(gameTime);

            GameObjectField.SetModeDraw();
            Ship focus = this.GetLocalPlayerFocus();

            this.Camera.Update(focus, secondsElapsed);
        }
示例#5
0
 public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message)
 {
     message = base.MemberFieldUpdateMessage(message);
     message.Append(turnRight);
     message.Append(turnLeft);
     return message;
 }
示例#6
0
 //using MyGame.Networking;
 public override void UpdateMemberFields(GameObjectUpdate message)
 {
     base.UpdateMemberFields(message);
     turnRight = message.ReadBoolean();
     turnLeft = message.ReadBoolean();
 }
示例#7
0
 public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message)
 {
     message = base.MemberFieldUpdateMessage(message);
     message.Append(health);
     return(message);
 }
示例#8
0
 //using MyGame.Networking;
 public override void UpdateMemberFields(GameObjectUpdate message)
 {
     base.UpdateMemberFields(message);
     health = message.ReadInt();
 }
示例#9
0
 //using MyGame.Networking;
 public override void UpdateMemberFields(GameObjectUpdate message)
 {
     base.UpdateMemberFields(message);
 }
示例#10
0
 //using MyGame.Networking;
 public override void UpdateMemberFields(GameObjectUpdate message)
 {
     base.UpdateMemberFields(message);
     turnRight = message.ReadBoolean();
     turnLeft  = message.ReadBoolean();
 }
 public override GameObjectUpdate ConstructMessage(GameObjectUpdate message)
 {
     message.Append(this.SimulationValue);
     return message;
 }
        public override void ApplyMessage(GameObjectUpdate message)
        {
            this.previousValue = this.drawValue;
            this.simulationValue = message.ReadVector2();

            if (!initialized)
            {
                this.previousValue = this.simulationValue;
                this.drawValue = this.simulationValue;
                this.initialized = true;
            }

            this.collection.PreviousTree.Move(this.obj);
            this.collection.SimulationTree.Move(this.obj);
        }
示例#13
0
        //using MyGame.Networking;
        public override void UpdateMemberFields(GameObjectUpdate message)
        {
            base.UpdateMemberFields(message);
            health = message.ReadInt();

        }
示例#14
0
 public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message)
 {
     message = base.MemberFieldUpdateMessage(message);
     message.Append(health);
     return message;
 }
示例#15
0
        //using MyGame.Networking;
        public override void UpdateMemberFields(GameObjectUpdate message)
        {
            base.UpdateMemberFields(message);

        }