private void GenerateCollectables_T_Elapsed(object sender, ElapsedEventArgs e) { CollectablePosition.X = rnd.Next(-1500, 1250); CollectablePosition.Y = rnd.Next(-720, 545); proxy.Invoke("SendCollectablePosition", CollectablePosition); GameLengthCounter++; if (GameLength == GameLengthCounter) { if (!SpecialCreated) { CollectablePosition.X = rnd.Next(-1500, 1250); CollectablePosition.Y = rnd.Next(-720, 545); specialCollectable = new SpecialCollectable(SpecialCollectableTex, new Point((int)CollectablePosition.X,(int)CollectablePosition.Y), Player1, Player2, 3000, 1400); SpecialCreated = true; } } }
public void UpdateGamePlay(GameTime gameTime) { /*if (TurnOnProxy == false) { }*/ if (Player1.PlayerID == "Player1") if (specialCollectable != null) SendSpecialCollectablePosition = specialCollectable.GetPosition(); if (specialCollectable != null) specialCollectable.Update(RecievedSpecialCollectablePosition); Player1.Update(gameTime); Player2.Update(gameTime); camera.Update(gameTime, Player1, PreferredBackBufferWidth, PreferredBackBufferHeight); CheckIfGameOver(); if (SpecialInit == false) { if (SpecialCreated == true) { specialCollectable = new SpecialCollectable(SpecialCollectableTex, RecievedSpecialCollectablePosition, Player1, Player2, 3000, 1400); SpecialInit = true; } } }