commit
fd996c732d
5 changed files with 82 additions and 9 deletions
|
@ -509,6 +509,18 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/background/waiting.png
|
/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
|
#begin Textures/GUI/Button.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -533,7 +545,7 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/Button2.png
|
/build:Textures/GUI/Button2.png
|
||||||
|
|
||||||
#begin Textures/GUI/checkboxs_off-on.png
|
#begin Textures/GUI/checkboxs_off.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
@ -543,7 +555,7 @@
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
/processorParam:MakeSquare=False
|
/processorParam:MakeSquare=False
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/checkboxs_off-on.png
|
/build:Textures/GUI/checkboxs_off.png
|
||||||
|
|
||||||
#begin Textures/GUI/checkboxs_off.png
|
#begin Textures/GUI/checkboxs_off.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
|
@ -821,6 +833,18 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/icons/Collectables/Wood.png
|
/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
|
#begin Textures/icons/Material/Fabric.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/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 |
|
@ -246,6 +246,10 @@ namespace ZoFo.GameCore
|
||||||
DeleteObject(ent);
|
DeleteObject(ent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if (update is UpdateGameEnded)
|
||||||
|
{
|
||||||
|
GameEnd();
|
||||||
|
}
|
||||||
else if (update is UpdatePlayerParametrs)
|
else if (update is UpdatePlayerParametrs)
|
||||||
{
|
{
|
||||||
UpdatePlayerHealth(update as UpdatePlayerParametrs);
|
UpdatePlayerHealth(update as UpdatePlayerParametrs);
|
||||||
|
@ -302,6 +306,10 @@ namespace ZoFo.GameCore
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void GameEnd()
|
||||||
|
{
|
||||||
|
AppManager.Instance.SetGUI(new FinishingGUI());
|
||||||
|
}
|
||||||
|
|
||||||
public Entity FindEntityById(int id)
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -123,8 +123,6 @@ namespace ZoFo.GameCore
|
||||||
networkManager.StartGame();
|
networkManager.StartGame();
|
||||||
new MapManager().LoadMap();
|
new MapManager().LoadMap();
|
||||||
|
|
||||||
//TODO
|
|
||||||
//AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0)));
|
|
||||||
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(760, 140)));
|
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(760, 140)));
|
||||||
//for (int i = 0; i < 20; i++)
|
//for (int i = 0; i < 20; i++)
|
||||||
// for (int j = 0; j < 20; j++)
|
// for (int j = 0; j < 20; j++)
|
||||||
|
@ -139,6 +137,7 @@ namespace ZoFo.GameCore
|
||||||
{
|
{
|
||||||
UpdateGameEnded gameEnded = new UpdateGameEnded();
|
UpdateGameEnded gameEnded = new UpdateGameEnded();
|
||||||
networkManager.AddData(gameEnded);
|
networkManager.AddData(gameEnded);
|
||||||
|
// networkManager.CloseConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GameObject> gameObjects = new List<GameObject>();
|
public List<GameObject> gameObjects = new List<GameObject>();
|
||||||
|
|
Loading…
Add table
Reference in a new issue