commit
fd996c732d
5 changed files with 82 additions and 9 deletions
|
@ -508,6 +508,18 @@
|
|||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/background/waiting.png
|
||||
|
||||
#begin Textures/GUI/checkboxs_off-on.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
/processorParam:ColorKeyEnabled=True
|
||||
/processorParam:GenerateMipmaps=False
|
||||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/checkboxs_off-on.png
|
||||
|
||||
#begin Textures/GUI/Button.png
|
||||
/importer:TextureImporter
|
||||
|
@ -533,7 +545,7 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/Button2.png
|
||||
|
||||
#begin Textures/GUI/checkboxs_off-on.png
|
||||
#begin Textures/GUI/checkboxs_off.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
|
@ -543,7 +555,7 @@
|
|||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/checkboxs_off-on.png
|
||||
/build:Textures/GUI/checkboxs_off.png
|
||||
|
||||
#begin Textures/GUI/checkboxs_off.png
|
||||
/importer:TextureImporter
|
||||
|
@ -821,6 +833,18 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/icons/Collectables/Wood.png
|
||||
|
||||
#begin Textures/icons/ExitZone.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
/processorParam:ColorKeyEnabled=True
|
||||
/processorParam:GenerateMipmaps=False
|
||||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/icons/ExitZone.png
|
||||
|
||||
#begin Textures/icons/Material/Fabric.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
|
BIN
ZoFo/Content/Textures/icons/ExitZone.png
Normal file
BIN
ZoFo/Content/Textures/icons/ExitZone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 179 KiB |
|
@ -245,7 +245,11 @@ namespace ZoFo.GameCore
|
|||
if (ent != null)
|
||||
DeleteObject(ent);
|
||||
|
||||
}
|
||||
}
|
||||
else if (update is UpdateGameEnded)
|
||||
{
|
||||
GameEnd();
|
||||
}
|
||||
else if (update is UpdatePlayerParametrs)
|
||||
{
|
||||
UpdatePlayerHealth(update as UpdatePlayerParametrs);
|
||||
|
@ -299,9 +303,13 @@ namespace ZoFo.GameCore
|
|||
(ent as Player).health = (update as UpdatePlayerParametrs).health;
|
||||
(ent as Player).rad = (update as UpdatePlayerParametrs).radiatoin;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void GameEnd()
|
||||
{
|
||||
AppManager.Instance.SetGUI(new FinishingGUI());
|
||||
}
|
||||
|
||||
public Entity FindEntityById(int id)
|
||||
{
|
||||
|
|
42
ZoFo/GameCore/GameObjects/ExitZone.cs
Normal file
42
ZoFo/GameCore/GameObjects/ExitZone.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZoFo.GameCore.GameManagers;
|
||||
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||
using ZoFo.GameCore.Graphics;
|
||||
|
||||
namespace ZoFo.GameCore.GameObjects
|
||||
{
|
||||
public class ExitZone : Entity
|
||||
{
|
||||
|
||||
|
||||
public override GraphicsComponent graphicsComponent { get; } = new StaticGraphicsComponent("Textures/icons/ExitZone");
|
||||
public ExitZone(Vector2 position) : base(position)
|
||||
{
|
||||
collisionComponent.OnTriggerZone += Exit;
|
||||
graphicsComponent.ObjectDrawRectangle.Width = 100;
|
||||
graphicsComponent.ObjectDrawRectangle.Height = 100;
|
||||
position = new Vector2(500f, 500f);
|
||||
collisionComponent.isTrigger = true;
|
||||
collisionComponent.triggerRectangle = new Rectangle(0, 0, 100, 100);
|
||||
}
|
||||
|
||||
|
||||
public void Exit(GameObject sender)
|
||||
{
|
||||
if (sender is Player &&
|
||||
AppManager.Instance.server.collisionManager.GetPlayersInZone(collisionComponent.triggerRectangle.SetOrigin(position)).Length == AppManager.Instance.server.players.Count)
|
||||
{
|
||||
sender.position = new Vector2(0f, 0f);
|
||||
AppManager.Instance.server.EndGame();
|
||||
AppManager.Instance.debugHud.Set("Exit", sender.position.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -122,14 +122,12 @@ namespace ZoFo.GameCore
|
|||
entities = new List<Entity>();
|
||||
networkManager.StartGame();
|
||||
new MapManager().LoadMap();
|
||||
|
||||
//TODO
|
||||
//AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0)));
|
||||
|
||||
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(760, 140)));
|
||||
//for (int i = 0; i < 20; i++)
|
||||
// for (int j = 0; j < 20; j++)
|
||||
// AppManager.Instance.server.RegisterGameObject(new Zombie(new Vector2(1300 + i*70, 1000+j*70)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -138,7 +136,8 @@ namespace ZoFo.GameCore
|
|||
public void EndGame()
|
||||
{
|
||||
UpdateGameEnded gameEnded = new UpdateGameEnded();
|
||||
networkManager.AddData(gameEnded);
|
||||
networkManager.AddData(gameEnded);
|
||||
// networkManager.CloseConnection();
|
||||
}
|
||||
|
||||
public List<GameObject> gameObjects = new List<GameObject>();
|
||||
|
|
Loading…
Add table
Reference in a new issue