Merge branch 'Development' into Interactable

This commit is contained in:
Andrey 2024-08-17 10:34:13 +03:00 committed by GitHub
commit 18c2b3f54f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1390 additions and 628 deletions

View file

@ -22,7 +22,8 @@ namespace AnimationsFileCreator
{ {
DialogResult result = Dialog.FileOpen(); DialogResult result = Dialog.FileOpen();
textureName = result.Path.Split('\\').Last(); var temp = result.Path.Split('\\');
textureName = temp[temp.Length-2] + "/"+temp[temp.Length - 1];
textureName = textureName.Split('.')[0]; textureName = textureName.Split('.')[0];
} }
Console.WriteLine("Введите количество кадров анимации: "); Console.WriteLine("Введите количество кадров анимации: ");
@ -60,11 +61,11 @@ namespace AnimationsFileCreator
container.FrameTime = new System.Collections.Generic.List<Tuple<int, int>>(); container.FrameTime = new System.Collections.Generic.List<Tuple<int, int>>();
container.FrameTime.Add(new Tuple<int, int>(0, interval)); container.FrameTime.Add(new Tuple<int, int>(0, interval));
container.StartSpriteRectangle = rectangle; container.StartSpriteRectangle = rectangle;
container.TextureName = textureName; container.TextureName = "Textures/AnimationTextures/"+textureName;
container.TextureFrameInterval = 1; container.TextureFrameInterval = 0;
container.Id = id; container.Id = id;
string json = JsonConvert.SerializeObject(container); string json = JsonConvert.SerializeObject(container);
StreamWriter writer = new StreamWriter("../../../../ZoFo/Content/animations/"+id); StreamWriter writer = new StreamWriter("../../../../ZoFo/Content/Textures/Animations/"+id+ ".animation");
writer.WriteLine(json); writer.WriteLine(json);
writer.Close(); writer.Close();
} }

View file

@ -91,6 +91,90 @@
/processorParam:Quality=Best /processorParam:Quality=Best
/build:sounds/Zombi stoit.wav /build:sounds/Zombi stoit.wav
#begin Textures/AnimationTextures/Character/hr-level1_idle_gun.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/AnimationTextures/Character/hr-level1_idle_gun.png
#begin Textures/AnimationTextures/Character/hr-level1_idle.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/AnimationTextures/Character/hr-level1_idle.png
#begin Textures/AnimationTextures/Character/hr-level1_mining_tool-1.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/AnimationTextures/Character/hr-level1_mining_tool-1.png
#begin Textures/AnimationTextures/Character/hr-level1_mining_tool-2.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/AnimationTextures/Character/hr-level1_mining_tool-2.png
#begin Textures/AnimationTextures/Character/hr-level1_running_gun.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/AnimationTextures/Character/hr-level1_running_gun.png
#begin Textures/AnimationTextures/Character/hr-level1_running.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/AnimationTextures/Character/hr-level1_running.png
#begin Textures/AnimationTextures/unicorn.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/AnimationTextures/unicorn.png
#begin Textures/GUI/background/base.png #begin Textures/GUI/background/base.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -175,18 +259,6 @@
/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/checkboxs_off.png #begin Textures/GUI/checkboxs_off.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -199,6 +271,18 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/GUI/checkboxs_off.png /build:Textures/GUI/checkboxs_off.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/checkboxs_on.png #begin Textures/GUI/checkboxs_on.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -235,18 +319,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
@ -259,7 +331,7 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/GUI/switch.png /build:Textures/GUI/switch.png
#begin Textures/TileSets/TilesetFloor.png #begin Textures/GUI/Switch_backgrownd.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255 /processorParam:ColorKeyColor=255,0,255,255
@ -269,5 +341,17 @@
/processorParam:ResizeToPowerOfTwo=False /processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False /processorParam:MakeSquare=False
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/TileSets/TilesetFloor.png;Textures/TileSets/TileSet 1.png /build:Textures/GUI/Switch_backgrownd.png
#begin Textures/TileSetImages/TilesetFloor.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/TileSetImages/TilesetFloor.png

View file

@ -0,0 +1,14 @@
{
"automappingRulesFile": "",
"commands": [
],
"compatibilityVersion": 1100,
"extensionsPath": "extensions",
"folders": [
"."
],
"properties": [
],
"propertyTypes": [
]
}

View file

@ -0,0 +1,49 @@
{
"Map/SizeTest": {
"height": 4300,
"width": 2
},
"activeFile": "TileSets/TileSet 1.tsj",
"expandedProjectPaths": [
"TileMaps",
".",
"TileSets"
],
"fileStates": {
"TileMaps/TileSets/TileSet 1.tsj": {
"scaleInDock": 1
},
"TileMaps/main.tmj": {
"scale": 1,
"selectedLayer": 0,
"viewCenter": {
"x": 534.5,
"y": 441
}
},
"TileSets/TileSet 1.tsj": {
"scaleInDock": 1,
"scaleInEditor": 3
}
},
"last.externalTilesetPath": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/MapData/TileSets",
"last.imagePath": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/Textures/TileSet",
"map.fixedSize": false,
"map.lastUsedFormat": "json",
"map.tileHeight": 16,
"map.tileWidth": 16,
"openFiles": [
"TileMaps/main.tmj",
"TileSets/TileSet 1.tsj"
],
"project": "MapSession.tiled-project",
"recentFiles": [
"TileMaps/main.tmj",
"TileSets/TileSet 1.tsj"
],
"tileset.lastUsedFormat": "json",
"tileset.tileSize": {
"height": 16,
"width": 16
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,20 +1,22 @@
{ "class":"Tile", { "class":"Tile",
"columns":22, "columns":22,
"fillmode":"preserve-aspect-fit",
"grid": "grid":
{ {
"height":24, "height":24,
"orientation":"orthogonal", "orientation":"orthogonal",
"width":24 "width":24
}, },
"image":"..\/..\/..\/..\/Content\/Textures\/Background\/TilesetFloor.png", "image":"..\/..\/Textures\/TileSet\/TilesetFloor.png",
"imageheight":417, "imageheight":832,
"imagewidth":352, "imagewidth":704,
"margin":0, "margin":0,
"name":"TileSet 1", "name":"TileSet 1",
"objectalignment":"topleft",
"spacing":0, "spacing":0,
"tilecount":572, "tilecount":572,
"tiledversion":"1.10.2", "tiledversion":"1.10.2",
"tileheight":16, "tileheight":32,
"tiles":[ "tiles":[
{ {
"id":27, "id":27,
@ -52,7 +54,7 @@
"id":112, "id":112,
"probability":0.100000001490116 "probability":0.100000001490116
}], }],
"tilewidth":16, "tilewidth":32,
"type":"tileset", "type":"tileset",
"version":"1.10", "version":"1.10",
"wangsets":[ "wangsets":[

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,20 @@
{
"id": "player_idle_top-right_noweapon",
"textureName": "Textures/AnimationTextures/Character/hr-level1_idle",
"startSpriteRectangle": {
"X": 0,
"Y": 116,
"Width": 92,
"Height": 116
},
"frameSecond": [
{
"Item1": 0,
"Item2": 5
}
],
"textureFrameInterval": 0,
"framesCount": 22,
"isCycle": true,
"offset": "0, 0"
}

View file

@ -0,0 +1,20 @@
{
"id": "player_idle_top_noweapon",
"textureName": "Textures/AnimationTextures/Character/hr-level1_idle",
"startSpriteRectangle": {
"X": 0,
"Y": 0,
"Width": 92,
"Height": 116
},
"frameSecond": [
{
"Item1": 0,
"Item2": 5
}
],
"textureFrameInterval": 0,
"framesCount": 22,
"isCycle": true,
"offset": "0, 0"
}

View file

@ -0,0 +1,20 @@
{
"id": "running_top",
"textureName": "unicorn",
"startSpriteRectangle": {
"X": 0,
"Y": 30,
"Width": 30,
"Height": 60
},
"frameSecond": [
{
"Item1": 0,
"Item2": 2
}
],
"textureFrameInterval": 1,
"framesCount": 22,
"isCycle": true,
"offset": "0, 0"
}

View file

@ -0,0 +1 @@
{"id":"testAnimationExample","textureName":"Textures/AnimationTextures/unicorn","startSpriteRectangle":{"X":0,"Y":0,"Width":400,"Height":400},"frameSecond":[{"Item1":0,"Item2":1}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -12,6 +12,8 @@ using ZoFo.GameCore.GameObjects.MapObjects;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameObjects.MapObjects.Tiles; using ZoFo.GameCore.GameObjects.MapObjects.Tiles;
using System.Drawing; using System.Drawing;
using System.Reflection;
using ZoFo.GameCore.GameObjects.Entities;
namespace ZoFo.GameCore namespace ZoFo.GameCore
{ {
@ -45,12 +47,17 @@ namespace ZoFo.GameCore
List<MapObject> mapObjects = new List<MapObject>(); List<MapObject> mapObjects = new List<MapObject>();
List<GameObject> gameObjects = new List<GameObject>();
/// <summary> /// <summary>
/// Клиент должен обнговлять игру анимаций /// Клиент должен обнговлять игру анимаций
/// </summary> /// </summary>
/// <param name="gameTime"></param> /// <param name="gameTime"></param>
internal void Update(GameTime gameTime) internal void Update(GameTime gameTime)
{ {
for (int i = 0; i < gameObjects.Count; i++)
{
gameObjects[i].UpdateAnimations();
}
} }
internal void Draw(SpriteBatch spriteBatch) internal void Draw(SpriteBatch spriteBatch)
{ {
@ -58,6 +65,10 @@ namespace ZoFo.GameCore
{ {
mapObjects[i].Draw(spriteBatch); mapObjects[i].Draw(spriteBatch);
} }
for (int i = 0; i < gameObjects.Count; i++)
{
gameObjects[i].Draw(spriteBatch);
}
} }
internal void GotData(UpdateData update) internal void GotData(UpdateData update)
@ -72,6 +83,22 @@ namespace ZoFo.GameCore
(update as UpdateTileCreated).tileSetName (update as UpdateTileCreated).tileSetName
)); ));
} }
else if (update is UpdateGameObjectCreated)
{
var a = Assembly.GetAssembly(typeof(GameObject));
if ((update as UpdateGameObjectCreated).GameObjectType == "EntittyForAnimationTests")
{
gameObjects.Add(
new EntittyForAnimationTests(new Vector2(100,100))
);
}
//gameObjects.Add( TODO reflection
//Activator.CreateInstance(Type.GetType("ZoFo.GameCore.GameObjects.Entities.EntittyForAnimationTests")
///*(update as UpdateGameObjectCreated).GameObjectType*/, new []{ new Vector2(100, 100) })
//as GameObject
//);
}
} }
} }
} }

View file

@ -81,8 +81,9 @@ namespace ZoFo.GameCore.GameManagers
_spriteBatch = new SpriteBatch(GraphicsDevice); _spriteBatch = new SpriteBatch(GraphicsDevice);
debugHud.LoadContent(); debugHud.LoadContent();
currentGUI.LoadContent(); currentGUI.LoadContent();
animationBuilder = new AnimationBuilder();
animationBuilder.LoadAnimations();
} }

View file

@ -1,6 +1,7 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
@ -18,7 +19,7 @@ namespace ZoFo.GameCore.GameManagers.MapManager
{ {
private static readonly string _templatePath = "Content/MapData/TileMaps/{0}.tmj"; private static readonly string _templatePath = "Content/MapData/TileMaps/{0}.tmj";
private static readonly float _scale = 1.0f; //private static readonly float _scale = 1.0f;
private List<TileSet> _tileSets = new List<TileSet>(); private List<TileSet> _tileSets = new List<TileSet>();
/// <summary> /// <summary>
@ -36,9 +37,9 @@ namespace ZoFo.GameCore.GameManagers.MapManager
// Загрузка TileSet-ов по TileSetInfo // Загрузка 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)
{ {
TileSet tileSet = LoadTileSet("Content/MapData/"+tileSetInfo.Source); TileSet tileSet = LoadTileSet(Path.Combine("Content", "MapData", "TileMaps", tileSetInfo.Source));
tileSet.FirstGid = tileSetInfo.FirstGid; tileSet.FirstGid = tileSetInfo.FirstGid;
tileSets.Add(tileSet); tileSets.Add(tileSet);
} }
@ -51,22 +52,24 @@ namespace ZoFo.GameCore.GameManagers.MapManager
{ {
foreach (var tileSet in tileSets) foreach (var tileSet in tileSets)
{ {
if (tileSet.FirstGid - chunk.Data[i] < 0) if (tileSet.FirstGid - chunk.Data[i] <= 0)
{ {
int number = chunk.Data[i] - tileSet.FirstGid; int number = chunk.Data[i] - tileSet.FirstGid;
int relativeColumn = (number % tileSet.Columns) * tileSet.TileWidth; int relativeColumn = number % tileSet.Columns;
int relativeRow = (number / tileSet.Columns) * tileSet.TileHeight; int relativeRow = number / tileSet.Columns;
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); tileSet.TileWidth, tileSet.TileHeight);
Vector2 position = new Vector2((i % chunk.Width) * tileSet.TileWidth + chunk.X * chunk.Width, (i / chunk.Height)*tileSet.TileHeight + chunk.Y * chunk.Height) ; Vector2 position = new Vector2((i % chunk.Width) * tileSet.TileWidth + chunk.X * tileSet.TileWidth,
(i / chunk.Height) * tileSet.TileHeight + chunk.Y * tileSet.TileHeight) ;
switch (layer.Class) switch (layer.Class)
{ {
case "Tile": case "Tile":
AppManager.Instance.server.RegisterGameObject(new MapObject(position, new Vector2(tileSet.TileWidth * _scale, tileSet.TileHeight * _scale), sourceRectangle, "Textures/TileSets/"+tileSet.Name)); //fix naming AppManager.Instance.server.RegisterGameObject(new MapObject(position, new Vector2(tileSet.TileWidth, tileSet.TileHeight),
sourceRectangle, "Textures/TileSetImages/" + Path.GetFileName(tileSet.Image).Replace(".png", "")));
break; break;
case "StopObject": case "StopObject":
// new StopObject(position, new Vector2(tileSet.TileWidth * _scale, tileSet.TileHeight * _scale), sourceRectangle, tileSet.Name); // new StopObject(position, new Vector2(tileSet.TileWidth * _scale, tileSet.TileHeight * _scale), sourceRectangle, tileSet.Name);

View file

@ -1,167 +0,0 @@
{ "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
}

View file

@ -1,116 +0,0 @@
<?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>

View file

@ -1,166 +0,0 @@
{ "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]
}]
}]
}

View file

@ -12,5 +12,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
public class UpdateGameObjectCreated : UpdateData public class UpdateGameObjectCreated : UpdateData
{ {
public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; } public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; }
public string GameObjectType;
public string GameObjectId;
} }
} }

View file

@ -0,0 +1,24 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoFo.GameCore.ZoFo_graphics;
namespace ZoFo.GameCore.GameObjects.Entities
{
internal class EntittyForAnimationTests : Entity
{
//public override GraphicsComponent graphicsComponent { get; } = new GraphicsComponent(new List<string> { "тут пишите название анимации" }, "сдублируйте " +
public override GraphicsComponent graphicsComponent { get; } = new GraphicsComponent(new List<string> { "player_idle_top-right_noweapon" }, "player_idle_top-right_noweapon");
public EntittyForAnimationTests(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0,50,50);
position = new Vector2(10, 10);
}
}
}

View file

@ -10,7 +10,7 @@ namespace ZoFo.GameCore.GameObjects.Entities
{ {
public abstract class Entity : GameObject public abstract class Entity : GameObject
{ {
public override GraphicsComponent graphicsComponent => null; //public override GraphicsComponent graphicsComponent => null;
public CollisionComponent collisionComponent { get; protected set; } public CollisionComponent collisionComponent { get; protected set; }
public int Id { get; set; } public int Id { get; set; }
protected Entity(Vector2 position) : base(position) protected Entity(Vector2 position) : base(position)

View file

@ -3,11 +3,14 @@ using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.CollisionManager; using ZoFo.GameCore.GameManagers.CollisionManager;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient; using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player; using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
using ZoFo.GameCore.ZoFo_graphics;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables; namespace ZoFo.GameCore.GameObjects.Entities.Interactables;
public class Interactable : Entity public class Interactable : Entity
{ {
public override GraphicsComponent graphicsComponent => throw new System.NotImplementedException();
public Interactable(Vector2 position) : base(position) public Interactable(Vector2 position) : base(position)
{ {
collisionComponent.OnTriggerEnter += (sender, e) => ChangeInteraction(sender, e, true); collisionComponent.OnTriggerEnter += (sender, e) => ChangeInteraction(sender, e, true);

View file

@ -17,6 +17,8 @@ public class LivingEntity : Entity
inputManager = new InputManager(); inputManager = new InputManager();
} }
public override GraphicsComponent graphicsComponent { get; } = null;
#region Server side #region Server side
/*public override void Update() /*public override void Update()
{ {

View file

@ -63,8 +63,10 @@ public abstract class GameObject
/// Для клиента /// Для клиента
/// Обновление, которое вызывается у клиента, для просмотра анимаций /// Обновление, которое вызывается у клиента, для просмотра анимаций
/// </summary> /// </summary>
public virtual void UpdateAnimations(GameTime gameTime) public virtual void UpdateAnimations()
{ {
graphicsComponent.ObjectDrawRectangle.X = (int)position.X; //Move To place where Updates Sets your position
graphicsComponent.ObjectDrawRectangle.Y = (int)position.Y;
PlayAnimation_OnClient(); PlayAnimation_OnClient();
} }

View file

@ -2,6 +2,7 @@
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -29,7 +30,6 @@ namespace ZoFo.GameCore.GameObjects.MapObjects
this.sourceRectangle = sourceRectangle; this.sourceRectangle = sourceRectangle;
graphicsComponent.ObjectDrawRectangle = new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y); graphicsComponent.ObjectDrawRectangle = new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y);
graphicsComponent.BuildComponent(textureName); graphicsComponent.BuildComponent(textureName);
graphicsComponent.LoadContent(); graphicsComponent.LoadContent();
} }

View file

@ -5,6 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Text.Json; using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.MapManager; using ZoFo.GameCore.GameManagers.MapManager;
using ZoFo.GameCore.GameManagers.NetworkManager; using ZoFo.GameCore.GameManagers.NetworkManager;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates; using ZoFo.GameCore.GameManagers.NetworkManager.Updates;
@ -76,6 +77,8 @@ namespace ZoFo.GameCore
gameObjects = new List<GameObject>(); gameObjects = new List<GameObject>();
entities = new List<Entity>(); entities = new List<Entity>();
new MapManager().LoadMap(); new MapManager().LoadMap();
AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(40, 40)));
} }
/// <summary> /// <summary>
@ -121,7 +124,13 @@ namespace ZoFo.GameCore
Size = (gameObject as MapObject).graphicsComponent.ObjectDrawRectangle.Size, Size = (gameObject as MapObject).graphicsComponent.ObjectDrawRectangle.Size,
tileSetName = (gameObject as MapObject).graphicsComponent.mainTextureName tileSetName = (gameObject as MapObject).graphicsComponent.mainTextureName
});//TODO });//TODO
return;
} }
AddData(new UpdateGameObjectCreated()
{ GameObjectType = gameObject.GetType().Name }
);
} }
} }
#endregion #endregion

View file

@ -13,11 +13,12 @@ namespace DangerousD.GameCore.Graphics
public void LoadAnimations() public void LoadAnimations()
{ {
Animations = new List<AnimationContainer>(); Animations = new List<AnimationContainer>();
string[] animationFilesNames = Directory.GetFiles("../../../Content/animations"); string[] animationFilesNames = Directory.GetFiles("../../../Content/Textures/Animations");
StreamReader reader; StreamReader reader;
foreach (var fileName in animationFilesNames) foreach (var fileName in animationFilesNames)
{ {
if (!fileName.EndsWith(".animation")) continue;
reader = new StreamReader(fileName); reader = new StreamReader(fileName);
string json = reader.ReadToEnd(); string json = reader.ReadToEnd();
AnimationContainer animation = JsonConvert.DeserializeObject<AnimationContainer>(json); AnimationContainer animation = JsonConvert.DeserializeObject<AnimationContainer>(json);

View file

@ -15,7 +15,7 @@ namespace ZoFo.GameCore.ZoFo_graphics
public class GraphicsComponent public class GraphicsComponent
{ {
public Rectangle ObjectDrawRectangle { get; set; } public Rectangle ObjectDrawRectangle;
@ -24,7 +24,7 @@ namespace ZoFo.GameCore.ZoFo_graphics
private List<Texture2D> textures; private List<Texture2D> textures;
public List<string> texturesNames; //rethink public and following that errors public List<string> texturesNames; //rethink public and following that errors
private AnimationContainer currentAnimation; private AnimationContainer currentAnimation;
static public int scaling = 5; static public int scaling = 1;
public int parentId; public int parentId;
public bool reverse; public bool reverse;
public AnimationContainer CurrentAnimation public AnimationContainer CurrentAnimation