public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message) { message = base.MemberFieldUpdateMessage(message); message.Append(turnRight); message.Append(turnLeft); return(message); }
public void BroadcastUDP(GameObjectUpdate message) { foreach (Player client in clients) { client.SendUDP(message); } }
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); }
public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message) { message = base.MemberFieldUpdateMessage(message); message.Append(turnRight); message.Append(turnLeft); return message; }
//using MyGame.Networking; public override void UpdateMemberFields(GameObjectUpdate message) { base.UpdateMemberFields(message); turnRight = message.ReadBoolean(); turnLeft = message.ReadBoolean(); }
public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message) { message = base.MemberFieldUpdateMessage(message); message.Append(health); return(message); }
//using MyGame.Networking; public override void UpdateMemberFields(GameObjectUpdate message) { base.UpdateMemberFields(message); health = message.ReadInt(); }
//using MyGame.Networking; public override void UpdateMemberFields(GameObjectUpdate message) { base.UpdateMemberFields(message); }
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); }
public override GameObjectUpdate MemberFieldUpdateMessage(GameObjectUpdate message) { message = base.MemberFieldUpdateMessage(message); message.Append(health); return message; }