pull
This commit is contained in:
commit
d9bb9e053b
32 changed files with 701 additions and 73 deletions
|
@ -24,6 +24,10 @@ namespace MonogameLibrary.UI.Elements
|
||||||
private bool isChecked;
|
private bool isChecked;
|
||||||
HoverState hoverState = HoverState.None;
|
HoverState hoverState = HoverState.None;
|
||||||
public bool GetChecked { get { return isChecked; } }
|
public bool GetChecked { get { return isChecked; } }
|
||||||
|
public void SetIsChecked(bool isChecked)
|
||||||
|
{
|
||||||
|
this.isChecked=isChecked;
|
||||||
|
}
|
||||||
public bool InteractUpdate(MouseState mouseState, MouseState prevmouseState)
|
public bool InteractUpdate(MouseState mouseState, MouseState prevmouseState)
|
||||||
{
|
{
|
||||||
if (rectangle.Intersects(new Rectangle(mouseState.Position, Point.Zero)))
|
if (rectangle.Intersects(new Rectangle(mouseState.Position, Point.Zero)))
|
||||||
|
|
|
@ -34,6 +34,56 @@
|
||||||
/processorParam:TextureFormat=Compressed
|
/processorParam:TextureFormat=Compressed
|
||||||
/build:Fonts/Font3.spritefont
|
/build:Fonts/Font3.spritefont
|
||||||
|
|
||||||
|
#begin sounds/Loot.wav
|
||||||
|
/importer:WavImporter
|
||||||
|
/processor:SoundEffectProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Loot.wav
|
||||||
|
|
||||||
|
#begin sounds/Odevanie odezdi.wav
|
||||||
|
/importer:WavImporter
|
||||||
|
/processor:SoundEffectProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Odevanie odezdi.wav
|
||||||
|
|
||||||
|
#begin sounds/Pieot wodichky.wav
|
||||||
|
/importer:WavImporter
|
||||||
|
/processor:SoundEffectProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Pieot wodichky.wav
|
||||||
|
|
||||||
|
#begin sounds/Sshetchik geigera.wav
|
||||||
|
/importer:WavImporter
|
||||||
|
/processor:SoundEffectProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Sshetchik geigera.wav
|
||||||
|
|
||||||
|
#begin sounds/Tabletki 2.wav
|
||||||
|
/importer:WavImporter
|
||||||
|
/processor:SoundEffectProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Tabletki 2.wav
|
||||||
|
|
||||||
|
#begin sounds/Tabletki.mp3
|
||||||
|
/importer:Mp3Importer
|
||||||
|
/processor:SongProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Tabletki.mp3
|
||||||
|
|
||||||
|
#begin sounds/Zombi napal.wav
|
||||||
|
/importer:WavImporter
|
||||||
|
/processor:SoundEffectProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Zombi napal.wav
|
||||||
|
|
||||||
|
#begin sounds/Zombi stoit.wav
|
||||||
|
/importer:WavImporter
|
||||||
|
/processor:SoundEffectProcessor
|
||||||
|
/processorParam:Quality=Best
|
||||||
|
/build:sounds/Zombi stoit.wav
|
||||||
|
|
||||||
|
#begin Textures/GUI/checkboxs_off.png
|
||||||
|
|
||||||
#begin Textures/GUI/background/base.png
|
#begin Textures/GUI/background/base.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -92,9 +142,9 @@
|
||||||
/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-on.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
@ -104,7 +154,7 @@
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
/processorParam:MakeSquare=False
|
/processorParam:MakeSquare=False
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/checkboxs_off.png
|
/build:Textures/GUI/checkboxs_off-on.png
|
||||||
|
|
||||||
#begin Textures/GUI/checkboxs_on.png
|
#begin Textures/GUI/checkboxs_on.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
|
@ -142,18 +192,6 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/mouse.png
|
/build:Textures/GUI/mouse.png
|
||||||
|
|
||||||
#begin Textures/GUI/Switch_backgrownd.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/Switch_backgrownd.png
|
|
||||||
|
|
||||||
#begin Textures/GUI/switch.png
|
#begin Textures/GUI/switch.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -166,3 +204,15 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Textures/GUI/switch.png
|
/build:Textures/GUI/switch.png
|
||||||
|
|
||||||
|
#begin Textures/GUI/Switch_backgrownd.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/Switch_backgrownd.png
|
||||||
|
|
||||||
|
|
BIN
ZoFo/Content/Textures/Background/TilesetFloor.png
Normal file
BIN
ZoFo/Content/Textures/Background/TilesetFloor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
ZoFo/Content/sounds/Loot.wav
Normal file
BIN
ZoFo/Content/sounds/Loot.wav
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/Odevanie odezdi.wav
Normal file
BIN
ZoFo/Content/sounds/Odevanie odezdi.wav
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/Pieot wodichky.wav
Normal file
BIN
ZoFo/Content/sounds/Pieot wodichky.wav
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/Sshetchik geigera.wav
Normal file
BIN
ZoFo/Content/sounds/Sshetchik geigera.wav
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/Tabletki 2.wav
Normal file
BIN
ZoFo/Content/sounds/Tabletki 2.wav
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/Tabletki.mp3
Normal file
BIN
ZoFo/Content/sounds/Tabletki.mp3
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/Zombi napal.wav
Normal file
BIN
ZoFo/Content/sounds/Zombi napal.wav
Normal file
Binary file not shown.
BIN
ZoFo/Content/sounds/Zombi stoit.wav
Normal file
BIN
ZoFo/Content/sounds/Zombi stoit.wav
Normal file
Binary file not shown.
|
@ -7,6 +7,8 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
|
using ZoFo.GameCore.GameObjects;
|
||||||
|
using ZoFo.GameCore.GameObjects.MapObjects;
|
||||||
|
|
||||||
namespace ZoFo.GameCore
|
namespace ZoFo.GameCore
|
||||||
{
|
{
|
||||||
|
@ -22,21 +24,32 @@ namespace ZoFo.GameCore
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnDataSend(string data)
|
public void OnDataSend(string data)
|
||||||
{
|
{
|
||||||
List<IUpdateData> updateDatas = JsonSerializer.Deserialize<List<IUpdateData>>(data);
|
List<IUpdateData> updateDatas = JsonSerializer.Deserialize<List<IUpdateData>>(data);
|
||||||
// тут будет switch
|
// тут будет switch
|
||||||
|
foreach (var item in updateDatas)
|
||||||
|
{
|
||||||
|
/* switch (item.UpdateType) Здесь нужно отлавливать и регистрировать
|
||||||
|
{
|
||||||
|
case "Tile":
|
||||||
|
MapObject map = new MapObject();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public void GameEndedUnexpectedly(){ }
|
public void GameEndedUnexpectedly() { }
|
||||||
public void JoinRoom(string ip)
|
public void JoinRoom(string ip)
|
||||||
{
|
{
|
||||||
networkManager.JoinRoom(ip);
|
networkManager.JoinRoom(ip);
|
||||||
}
|
}
|
||||||
public void JoinYourself(){ networkManager.JoinYourself(); }
|
public void JoinYourself() { networkManager.JoinYourself(); }
|
||||||
internal void Update(GameTime gameTime)
|
internal void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
internal void Draw(SpriteBatch spriteBatch)
|
internal void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -35,9 +35,10 @@ public class OptionsGUI : AbstractGUI
|
||||||
|
|
||||||
var slider_OverallVolume = new Slider(Manager)
|
var slider_OverallVolume = new Slider(Manager)
|
||||||
{ rectangle = new Rectangle(width / 2, height / 3, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
{ rectangle = new Rectangle(width / 2, height / 3, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
||||||
|
slider_OverallVolume.SetValue(AppManager.Instance.SettingsManager.MainVolume);
|
||||||
slider_OverallVolume.SliderChanged += (newVal) =>
|
slider_OverallVolume.SliderChanged += (newVal) =>
|
||||||
{
|
{
|
||||||
|
AppManager.Instance.SettingsManager.SetMainVolume(newVal);
|
||||||
};
|
};
|
||||||
Elements.Add(slider_OverallVolume);
|
Elements.Add(slider_OverallVolume);
|
||||||
|
|
||||||
|
@ -47,9 +48,10 @@ public class OptionsGUI : AbstractGUI
|
||||||
|
|
||||||
var slider_MusicVolume = new Slider(Manager)
|
var slider_MusicVolume = new Slider(Manager)
|
||||||
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 1, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 1, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
||||||
|
slider_MusicVolume.SetValue(AppManager.Instance.SettingsManager.MusicVolume);
|
||||||
slider_MusicVolume.SliderChanged += (newVal) =>
|
slider_MusicVolume.SliderChanged += (newVal) =>
|
||||||
{
|
{
|
||||||
|
AppManager.Instance.SettingsManager.SetMusicVolume(newVal);
|
||||||
};
|
};
|
||||||
Elements.Add(slider_MusicVolume);
|
Elements.Add(slider_MusicVolume);
|
||||||
|
|
||||||
|
@ -60,9 +62,10 @@ public class OptionsGUI : AbstractGUI
|
||||||
|
|
||||||
var slider_EffectsVolume = new Slider(Manager)
|
var slider_EffectsVolume = new Slider(Manager)
|
||||||
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 2, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 2, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
||||||
|
slider_EffectsVolume.SetValue(AppManager.Instance.SettingsManager.SoundEffectsVolume);
|
||||||
slider_EffectsVolume.SliderChanged += (newVal) =>
|
slider_EffectsVolume.SliderChanged += (newVal) =>
|
||||||
{
|
{
|
||||||
|
AppManager.Instance.SettingsManager.SetSoundEffectsVolume(newVal);
|
||||||
};
|
};
|
||||||
Elements.Add(slider_EffectsVolume);
|
Elements.Add(slider_EffectsVolume);
|
||||||
|
|
||||||
|
@ -80,9 +83,10 @@ public class OptionsGUI : AbstractGUI
|
||||||
Elements.Add(label_IsFullScreen);
|
Elements.Add(label_IsFullScreen);
|
||||||
|
|
||||||
var button_FullScreen = new CheckBox(Manager) { rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 4, width / 40, width / 40) };
|
var button_FullScreen = new CheckBox(Manager) { rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 4, width / 40, width / 40) };
|
||||||
|
button_FullScreen.SetIsChecked(AppManager.Instance.SettingsManager.IsFullScreen);
|
||||||
button_FullScreen.Checked += (newCheckState) =>
|
button_FullScreen.Checked += (newCheckState) =>
|
||||||
{
|
{
|
||||||
|
AppManager.Instance.SettingsManager.SetIsFullScreen(newCheckState);
|
||||||
};
|
};
|
||||||
Elements.Add(button_FullScreen);
|
Elements.Add(button_FullScreen);
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,14 @@ public class SelectModeMenu : AbstractGUI
|
||||||
{
|
{
|
||||||
AppManager.Instance.SetGUI(new SelectingServerGUI());
|
AppManager.Instance.SetGUI(new SelectingServerGUI());
|
||||||
// multi
|
// multi
|
||||||
Server server = new Server(); //Server Logic SinglePlayer
|
Server server = new Server(); //Server Logic MultiPlayer
|
||||||
Client client = new Client();
|
Client client = new Client();
|
||||||
server.CreateRoom(1);
|
server.CreateRoom(5);
|
||||||
client.JoinYourself();
|
client.JoinRoom("127.0.0.1"); //указать айпишник
|
||||||
AppManager.Instance.SetServer(server);
|
AppManager.Instance.SetServer(server);
|
||||||
AppManager.Instance.SetClient(client);
|
AppManager.Instance.SetClient(client);
|
||||||
|
string key = client.IsConnected.ToString();
|
||||||
|
AppManager.Instance.debugHud.Set(key, "MultiPlayer");
|
||||||
// ваш код здесь
|
// ваш код здесь
|
||||||
};
|
};
|
||||||
Elements.Add(optionButton);
|
Elements.Add(optionButton);
|
||||||
|
|
|
@ -36,6 +36,8 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
|
|
||||||
public InputManager InputManager;
|
public InputManager InputManager;
|
||||||
public ItemManager.ItemManager ItemManager;
|
public ItemManager.ItemManager ItemManager;
|
||||||
|
public SettingsManager SettingsManager;
|
||||||
|
public SoundManager SoundManager;
|
||||||
|
|
||||||
public AnimationBuilder animationBuilder { get; set; }
|
public AnimationBuilder animationBuilder { get; set; }
|
||||||
|
|
||||||
|
@ -53,8 +55,11 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
|
|
||||||
Instance = this;
|
Instance = this;
|
||||||
InputManager = new InputManager();
|
InputManager = new InputManager();
|
||||||
|
SettingsManager = new SettingsManager();
|
||||||
|
SettingsManager.LoadSettings();
|
||||||
|
SoundManager = new SoundManager();
|
||||||
|
SoundManager.LoadSounds();
|
||||||
|
|
||||||
|
|
||||||
currentGUI = new MainMenuGUI();
|
currentGUI = new MainMenuGUI();
|
||||||
debugHud = new DebugHUD();
|
debugHud = new DebugHUD();
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
|
@ -13,5 +14,6 @@ namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
public int Width { get; set; }
|
public int Width { get; set; }
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public bool Visibility { get; set; }
|
public bool Visibility { get; set; }
|
||||||
|
public string Class { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
|
|
|
@ -8,23 +8,33 @@ using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ZoFo.GameCore.GameManagers.MapManager.MapElements;
|
using ZoFo.GameCore.GameManagers.MapManager.MapElements;
|
||||||
|
using ZoFo.GameCore.GameObjects.MapObjects;
|
||||||
|
using ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
||||||
|
using ZoFo.GameCore.GameObjects.MapObjects.Tiles;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.MapManager
|
namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
{
|
{
|
||||||
public class MapManager
|
public class MapManager
|
||||||
{
|
{
|
||||||
private static readonly string _path = "/{0}.tmj";
|
|
||||||
|
private static readonly string _templatePath = "TileMaps/{0}.tmj";
|
||||||
|
private static readonly float _scale = 1.0f;
|
||||||
private List<TileSet> _tileSets = new List<TileSet>();
|
private List<TileSet> _tileSets = new List<TileSet>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Загрузка карты. Передаётся название файла карты. По умолчанию main.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapName"></param>
|
||||||
public void LoadMap(string mapName = "main")
|
public void LoadMap(string mapName = "main")
|
||||||
{
|
{
|
||||||
TileMap tileMap;
|
// Загрузка TileMap
|
||||||
using (StreamReader reader = new StreamReader(string.Format(_path, mapName)))
|
var options = new JsonSerializerOptions
|
||||||
{
|
{
|
||||||
string data = reader.ReadToEnd();
|
PropertyNameCaseInsensitive = true
|
||||||
tileMap = JsonSerializer.Deserialize<TileMap>(data);
|
};
|
||||||
}
|
TileMap tileMap = JsonSerializer.Deserialize<TileMap>(File.ReadAllText(string.Format(_templatePath, mapName)), options);
|
||||||
|
|
||||||
|
// Загрузка TileSet-ов по TileSetInfo
|
||||||
List<TileSet> tileSets = new List<TileSet>();
|
List<TileSet> tileSets = new List<TileSet>();
|
||||||
foreach (TileSetInfo tileSetInfo in tileMap.TileSets)
|
foreach (TileSetInfo tileSetInfo in tileMap.TileSets)
|
||||||
{
|
{
|
||||||
|
@ -33,32 +43,50 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
tileSets.Add(tileSet);
|
tileSets.Add(tileSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var chunk in tileMap.Layers[0].Chunks)
|
foreach (var layer in tileMap.Layers)
|
||||||
{
|
{
|
||||||
int i = 0;
|
foreach (var chunk in layer.Chunks)
|
||||||
foreach (var id in chunk.Data)
|
|
||||||
{
|
{
|
||||||
foreach (var tileSet in tileSets)
|
for (int i = 0; i < chunk.Data.Length; i++)
|
||||||
{
|
{
|
||||||
if (tileSet.FirstGid - id < 0)
|
foreach (var tileSet in tileSets)
|
||||||
{
|
{
|
||||||
int number = id - tileSet.FirstGid;
|
if (tileSet.FirstGid - chunk.Data[i] < 0)
|
||||||
|
{
|
||||||
|
int number = chunk.Data[i] - tileSet.FirstGid;
|
||||||
|
|
||||||
int relativeColumn = number % tileSet.Columns * tileSet.TileWidth;
|
int relativeColumn = number % tileSet.Columns * tileSet.TileWidth;
|
||||||
int relativeRow = number / tileSet.Columns * tileSet.TileHeight;
|
int relativeRow = number / tileSet.Columns * tileSet.TileHeight;
|
||||||
|
|
||||||
Rectangle sourceRectangle = new Rectangle(relativeColumn * tileSet.TileWidth, relativeRow * tileSet.TileHeight,
|
Rectangle sourceRectangle = new Rectangle(relativeColumn * tileSet.TileWidth, relativeRow * tileSet.TileHeight,
|
||||||
relativeColumn * tileSet.TileWidth + tileSet.TileWidth, relativeRow * tileSet.TileHeight + tileSet.TileHeight);
|
relativeColumn * tileSet.TileWidth + tileSet.TileWidth, relativeRow * tileSet.TileHeight + tileSet.TileHeight);
|
||||||
|
|
||||||
Vector2 position = new Vector2(i % chunk.Width, i / chunk.Height);
|
Vector2 position = new Vector2(i % chunk.Width, i / chunk.Height);
|
||||||
|
|
||||||
|
switch (layer.Class)
|
||||||
|
{
|
||||||
|
case "Tile":
|
||||||
|
new MapObject(position, new Vector2(tileSet.TileWidth * _scale, tileSet.TileHeight * _scale), sourceRectangle, tileSet.Name);
|
||||||
|
break;
|
||||||
|
case "StopObject":
|
||||||
|
// new StopObject(position, new Vector2(tileSet.TileWidth * _scale, tileSet.TileHeight * _scale), sourceRectangle, tileSet.Name);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Загружает и парсит TileSet по его пути.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path"></param>
|
||||||
|
/// <returns></returns>
|
||||||
private TileSet LoadTileSet(string path)
|
private TileSet LoadTileSet(string path)
|
||||||
{
|
{
|
||||||
using (StreamReader reader = new StreamReader(path))
|
using (StreamReader reader = new StreamReader(path))
|
||||||
|
@ -67,6 +95,5 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
return JsonSerializer.Deserialize<TileSet>(data);
|
return JsonSerializer.Deserialize<TileSet>(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"activeFile": "",
|
||||||
|
"expandedProjectPaths": [
|
||||||
|
],
|
||||||
|
"fileStates": {
|
||||||
|
"TileSets/TileSet 1.tsj": {
|
||||||
|
"scaleInDock": 1,
|
||||||
|
"scaleInEditor": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"openFiles": [
|
||||||
|
],
|
||||||
|
"project": "",
|
||||||
|
"recentFiles": [
|
||||||
|
"TileSets/TileSet 1.tsj"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"automappingRulesFile": "",
|
||||||
|
"commands": [
|
||||||
|
],
|
||||||
|
"compatibilityVersion": 1100,
|
||||||
|
"extensionsPath": "extensions",
|
||||||
|
"folders": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
],
|
||||||
|
"propertyTypes": [
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"Map/SizeTest": {
|
||||||
|
"height": 4300,
|
||||||
|
"width": 2
|
||||||
|
},
|
||||||
|
"activeFile": "",
|
||||||
|
"expandedProjectPaths": [
|
||||||
|
],
|
||||||
|
"fileStates": {
|
||||||
|
},
|
||||||
|
"last.imagePath": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/Textures/Background",
|
||||||
|
"map.fixedSize": false,
|
||||||
|
"map.lastUsedFormat": "json",
|
||||||
|
"map.tileHeight": 16,
|
||||||
|
"map.tileWidth": 16,
|
||||||
|
"openFiles": [
|
||||||
|
],
|
||||||
|
"project": "MapSession.tiled-project",
|
||||||
|
"recentFiles": [
|
||||||
|
]
|
||||||
|
}
|
167
ZoFo/GameCore/GameManagers/MapManager/TileMaps/main.tmj
Normal file
167
ZoFo/GameCore/GameManagers/MapManager/TileMaps/main.tmj
Normal file
|
@ -0,0 +1,167 @@
|
||||||
|
{ "compressionlevel":-1,
|
||||||
|
"height":20,
|
||||||
|
"infinite":true,
|
||||||
|
"layers":[
|
||||||
|
{
|
||||||
|
"chunks":[
|
||||||
|
{
|
||||||
|
"data":[24, 24, 24, 28, 29, 24, 24, 24, 28, 46, 29, 24, 25, 115, 45, 46,
|
||||||
|
24, 24, 24, 25, 23, 24, 24, 24, 50, 2, 51, 24, 50, 2, 2, 2,
|
||||||
|
24, 24, 24, 50, 32, 29, 24, 24, 24, 24, 24, 24, 24, 24, 24, 28,
|
||||||
|
28, 29, 24, 28, 10, 32, 29, 24, 24, 28, 46, 29, 24, 24, 24, 50,
|
||||||
|
47, 23, 24, 50, 32, 10, 32, 46, 29, 50, 2, 51, 24, 24, 24, 24,
|
||||||
|
1, 32, 29, 90, 25, 23, 50, 2, 32, 29, 24, 90, 28, 29, 24, 24,
|
||||||
|
51, 50, 32, 29, 50, 51, 90, 24, 25, 45, 46, 29, 25, 23, 24, 90,
|
||||||
|
24, 24, 50, 32, 46, 29, 24, 28, 10, 2, 2, 51, 50, 51, 24, 90,
|
||||||
|
24, 24, 24, 50, 2, 32, 46, 10, 32, 29, 24, 90, 24, 24, 24, 90,
|
||||||
|
29, 24, 89, 24, 24, 50, 3, 23, 50, 32, 46, 46, 46, 46, 29, 24,
|
||||||
|
51, 24, 24, 28, 29, 24, 25, 23, 24, 25, 1, 2, 3, 111, 45, 29,
|
||||||
|
24, 90, 24, 50, 51, 24, 25, 23, 28, 47, 23, 89, 50, 3, 115, 23,
|
||||||
|
24, 24, 24, 24, 24, 89, 50, 32, 47, 1, 51, 24, 24, 50, 2, 51,
|
||||||
|
28, 29, 24, 24, 24, 24, 28, 10, 2, 51, 24, 24, 24, 24, 24, 28,
|
||||||
|
10, 32, 29, 24, 24, 24, 25, 23, 28, 29, 90, 24, 24, 90, 24, 50,
|
||||||
|
32, 10, 51, 24, 24, 24, 50, 32, 10, 32, 29, 24, 90, 28, 29, 24],
|
||||||
|
"height":16,
|
||||||
|
"width":16,
|
||||||
|
"x":-16,
|
||||||
|
"y":-16
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":[10, 51, 24, 90, 24, 25, 23, 28, 29, 24, 24, 24, 24, 24, 24, 24,
|
||||||
|
51, 24, 28, 29, 24, 50, 32, 10, 51, 24, 24, 24, 24, 24, 24, 24,
|
||||||
|
29, 28, 10, 32, 46, 29, 50, 32, 29, 24, 24, 24, 24, 24, 24, 24,
|
||||||
|
51, 25, 23, 50, 2, 32, 29, 25, 23, 24, 24, 28, 29, 24, 90, 24,
|
||||||
|
24, 25, 23, 24, 24, 25, 23, 50, 51, 24, 24, 50, 32, 29, 24, 90,
|
||||||
|
24, 50, 32, 29, 90, 25, 45, 29, 24, 24, 24, 24, 50, 51, 24, 89,
|
||||||
|
24, 89, 50, 51, 24, 25, 114, 23, 24, 24, 24, 24, 24, 24, 24, 24,
|
||||||
|
24, 24, 28, 29, 24, 50, 2, 51, 24, 24, 90, 28, 29, 24, 24, 28,
|
||||||
|
24, 24, 25, 23, 89, 24, 24, 24, 28, 46, 29, 25, 23, 24, 24, 50,
|
||||||
|
28, 46, 10, 51, 24, 28, 46, 29, 25, 111, 45, 10, 51, 28, 29, 24,
|
||||||
|
50, 2, 51, 24, 24, 25, 115, 45, 10, 3, 1, 51, 24, 25, 23, 24,
|
||||||
|
24, 24, 24, 24, 24, 50, 2, 2, 32, 10, 51, 24, 90, 25, 23, 24,
|
||||||
|
24, 24, 24, 24, 24, 24, 24, 24, 50, 51, 24, 24, 24, 25, 23, 24,
|
||||||
|
46, 29, 24, 24, 24, 24, 24, 89, 24, 24, 24, 28, 46, 47, 23, 90,
|
||||||
|
2, 32, 29, 24, 24, 28, 46, 46, 29, 24, 24, 25, 1, 3, 23, 89,
|
||||||
|
24, 50, 32, 29, 24, 25, 1, 3, 23, 24, 89, 50, 32, 10, 51, 24],
|
||||||
|
"height":16,
|
||||||
|
"width":16,
|
||||||
|
"x":0,
|
||||||
|
"y":-16
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":[24, 24, 24, 24, 90, 24, 89, 24, 89, 24, 50, 51, 89, 24, 24, 24,
|
||||||
|
24, 28, 29, 28, 29, 24, 24, 24, 24, 28, 29, 24, 24, 24, 28, 29,
|
||||||
|
24, 25, 23, 50, 51, 24, 24, 28, 29, 50, 51, 24, 24, 24, 25, 45,
|
||||||
|
90, 50, 51, 28, 29, 24, 24, 25, 23, 24, 24, 28, 29, 24, 50, 3,
|
||||||
|
24, 24, 28, 10, 51, 90, 90, 50, 51, 24, 24, 50, 51, 24, 24, 50,
|
||||||
|
24, 24, 25, 45, 29, 24, 28, 29, 24, 24, 24, 24, 24, 28, 29, 24,
|
||||||
|
90, 24, 50, 2, 51, 28, 10, 51, 90, 24, 28, 29, 24, 25, 45, 46,
|
||||||
|
29, 90, 24, 24, 24, 50, 51, 24, 24, 28, 10, 32, 46, 10, 3, 1,
|
||||||
|
32, 29, 24, 90, 24, 24, 24, 24, 28, 47, 23, 50, 2, 51, 50, 51,
|
||||||
|
25, 23, 24, 24, 28, 46, 46, 46, 47, 114, 45, 29, 24, 24, 24, 24,
|
||||||
|
50, 32, 29, 24, 50, 3, 111, 111, 115, 111, 1, 32, 29, 24, 24, 24,
|
||||||
|
24, 50, 51, 24, 28, 10, 2, 2, 2, 2, 32, 10, 51, 24, 24, 89,
|
||||||
|
24, 24, 89, 90, 25, 23, 24, 24, 24, 24, 50, 32, 46, 46, 29, 89,
|
||||||
|
24, 24, 24, 90, 25, 23, 89, 24, 28, 29, 90, 50, 2, 2, 51, 24,
|
||||||
|
24, 24, 24, 28, 10, 51, 24, 28, 47, 45, 29, 24, 24, 24, 24, 24,
|
||||||
|
24, 24, 24, 25, 23, 24, 90, 50, 2, 2, 32, 46, 46, 46, 46, 46],
|
||||||
|
"height":16,
|
||||||
|
"width":16,
|
||||||
|
"x":16,
|
||||||
|
"y":-16
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":[10, 32, 46, 29, 24, 24, 24, 25, 23, 50, 32, 29, 24, 50, 32, 46,
|
||||||
|
51, 50, 2, 32, 29, 24, 24, 25, 45, 29, 25, 23, 24, 24, 25, 1,
|
||||||
|
24, 24, 24, 25, 23, 28, 46, 10, 2, 51, 50, 51, 24, 24, 50, 51,
|
||||||
|
90, 89, 90, 50, 51, 50, 2, 51, 24, 24, 28, 29, 90, 24, 24, 24,
|
||||||
|
90, 28, 46, 29, 90, 24, 24, 24, 90, 24, 50, 51, 90, 24, 90, 28,
|
||||||
|
29, 50, 2, 51, 24, 24, 24, 89, 24, 24, 24, 24, 24, 89, 24, 50,
|
||||||
|
23, 24, 24, 28, 46, 29, 90, 90, 24, 89, 24, 28, 29, 24, 24, 24,
|
||||||
|
32, 46, 29, 25, 115, 45, 29, 24, 90, 24, 24, 25, 23, 24, 24, 28,
|
||||||
|
10, 2, 32, 47, 115, 1, 51, 24, 24, 24, 24, 25, 23, 24, 28, 10,
|
||||||
|
32, 29, 50, 2, 2, 51, 24, 24, 24, 24, 24, 25, 23, 28, 10, 51,
|
||||||
|
50, 51, 89, 24, 24, 89, 24, 28, 29, 24, 24, 50, 32, 10, 32, 46,
|
||||||
|
24, 24, 90, 90, 28, 46, 29, 50, 51, 24, 24, 24, 25, 23, 25, 115,
|
||||||
|
24, 90, 24, 24, 50, 2, 32, 29, 24, 24, 90, 24, 25, 45, 10, 2,
|
||||||
|
24, 24, 24, 24, 24, 24, 50, 32, 29, 24, 24, 28, 10, 3, 23, 24,
|
||||||
|
90, 24, 24, 24, 24, 89, 90, 50, 32, 29, 90, 50, 51, 50, 32, 46,
|
||||||
|
46, 29, 24, 90, 24, 24, 24, 24, 50, 51, 28, 29, 24, 24, 50, 2],
|
||||||
|
"height":16,
|
||||||
|
"width":16,
|
||||||
|
"x":-16,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":[46, 46, 10, 32, 46, 47, 23, 25, 23, 89, 24, 24, 25, 23, 90, 24,
|
||||||
|
2, 2, 32, 47, 1, 2, 51, 25, 23, 24, 28, 29, 50, 32, 29, 24,
|
||||||
|
24, 90, 50, 3, 23, 24, 28, 10, 51, 28, 47, 45, 29, 25, 23, 28,
|
||||||
|
24, 24, 24, 50, 51, 28, 47, 23, 24, 50, 3, 114, 45, 10, 51, 50,
|
||||||
|
29, 24, 24, 89, 24, 25, 114, 45, 46, 46, 10, 2, 2, 32, 29, 89,
|
||||||
|
51, 24, 24, 24, 24, 50, 3, 111, 115, 115, 23, 24, 24, 50, 32, 29,
|
||||||
|
24, 28, 29, 24, 24, 24, 25, 1, 2, 2, 51, 90, 24, 90, 50, 51,
|
||||||
|
29, 50, 32, 29, 28, 29, 25, 23, 24, 24, 89, 28, 29, 24, 24, 24,
|
||||||
|
51, 24, 50, 51, 50, 32, 10, 32, 46, 29, 24, 50, 51, 24, 90, 24,
|
||||||
|
24, 24, 24, 24, 89, 50, 32, 10, 2, 32, 46, 29, 89, 28, 29, 24,
|
||||||
|
29, 90, 24, 24, 24, 24, 50, 51, 28, 10, 3, 23, 28, 10, 51, 24,
|
||||||
|
23, 89, 24, 24, 90, 24, 24, 24, 50, 32, 10, 51, 50, 51, 24, 24,
|
||||||
|
51, 24, 24, 24, 24, 24, 24, 24, 24, 50, 32, 46, 46, 29, 28, 46,
|
||||||
|
24, 24, 24, 90, 24, 24, 24, 24, 24, 24, 50, 3, 1, 32, 47, 115,
|
||||||
|
46, 29, 24, 89, 24, 24, 24, 89, 24, 24, 24, 25, 45, 10, 3, 111,
|
||||||
|
2, 51, 28, 29, 28, 29, 24, 28, 46, 46, 46, 10, 2, 51, 50, 2],
|
||||||
|
"height":16,
|
||||||
|
"width":16,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data":[28, 29, 28, 10, 32, 46, 29, 24, 24, 28, 10, 2, 2, 2, 2, 2,
|
||||||
|
50, 51, 50, 51, 25, 115, 45, 46, 29, 50, 51, 24, 24, 24, 24, 24,
|
||||||
|
29, 24, 89, 24, 50, 3, 115, 114, 23, 24, 24, 24, 24, 24, 24, 24,
|
||||||
|
51, 90, 24, 89, 24, 50, 2, 2, 51, 24, 89, 24, 24, 28, 46, 29,
|
||||||
|
24, 90, 24, 24, 89, 24, 90, 28, 29, 24, 24, 24, 28, 10, 2, 51,
|
||||||
|
24, 24, 24, 24, 28, 29, 90, 50, 51, 28, 29, 24, 25, 23, 24, 24,
|
||||||
|
28, 29, 24, 24, 50, 32, 29, 28, 29, 50, 51, 89, 50, 32, 29, 24,
|
||||||
|
50, 51, 24, 24, 24, 50, 32, 10, 51, 24, 89, 24, 24, 25, 23, 24,
|
||||||
|
24, 24, 24, 24, 24, 24, 50, 32, 29, 24, 24, 24, 24, 50, 51, 24,
|
||||||
|
90, 24, 24, 24, 24, 24, 24, 25, 45, 29, 24, 24, 24, 89, 28, 29,
|
||||||
|
24, 24, 24, 24, 28, 29, 24, 25, 1, 51, 24, 24, 24, 24, 50, 32,
|
||||||
|
28, 29, 28, 29, 50, 32, 46, 10, 51, 28, 29, 24, 24, 24, 24, 50,
|
||||||
|
47, 45, 10, 51, 24, 50, 2, 32, 46, 47, 23, 24, 89, 90, 24, 24,
|
||||||
|
111, 115, 23, 24, 24, 90, 24, 50, 2, 2, 32, 29, 24, 89, 28, 46,
|
||||||
|
1, 2, 51, 28, 46, 46, 29, 24, 28, 29, 50, 32, 29, 28, 47, 111,
|
||||||
|
51, 24, 24, 50, 3, 114, 23, 24, 50, 32, 46, 47, 23, 25, 111, 111],
|
||||||
|
"height":16,
|
||||||
|
"width":16,
|
||||||
|
"x":16,
|
||||||
|
"y":0
|
||||||
|
}],
|
||||||
|
"class":"Tile",
|
||||||
|
"height":48,
|
||||||
|
"id":1,
|
||||||
|
"name":"\u0421\u043b\u043e\u0439 \u0442\u0430\u0439\u043b\u043e\u0432 1",
|
||||||
|
"opacity":1,
|
||||||
|
"startx":-16,
|
||||||
|
"starty":-32,
|
||||||
|
"type":"tilelayer",
|
||||||
|
"visible":true,
|
||||||
|
"width":48,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
}],
|
||||||
|
"nextlayerid":2,
|
||||||
|
"nextobjectid":1,
|
||||||
|
"orientation":"orthogonal",
|
||||||
|
"renderorder":"right-down",
|
||||||
|
"tiledversion":"1.10.2",
|
||||||
|
"tileheight":16,
|
||||||
|
"tilesets":[
|
||||||
|
{
|
||||||
|
"firstgid":1,
|
||||||
|
"source":"..\/TileSets\/TileSet 1.tsj"
|
||||||
|
}],
|
||||||
|
"tilewidth":16,
|
||||||
|
"type":"map",
|
||||||
|
"version":"1.10",
|
||||||
|
"width":30
|
||||||
|
}
|
116
ZoFo/GameCore/GameManagers/MapManager/TileMaps/main.tmx
Normal file
116
ZoFo/GameCore/GameManagers/MapManager/TileMaps/main.tmx
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="16" tileheight="16" infinite="1" nextlayerid="2" nextobjectid="1">
|
||||||
|
<tileset firstgid="1" source="../TileSets/TileSet 1.tsj"/>
|
||||||
|
<layer id="1" name="Слой тайлов 1" width="30" height="20">
|
||||||
|
<data encoding="csv">
|
||||||
|
<chunk x="-16" y="-16" width="16" height="16">
|
||||||
|
24,24,24,28,29,24,24,24,28,46,29,24,25,115,45,46,
|
||||||
|
24,24,24,25,23,24,24,24,50,2,51,24,50,2,2,2,
|
||||||
|
24,24,24,50,32,29,24,24,24,24,24,24,24,24,24,28,
|
||||||
|
28,29,24,28,10,32,29,24,24,28,46,29,24,24,24,50,
|
||||||
|
47,23,24,50,32,10,32,46,29,50,2,51,24,24,24,24,
|
||||||
|
1,32,29,90,25,23,50,2,32,29,24,90,28,29,24,24,
|
||||||
|
51,50,32,29,50,51,90,24,25,45,46,29,25,23,24,90,
|
||||||
|
24,24,50,32,46,29,24,28,10,2,2,51,50,51,24,90,
|
||||||
|
24,24,24,50,2,32,46,10,32,29,24,90,24,24,24,90,
|
||||||
|
29,24,89,24,24,50,3,23,50,32,46,46,46,46,29,24,
|
||||||
|
51,24,24,28,29,24,25,23,24,25,1,2,3,111,45,29,
|
||||||
|
24,90,24,50,51,24,25,23,28,47,23,89,50,3,115,23,
|
||||||
|
24,24,24,24,24,89,50,32,47,1,51,24,24,50,2,51,
|
||||||
|
28,29,24,24,24,24,28,10,2,51,24,24,24,24,24,28,
|
||||||
|
10,32,29,24,24,24,25,23,28,29,90,24,24,90,24,50,
|
||||||
|
32,10,51,24,24,24,50,32,10,32,29,24,90,28,29,24
|
||||||
|
</chunk>
|
||||||
|
<chunk x="0" y="-16" width="16" height="16">
|
||||||
|
10,51,24,90,24,25,23,28,29,24,24,24,24,24,24,24,
|
||||||
|
51,24,28,29,24,50,32,10,51,24,24,24,24,24,24,24,
|
||||||
|
29,28,10,32,46,29,50,32,29,24,24,24,24,24,24,24,
|
||||||
|
51,25,23,50,2,32,29,25,23,24,24,28,29,24,90,24,
|
||||||
|
24,25,23,24,24,25,23,50,51,24,24,50,32,29,24,90,
|
||||||
|
24,50,32,29,90,25,45,29,24,24,24,24,50,51,24,89,
|
||||||
|
24,89,50,51,24,25,114,23,24,24,24,24,24,24,24,24,
|
||||||
|
24,24,28,29,24,50,2,51,24,24,90,28,29,24,24,28,
|
||||||
|
24,24,25,23,89,24,24,24,28,46,29,25,23,24,24,50,
|
||||||
|
28,46,10,51,24,28,46,29,25,111,45,10,51,28,29,24,
|
||||||
|
50,2,51,24,24,25,115,45,10,3,1,51,24,25,23,24,
|
||||||
|
24,24,24,24,24,50,2,2,32,10,51,24,90,25,23,24,
|
||||||
|
24,24,24,24,24,24,24,24,50,51,24,24,24,25,23,24,
|
||||||
|
46,29,24,24,24,24,24,89,24,24,24,28,46,47,23,90,
|
||||||
|
2,32,29,24,24,28,46,46,29,24,24,25,1,3,23,89,
|
||||||
|
24,50,32,29,24,25,1,3,23,24,89,50,32,10,51,24
|
||||||
|
</chunk>
|
||||||
|
<chunk x="16" y="-16" width="16" height="16">
|
||||||
|
24,24,24,24,90,24,89,24,89,24,50,51,89,24,24,24,
|
||||||
|
24,28,29,28,29,24,24,24,24,28,29,24,24,24,28,29,
|
||||||
|
24,25,23,50,51,24,24,28,29,50,51,24,24,24,25,45,
|
||||||
|
90,50,51,28,29,24,24,25,23,24,24,28,29,24,50,3,
|
||||||
|
24,24,28,10,51,90,90,50,51,24,24,50,51,24,24,50,
|
||||||
|
24,24,25,45,29,24,28,29,24,24,24,24,24,28,29,24,
|
||||||
|
90,24,50,2,51,28,10,51,90,24,28,29,24,25,45,46,
|
||||||
|
29,90,24,24,24,50,51,24,24,28,10,32,46,10,3,1,
|
||||||
|
32,29,24,90,24,24,24,24,28,47,23,50,2,51,50,51,
|
||||||
|
25,23,24,24,28,46,46,46,47,114,45,29,24,24,24,24,
|
||||||
|
50,32,29,24,50,3,111,111,115,111,1,32,29,24,24,24,
|
||||||
|
24,50,51,24,28,10,2,2,2,2,32,10,51,24,24,89,
|
||||||
|
24,24,89,90,25,23,24,24,24,24,50,32,46,46,29,89,
|
||||||
|
24,24,24,90,25,23,89,24,28,29,90,50,2,2,51,24,
|
||||||
|
24,24,24,28,10,51,24,28,47,45,29,24,24,24,24,24,
|
||||||
|
24,24,24,25,23,24,90,50,2,2,32,46,46,46,46,46
|
||||||
|
</chunk>
|
||||||
|
<chunk x="-16" y="0" width="16" height="16">
|
||||||
|
10,32,46,29,24,24,24,25,23,50,32,29,24,50,32,46,
|
||||||
|
51,50,2,32,29,24,24,25,45,29,25,23,24,24,25,1,
|
||||||
|
24,24,24,25,23,28,46,10,2,51,50,51,24,24,50,51,
|
||||||
|
90,89,90,50,51,50,2,51,24,24,28,29,90,24,24,24,
|
||||||
|
90,28,46,29,90,24,24,24,90,24,50,51,90,24,90,28,
|
||||||
|
29,50,2,51,24,24,24,89,24,24,24,24,24,89,24,50,
|
||||||
|
23,24,24,28,46,29,90,90,24,89,24,28,29,24,24,24,
|
||||||
|
32,46,29,25,115,45,29,24,90,24,24,25,23,24,24,28,
|
||||||
|
10,2,32,47,115,1,51,24,24,24,24,25,23,24,28,10,
|
||||||
|
32,29,50,2,2,51,24,24,24,24,24,25,23,28,10,51,
|
||||||
|
50,51,89,24,24,89,24,28,29,24,24,50,32,10,32,46,
|
||||||
|
24,24,90,90,28,46,29,50,51,24,24,24,25,23,25,115,
|
||||||
|
24,90,24,24,50,2,32,29,24,24,90,24,25,45,10,2,
|
||||||
|
24,24,24,24,24,24,50,32,29,24,24,28,10,3,23,24,
|
||||||
|
90,24,24,24,24,89,90,50,32,29,90,50,51,50,32,46,
|
||||||
|
46,29,24,90,24,24,24,24,50,51,28,29,24,24,50,2
|
||||||
|
</chunk>
|
||||||
|
<chunk x="0" y="0" width="16" height="16">
|
||||||
|
46,46,10,32,46,47,23,25,23,89,24,24,25,23,90,24,
|
||||||
|
2,2,32,47,1,2,51,25,23,24,28,29,50,32,29,24,
|
||||||
|
24,90,50,3,23,24,28,10,51,28,47,45,29,25,23,28,
|
||||||
|
24,24,24,50,51,28,47,23,24,50,3,114,45,10,51,50,
|
||||||
|
29,24,24,89,24,25,114,45,46,46,10,2,2,32,29,89,
|
||||||
|
51,24,24,24,24,50,3,111,115,115,23,24,24,50,32,29,
|
||||||
|
24,28,29,24,24,24,25,1,2,2,51,90,24,90,50,51,
|
||||||
|
29,50,32,29,28,29,25,23,24,24,89,28,29,24,24,24,
|
||||||
|
51,24,50,51,50,32,10,32,46,29,24,50,51,24,90,24,
|
||||||
|
24,24,24,24,89,50,32,10,2,32,46,29,89,28,29,24,
|
||||||
|
29,90,24,24,24,24,50,51,28,10,3,23,28,10,51,24,
|
||||||
|
23,89,24,24,90,24,24,24,50,32,10,51,50,51,24,24,
|
||||||
|
51,24,24,24,24,24,24,24,24,50,32,46,46,29,28,46,
|
||||||
|
24,24,24,90,24,24,24,24,24,24,50,3,1,32,47,115,
|
||||||
|
46,29,24,89,24,24,24,89,24,24,24,25,45,10,3,111,
|
||||||
|
2,51,28,29,28,29,24,28,46,46,46,10,2,51,50,2
|
||||||
|
</chunk>
|
||||||
|
<chunk x="16" y="0" width="16" height="16">
|
||||||
|
28,29,28,10,32,46,29,24,24,28,10,2,2,2,2,2,
|
||||||
|
50,51,50,51,25,115,45,46,29,50,51,24,24,24,24,24,
|
||||||
|
29,24,89,24,50,3,115,114,23,24,24,24,24,24,24,24,
|
||||||
|
51,90,24,89,24,50,2,2,51,24,89,24,24,28,46,29,
|
||||||
|
24,90,24,24,89,24,90,28,29,24,24,24,28,10,2,51,
|
||||||
|
24,24,24,24,28,29,90,50,51,28,29,24,25,23,24,24,
|
||||||
|
28,29,24,24,50,32,29,28,29,50,51,89,50,32,29,24,
|
||||||
|
50,51,24,24,24,50,32,10,51,24,89,24,24,25,23,24,
|
||||||
|
24,24,24,24,24,24,50,32,29,24,24,24,24,50,51,24,
|
||||||
|
90,24,24,24,24,24,24,25,45,29,24,24,24,89,28,29,
|
||||||
|
24,24,24,24,28,29,24,25,1,51,24,24,24,24,50,32,
|
||||||
|
28,29,28,29,50,32,46,10,51,28,29,24,24,24,24,50,
|
||||||
|
47,45,10,51,24,50,2,32,46,47,23,24,89,90,24,24,
|
||||||
|
111,115,23,24,24,90,24,50,2,2,32,29,24,89,28,46,
|
||||||
|
1,2,51,28,46,46,29,24,28,29,50,32,29,28,47,111,
|
||||||
|
51,24,24,50,3,114,23,24,50,32,46,47,23,25,111,111
|
||||||
|
</chunk>
|
||||||
|
</data>
|
||||||
|
</layer>
|
||||||
|
</map>
|
166
ZoFo/GameCore/GameManagers/MapManager/TileSets/TileSet 1.tsj
Normal file
166
ZoFo/GameCore/GameManagers/MapManager/TileSets/TileSet 1.tsj
Normal file
|
@ -0,0 +1,166 @@
|
||||||
|
{ "class":"Tile",
|
||||||
|
"columns":22,
|
||||||
|
"grid":
|
||||||
|
{
|
||||||
|
"height":24,
|
||||||
|
"orientation":"orthogonal",
|
||||||
|
"width":24
|
||||||
|
},
|
||||||
|
"image":"..\/..\/..\/..\/Content\/Textures\/Background\/TilesetFloor.png",
|
||||||
|
"imageheight":417,
|
||||||
|
"imagewidth":352,
|
||||||
|
"margin":0,
|
||||||
|
"name":"TileSet 1",
|
||||||
|
"spacing":0,
|
||||||
|
"tilecount":572,
|
||||||
|
"tiledversion":"1.10.2",
|
||||||
|
"tileheight":16,
|
||||||
|
"tiles":[
|
||||||
|
{
|
||||||
|
"id":27,
|
||||||
|
"probability":0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":28,
|
||||||
|
"probability":0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":49,
|
||||||
|
"probability":0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":50,
|
||||||
|
"probability":0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":88,
|
||||||
|
"probability":0.100000001490116
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":89,
|
||||||
|
"probability":0.100000001490116
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":110,
|
||||||
|
"probability":2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":111,
|
||||||
|
"probability":0.100000001490116
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":112,
|
||||||
|
"probability":0.100000001490116
|
||||||
|
}],
|
||||||
|
"tilewidth":16,
|
||||||
|
"type":"tileset",
|
||||||
|
"version":"1.10",
|
||||||
|
"wangsets":[
|
||||||
|
{
|
||||||
|
"colors":[
|
||||||
|
{
|
||||||
|
"color":"#ff0000",
|
||||||
|
"name":"Sand",
|
||||||
|
"probability":1,
|
||||||
|
"tile":23
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color":"#00ff00",
|
||||||
|
"name":"SandStone",
|
||||||
|
"probability":0.3,
|
||||||
|
"tile":110
|
||||||
|
}],
|
||||||
|
"name":"\u041f\u0435\u0441\u0447\u0430\u043d\u044b\u0439",
|
||||||
|
"tile":-1,
|
||||||
|
"type":"corner",
|
||||||
|
"wangtiles":[
|
||||||
|
{
|
||||||
|
"tileid":0,
|
||||||
|
"wangid":[0, 2, 0, 1, 0, 2, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":1,
|
||||||
|
"wangid":[0, 2, 0, 1, 0, 1, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":2,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 1, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":9,
|
||||||
|
"wangid":[0, 2, 0, 1, 0, 2, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":22,
|
||||||
|
"wangid":[0, 1, 0, 1, 0, 2, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":23,
|
||||||
|
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":24,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 1, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":27,
|
||||||
|
"wangid":[0, 1, 0, 2, 0, 1, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":28,
|
||||||
|
"wangid":[0, 1, 0, 1, 0, 2, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":31,
|
||||||
|
"wangid":[0, 1, 0, 2, 0, 1, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":44,
|
||||||
|
"wangid":[0, 1, 0, 2, 0, 2, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":45,
|
||||||
|
"wangid":[0, 1, 0, 2, 0, 2, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":46,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 2, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":49,
|
||||||
|
"wangid":[0, 2, 0, 1, 0, 1, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":50,
|
||||||
|
"wangid":[0, 1, 0, 1, 0, 1, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":88,
|
||||||
|
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":89,
|
||||||
|
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":110,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":111,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":112,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":113,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tileid":114,
|
||||||
|
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
}
|
|
@ -17,8 +17,10 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates
|
||||||
[JsonDerivedType(typeof(UpdateLoot))]
|
[JsonDerivedType(typeof(UpdateLoot))]
|
||||||
[JsonDerivedType(typeof(UpdatePlayerParametrs))]
|
[JsonDerivedType(typeof(UpdatePlayerParametrs))]
|
||||||
[JsonDerivedType(typeof(UpdatePosition))]
|
[JsonDerivedType(typeof(UpdatePosition))]
|
||||||
|
[JsonDerivedType(typeof(UpdateTileCreated))]
|
||||||
[JsonDerivedType(typeof(UpdateInput))]
|
[JsonDerivedType(typeof(UpdateInput))]
|
||||||
[JsonDerivedType(typeof(UpdatePlayerExit))]
|
[JsonDerivedType(typeof(UpdatePlayerExit))]
|
||||||
|
|
||||||
public interface IUpdateData
|
public interface IUpdateData
|
||||||
{
|
{
|
||||||
public int IdEntity { get; set; } //Id объекта
|
public int IdEntity { get; set; } //Id объекта
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
|
{
|
||||||
|
|
||||||
|
public class UpdateTileCreated : IUpdateData
|
||||||
|
{
|
||||||
|
public int IdEntity { get; set; }
|
||||||
|
public string UpdateType { get; set; }
|
||||||
|
public Texture2D TextureTile { get; set; }
|
||||||
|
public Vector2 Position { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,12 +20,12 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
|
|
||||||
public void LoadSounds() // метод для загрузки звуков из папки
|
public void LoadSounds() // метод для загрузки звуков из папки
|
||||||
{
|
{
|
||||||
var k = Directory.GetFiles("../../..//Content//sounds").Where(x => x.EndsWith("mp3"));
|
var k = Directory.GetFiles("../../..//Content//sounds").Where(x => x.EndsWith("wav"));
|
||||||
|
|
||||||
if (k.Count() > 0)
|
if (k.Count() > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".mp3", "")).ToArray();// папка со звуками там где exe
|
string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".wav", "")).ToArray();// папка со звуками там где exe
|
||||||
foreach (var soundFile in soundFiles)
|
foreach (var soundFile in soundFiles)
|
||||||
{
|
{
|
||||||
Sounds.Add(soundFile, AppManager.Instance.Content.Load<SoundEffect>("sounds//" + soundFile));
|
Sounds.Add(soundFile, AppManager.Instance.Content.Load<SoundEffect>("sounds//" + soundFile));
|
||||||
|
@ -42,7 +42,7 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
public void StartAmbientSound(string soundName) // запустить звук у которого нет позиции
|
public void StartAmbientSound(string soundName) // запустить звук у которого нет позиции
|
||||||
{
|
{
|
||||||
var sound = new Sound(Sounds[soundName].CreateInstance(), Vector2.One, true);
|
var sound = new Sound(Sounds[soundName].CreateInstance(), Vector2.One, true);
|
||||||
// ждать пока настройки появятся sound.SoundEffect.Volume = sound.baseVolume * AppManager.Instance.SettingsManager.MusicVolume * AppManager.Instance.SettingsManager.MainVolume;
|
sound.SoundEffect.Volume = sound.baseVolume * AppManager.Instance.SettingsManager.MusicVolume * AppManager.Instance.SettingsManager.MainVolume;
|
||||||
sound.SoundEffect.IsLooped = false;
|
sound.SoundEffect.IsLooped = false;
|
||||||
|
|
||||||
sound.SoundEffect.Play();
|
sound.SoundEffect.Play();
|
||||||
|
@ -57,7 +57,7 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
{
|
{
|
||||||
var sound = new Sound(Sounds[soundName].CreateInstance(), soundPos, false) { baseVolume = baseVolume, basePich = pitch };
|
var sound = new Sound(Sounds[soundName].CreateInstance(), soundPos, false) { baseVolume = baseVolume, basePich = pitch };
|
||||||
sound.SoundEffect.IsLooped = false;
|
sound.SoundEffect.IsLooped = false;
|
||||||
//ждать пока настройки появятся sound.SoundEffect.Volume = sound.baseVolume * AppManager.Instance.SettingsManager.SoundEffectsVolume * AppManager.Instance.SettingsManager.MainVolume;
|
sound.SoundEffect.Volume = sound.baseVolume * AppManager.Instance.SettingsManager.SoundEffectsVolume * AppManager.Instance.SettingsManager.MainVolume;
|
||||||
sound.SoundEffect.Pitch = pitch;
|
sound.SoundEffect.Pitch = pitch;
|
||||||
sound.SoundEffect.Play();
|
sound.SoundEffect.Play();
|
||||||
PlayingSounds.Add(sound);
|
PlayingSounds.Add(sound);
|
||||||
|
@ -78,7 +78,7 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
{
|
{
|
||||||
for (int i = 0; i < PlayingSounds.Count; i++)
|
for (int i = 0; i < PlayingSounds.Count; i++)
|
||||||
{
|
{
|
||||||
//PlayingSounds[i].UpdateVolume(Vector2.Zero);
|
PlayingSounds[i].UpdateVolume(Vector2.Zero);
|
||||||
if (PlayingSounds[i].SoundEffect.State == SoundState.Stopped)
|
if (PlayingSounds[i].SoundEffect.State == SoundState.Stopped)
|
||||||
{
|
{
|
||||||
PlayingSounds.Remove(PlayingSounds[i]);
|
PlayingSounds.Remove(PlayingSounds[i]);
|
||||||
|
@ -114,14 +114,14 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
SoundEffect = soundEffect;
|
SoundEffect = soundEffect;
|
||||||
Position = position;
|
Position = position;
|
||||||
}
|
}
|
||||||
/*/public void UpdateVolume(Vector2 playerPos)
|
public void UpdateVolume(Vector2 playerPos)
|
||||||
{
|
{
|
||||||
if (isAmbient)
|
if (isAmbient)
|
||||||
SoundEffect.Volume = baseVolume * AppManager.Instance.SettingsManager.MusicVolume * AppManager.Instance.SettingsManager.MainVolume;
|
SoundEffect.Volume = baseVolume * AppManager.Instance.SettingsManager.MusicVolume * AppManager.Instance.SettingsManager.MainVolume;
|
||||||
else
|
else
|
||||||
SoundEffect.Volume = baseVolume * AppManager.Instance.SettingsManager.SoundEffectsVolume * AppManager.Instance.SettingsManager.MainVolume;// * (float)Math.Clamp(1 - GetDistanceVol(playerPos),0,1);
|
SoundEffect.Volume = baseVolume * AppManager.Instance.SettingsManager.SoundEffectsVolume * AppManager.Instance.SettingsManager.MainVolume;// * (float)Math.Clamp(1 - GetDistanceVol(playerPos),0,1);
|
||||||
|
|
||||||
}/*/
|
}
|
||||||
|
|
||||||
public double GetDistanceVol(Vector2 playerPos) // получение дистанции до объедка от игрока
|
public double GetDistanceVol(Vector2 playerPos) // получение дистанции до объедка от игрока
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,5 +11,7 @@ public class StopObject : MapObject
|
||||||
|
|
||||||
protected StopObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName) : base(position, size, sourceRectangle, textureName)
|
protected StopObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName) : base(position, size, sourceRectangle, textureName)
|
||||||
{
|
{
|
||||||
|
// TODO: Написать коллизию, пусть тразмер будет чисто таким же как и текстурка.
|
||||||
|
// Поменяйте уровень защиты конструктора, после снимите в MapManager комментарий в методе LoadMap с создания StopObject-а
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.StopObjects;
|
|
||||||
|
|
||||||
public class StopObject
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects;
|
|
||||||
|
|
||||||
public class Tile
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -16,6 +16,7 @@ namespace ZoFo.GameCore
|
||||||
public class Server
|
public class Server
|
||||||
{
|
{
|
||||||
private ServerNetworkManager networkManager;
|
private ServerNetworkManager networkManager;
|
||||||
|
private int ticks = 0;
|
||||||
public Server()
|
public Server()
|
||||||
{
|
{
|
||||||
networkManager = new ServerNetworkManager();
|
networkManager = new ServerNetworkManager();
|
||||||
|
@ -61,12 +62,20 @@ namespace ZoFo.GameCore
|
||||||
private List<Entity> entities; //entity
|
private List<Entity> entities; //entity
|
||||||
public void Update(GameTime gameTime)
|
public void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
foreach (var go in gameObjects)
|
if (ticks == 3) //ОБРАБАТЫВАЕТСЯ 20 РАЗ В СЕКУНДУ
|
||||||
{
|
{
|
||||||
go.UpdateLogic(gameTime);
|
foreach (var go in gameObjects)
|
||||||
|
{
|
||||||
|
go.UpdateLogic(gameTime);
|
||||||
|
}
|
||||||
|
ticks = 0;
|
||||||
|
networkManager.SendData();
|
||||||
}
|
}
|
||||||
|
ticks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Регистрирует игровой объект
|
/// Регистрирует игровой объект
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<ProjectReference Include="..\MonogameLibrary\MonogameLibrary.csproj" />
|
<ProjectReference Include="..\MonogameLibrary\MonogameLibrary.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Folder Include="Content\sounds\Zombie\" />
|
||||||
<Folder Include="Content\Textures\GUI\" />
|
<Folder Include="Content\Textures\GUI\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
|
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
|
||||||
|
|
Loading…
Add table
Reference in a new issue