BEST COMMIT EVER

This commit is contained in:
AnloGames 2024-08-20 20:27:20 +03:00
parent 439009ad4d
commit 448f80afd8
4 changed files with 13 additions and 4 deletions

View file

@ -316,10 +316,11 @@ namespace ZoFo.GameCore
(ent as Player).rad = (update as UpdatePlayerParametrs).radiatoin; (ent as Player).rad = (update as UpdatePlayerParametrs).radiatoin;
} }
} }
public bool changeGUI = false;
public void GameEnd() public void GameEnd()
{ {
AppManager.Instance.SetGUI(new FinishingGUI());
changeGUI = true;
} }
public Entity FindEntityById(int id) public Entity FindEntityById(int id)

View file

@ -127,7 +127,14 @@ namespace ZoFo.GameCore.GameManagers
default: default:
break; break;
} }
if (client != null)
{
if (client.changeGUI)
{
SetGUI(new FinishingGUI());
client.changeGUI = false;
}
}
base.Update(gameTime); base.Update(gameTime);
} }

View file

@ -103,6 +103,7 @@ public abstract class GameObject
} }
public void DrawDebugRectangle(SpriteBatch spriteBatch, Rectangle _rectangle, Nullable<Color> color = null) public void DrawDebugRectangle(SpriteBatch spriteBatch, Rectangle _rectangle, Nullable<Color> color = null)
{ {
return;
if (color is null) color = new Color(1, 0, 0, 0.1f); if (color is null) color = new Color(1, 0, 0, 0.1f);
if (color.Value.A == 255) color = new Color(color.Value, 0.25f); if (color.Value.A == 255) color = new Color(color.Value, 0.25f);
spriteBatch.Draw(debugTexture, spriteBatch.Draw(debugTexture,

View file

@ -138,7 +138,7 @@ namespace ZoFo.GameCore
//AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0))); //AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0)));
for (int i = 0; i < networkManager.clientsEP.Count; i++) for (int i = 0; i < networkManager.clientsEP.Count; i++)
{ {
Player player = new Player(new Vector2(760 - 30 * i, 140)); Player player = new Player(new Vector2(-800 - 30 * i, 750));
RegisterGameObject(player); RegisterGameObject(player);
networkManager.AddData(new UpdateCreatePlayer() { PlayerId = i+1, IdEntity=player.Id}); networkManager.AddData(new UpdateCreatePlayer() { PlayerId = i+1, IdEntity=player.Id});
} }