From 46274c85c77046156032e00ec61e3d2dd93b9571 Mon Sep 17 00:00:00 2001 From: Kaktus200020 Date: Tue, 20 Aug 2024 19:10:16 +0300 Subject: [PATCH] addExitZone --- ZoFo/Content/Content.mgcb | 174 +++++++++--------- ZoFo/Content/MapData/MapSession.tiled-session | 11 +- .../MapData/Templates/Zones/ExitZone.tj | 12 ++ ZoFo/Content/MapData/TileMaps/main.tmj | 23 ++- .../GameManagers/MapManager/MapManager.cs | 3 +- ZoFo/GameCore/GameObjects/ExitZone.cs | 2 +- 6 files changed, 129 insertions(+), 96 deletions(-) create mode 100644 ZoFo/Content/MapData/Templates/Zones/ExitZone.tj diff --git a/ZoFo/Content/Content.mgcb b/ZoFo/Content/Content.mgcb index cc90965..37d4571 100644 --- a/ZoFo/Content/Content.mgcb +++ b/ZoFo/Content/Content.mgcb @@ -179,68 +179,74 @@ #begin Textures/Animations/player_left_idle.animation /copy:Textures/Animations/player_left_idle.animation -#begin Textures/Animations/player_look_down_weapon.animation -/copy:Textures/Animations/player_look_down_weapon.animation - #begin Textures/Animations/player_look_down.animation /copy:Textures/Animations/player_look_down.animation -#begin Textures/Animations/player_look_left_down_weapon.animation -/copy:Textures/Animations/player_look_left_down_weapon.animation - -#begin Textures/Animations/player_look_left_down.animation -/copy:Textures/Animations/player_look_left_down.animation - -#begin Textures/Animations/player_look_left_up_weapon.animation -/copy:Textures/Animations/player_look_left_up_weapon.animation - -#begin Textures/Animations/player_look_left_up.animation -/copy:Textures/Animations/player_look_left_up.animation - -#begin Textures/Animations/player_look_left_weapon.animation -/copy:Textures/Animations/player_look_left_weapon.animation +#begin Textures/Animations/player_look_down_weapon.animation +/copy:Textures/Animations/player_look_down_weapon.animation #begin Textures/Animations/player_look_left.animation /copy:Textures/Animations/player_look_left.animation -#begin Textures/Animations/player_look_right_down_weapon.animation -/copy:Textures/Animations/player_look_right_down_weapon.animation +#begin Textures/Animations/player_look_left_down.animation +/copy:Textures/Animations/player_look_left_down.animation -#begin Textures/Animations/player_look_right_down.animation -/copy:Textures/Animations/player_look_right_down.animation +#begin Textures/Animations/player_look_left_down_weapon.animation +/copy:Textures/Animations/player_look_left_down_weapon.animation -#begin Textures/Animations/player_look_right_up_weapon.animation -/copy:Textures/Animations/player_look_right_up_weapon.animation +#begin Textures/Animations/player_look_left_up.animation +/copy:Textures/Animations/player_look_left_up.animation -#begin Textures/Animations/player_look_right_up.animation -/copy:Textures/Animations/player_look_right_up.animation +#begin Textures/Animations/player_look_left_up_weapon.animation +/copy:Textures/Animations/player_look_left_up_weapon.animation -#begin Textures/Animations/player_look_right_weapon.animation -/copy:Textures/Animations/player_look_right_weapon.animation +#begin Textures/Animations/player_look_left_weapon.animation +/copy:Textures/Animations/player_look_left_weapon.animation #begin Textures/Animations/player_look_right.animation /copy:Textures/Animations/player_look_right.animation -#begin Textures/Animations/player_look_up_weapon.animation -/copy:Textures/Animations/player_look_up_weapon.animation +#begin Textures/Animations/player_look_right_down.animation +/copy:Textures/Animations/player_look_right_down.animation + +#begin Textures/Animations/player_look_right_down_weapon.animation +/copy:Textures/Animations/player_look_right_down_weapon.animation + +#begin Textures/Animations/player_look_right_up.animation +/copy:Textures/Animations/player_look_right_up.animation + +#begin Textures/Animations/player_look_right_up_weapon.animation +/copy:Textures/Animations/player_look_right_up_weapon.animation + +#begin Textures/Animations/player_look_right_weapon.animation +/copy:Textures/Animations/player_look_right_weapon.animation #begin Textures/Animations/player_look_up.animation /copy:Textures/Animations/player_look_up.animation +#begin Textures/Animations/player_look_up_weapon.animation +/copy:Textures/Animations/player_look_up_weapon.animation + #begin Textures/Animations/player_right_idle.animation /copy:Textures/Animations/player_right_idle.animation #begin Textures/Animations/player_run_down.animation /copy:Textures/Animations/player_run_down.animation +#begin Textures/Animations/player_run_left.animation +/copy:Textures/Animations/player_run_left.animation + #begin Textures/Animations/player_run_left_down.animation /copy:Textures/Animations/player_run_left_down.animation #begin Textures/Animations/player_run_left_up.animation /copy:Textures/Animations/player_run_left_up.animation -#begin Textures/Animations/player_run_left.animation -/copy:Textures/Animations/player_run_left.animation +#begin Textures/Animations/player_run_right.animation +/copy:Textures/Animations/player_run_right.animation + +#begin Textures/Animations/player_run_right.zip +/copy:Textures/Animations/player_run_right.zip #begin Textures/Animations/player_run_right_down.animation /copy:Textures/Animations/player_run_right_down.animation @@ -248,12 +254,6 @@ #begin Textures/Animations/player_run_right_up.animation /copy:Textures/Animations/player_run_right_up.animation -#begin Textures/Animations/player_run_right.animation -/copy:Textures/Animations/player_run_right.animation - -#begin Textures/Animations/player_run_right.zip -/copy:Textures/Animations/player_run_right.zip - #begin Textures/Animations/player_run_up.animation /copy:Textures/Animations/player_run_up.animation @@ -293,18 +293,6 @@ #begin Textures/Animations/zombie_walk.animation /copy:Textures/Animations/zombie_walk.animation -#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 @@ -317,6 +305,18 @@ /processorParam:TextureFormat=Color /build:Textures/AnimationTextures/Character/hr-level1_idle.png +#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_mining_tool-1.png /importer:TextureImporter /processor:TextureProcessor @@ -341,18 +341,6 @@ /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 @@ -365,6 +353,18 @@ /processorParam:TextureFormat=Color /build:Textures/AnimationTextures/Character/hr-level1_running.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/unicorn.png /importer:TextureImporter /processor:TextureProcessor @@ -508,18 +508,6 @@ /processorParam:MakeSquare=False /processorParam:TextureFormat=Color /build:Textures/GUI/background/waiting.png - -#begin Textures/GUI/checkboxs_off-on.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:Textures/GUI/checkboxs_off-on.png #begin Textures/GUI/Button.png /importer:TextureImporter @@ -557,7 +545,7 @@ /processorParam:TextureFormat=Color /build:Textures/GUI/checkboxs_off.png -#begin Textures/GUI/checkboxs_off.png +#begin Textures/GUI/checkboxs_off-on.png /importer:TextureImporter /processor:TextureProcessor /processorParam:ColorKeyColor=255,0,255,255 @@ -567,7 +555,7 @@ /processorParam:ResizeToPowerOfTwo=False /processorParam:MakeSquare=False /processorParam:TextureFormat=Color -/build:Textures/GUI/checkboxs_off.png +/build:Textures/GUI/checkboxs_off-on.png #begin Textures/GUI/checkboxs_on.png /importer:TextureImporter @@ -605,18 +593,6 @@ /processorParam:TextureFormat=Color /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 /importer:TextureImporter /processor:TextureProcessor @@ -629,6 +605,18 @@ /processorParam:TextureFormat=Color /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 + #begin Textures/icons/12.png /importer:TextureImporter /processor:TextureProcessor @@ -845,6 +833,18 @@ /processorParam:TextureFormat=Color /build:Textures/icons/ExitZone.png +#begin Textures/icons/ExitZone.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/icons/ExitZone.png + #begin Textures/icons/Material/Fabric.png /importer:TextureImporter /processor:TextureProcessor diff --git a/ZoFo/Content/MapData/MapSession.tiled-session b/ZoFo/Content/MapData/MapSession.tiled-session index 2404776..67d9798 100644 --- a/ZoFo/Content/MapData/MapSession.tiled-session +++ b/ZoFo/Content/MapData/MapSession.tiled-session @@ -1,17 +1,19 @@ { "activeFile": "TileMaps/main.tmj", "expandedProjectPaths": [ + "Templates", + "Templates/Zones", "TileMaps", ".", - "Templates" + "Templates/Enemies" ], "fileStates": { "TileMaps/main.tmj": { - "scale": 0.5, + "scale": 2, "selectedLayer": 1, "viewCenter": { - "x": 1629, - "y": 1025 + "x": -682.5, + "y": 1140.25 } }, "TileSets/IconSet.tsj": { @@ -34,6 +36,7 @@ "scaleInDock": 1 } }, + "last.objectTemplatePath": "C:/Users/artem/source/repos/ZoFo/ZoFo/Content/MapData/Templates/Zones", "openFiles": [ "TileMaps/main.tmj" ], diff --git a/ZoFo/Content/MapData/Templates/Zones/ExitZone.tj b/ZoFo/Content/MapData/Templates/Zones/ExitZone.tj new file mode 100644 index 0000000..fbca8d4 --- /dev/null +++ b/ZoFo/Content/MapData/Templates/Zones/ExitZone.tj @@ -0,0 +1,12 @@ +{ "object": + { + "height":124, + "id":218, + "name":"Exit", + "rotation":0, + "type":"", + "visible":true, + "width":74 + }, + "type":"template" +} \ No newline at end of file diff --git a/ZoFo/Content/MapData/TileMaps/main.tmj b/ZoFo/Content/MapData/TileMaps/main.tmj index 21d6de7..98f2e8b 100644 --- a/ZoFo/Content/MapData/TileMaps/main.tmj +++ b/ZoFo/Content/MapData/TileMaps/main.tmj @@ -2828,7 +2828,7 @@ "y":96 }], "class":"Tile", - "height":176, + "height":128, "id":1, "name":"Tiles", "opacity":1, @@ -2840,6 +2840,23 @@ "x":0, "y":0 }, + { + "draworder":"topdown", + "id":7, + "name":"Zones", + "objects":[ + { + "id":218, + "template":"..\/Templates\/Zones\/ExitZone.tj", + "x":-1053.33333333333, + "y":688 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }, { "chunks":[ { @@ -7254,8 +7271,8 @@ "x":0, "y":0 }], - "nextlayerid":7, - "nextobjectid":218, + "nextlayerid":8, + "nextobjectid":220, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"1.11.0", diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs index 551ed28..42d272b 100644 --- a/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs +++ b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs @@ -21,7 +21,8 @@ namespace ZoFo.GameCore.GameManagers.MapManager private static readonly JsonSerializerOptions _options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; // Задача настроек для JsonSerialize private static readonly Dictionary _classPath = new Dictionary() { { "Collectables", "ZoFo.GameCore.GameObjects." }, - { "Enemies", "ZoFo.GameCore.GameObjects." } + { "Enemies", "ZoFo.GameCore.GameObjects." }, + { "Zones", "ZoFo.GameCore.GameObjects." } }; //private static readonly float _scale = 1.0f; diff --git a/ZoFo/GameCore/GameObjects/ExitZone.cs b/ZoFo/GameCore/GameObjects/ExitZone.cs index 5a12e2c..50dbd98 100644 --- a/ZoFo/GameCore/GameObjects/ExitZone.cs +++ b/ZoFo/GameCore/GameObjects/ExitZone.cs @@ -16,7 +16,7 @@ namespace ZoFo.GameCore.GameObjects { - public override GraphicsComponent graphicsComponent { get; } = new StaticGraphicsComponent("Textures/icons/ExitZone"); + public override GraphicsComponent graphicsComponent { get; } = new StaticGraphicsComponent("Content/Textures/icons/ExitZone"); public ExitZone(Vector2 position) : base(position) { collisionComponent.OnTriggerZone += Exit;