diff --git a/ZoFo/Content/Content.mgcb b/ZoFo/Content/Content.mgcb index 09e9f35..d5784e4 100644 --- a/ZoFo/Content/Content.mgcb +++ b/ZoFo/Content/Content.mgcb @@ -121,54 +121,54 @@ #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 @@ -193,17 +193,20 @@ #begin Textures/Animations/testAnimationExample.animation /copy:Textures/Animations/testAnimationExample.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/Animations/zombie_attack.animation +/copy:Textures/Animations/zombie_attack.animation + +#begin Textures/Animations/zombie_damaged.animation +/copy:Textures/Animations/zombie_damaged.animation + +#begin Textures/Animations/zombie_death.animation +/copy:Textures/Animations/zombie_death.animation + +#begin Textures/Animations/zombie_idle.animation +/copy:Textures/Animations/zombie_idle.animation + +#begin Textures/Animations/zombie_walk.animation +/copy:Textures/Animations/zombie_walk.animation #begin Textures/AnimationTextures/Character/hr-level1_idle.png /importer:TextureImporter @@ -217,6 +220,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 @@ -241,18 +256,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 @@ -265,6 +268,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 @@ -277,6 +292,30 @@ /processorParam:TextureFormat=Color /build:Textures/AnimationTextures/unicorn.png +#begin Textures/AnimationTextures/Zombie/zombie_spritesheet_v1.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/Zombie/zombie_spritesheet_v1.png + +#begin Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.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/Zombie/zombie_spritesheet_v2.png + #begin Textures/GUI/background/base.png /importer:TextureImporter /processor:TextureProcessor @@ -361,18 +400,6 @@ /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/checkboxs_off.png /importer:TextureImporter /processor:TextureProcessor @@ -385,6 +412,18 @@ /processorParam:TextureFormat=Color /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 /importer:TextureImporter /processor:TextureProcessor @@ -421,18 +460,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 @@ -445,6 +472,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 diff --git a/ZoFo/Content/Textures/AnimationTextures/Zombie/zombie_spritesheet_v1.png b/ZoFo/Content/Textures/AnimationTextures/Zombie/zombie_spritesheet_v1.png new file mode 100644 index 0000000..d54b7ba Binary files /dev/null and b/ZoFo/Content/Textures/AnimationTextures/Zombie/zombie_spritesheet_v1.png differ diff --git a/ZoFo/Content/Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.png b/ZoFo/Content/Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.png new file mode 100644 index 0000000..c8ca02c Binary files /dev/null and b/ZoFo/Content/Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.png differ diff --git a/ZoFo/Content/Textures/Animations/zombie_attack.animation b/ZoFo/Content/Textures/Animations/zombie_attack.animation new file mode 100644 index 0000000..b8129db --- /dev/null +++ b/ZoFo/Content/Textures/Animations/zombie_attack.animation @@ -0,0 +1 @@ +{"id":"zombie_attack","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":64,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":3,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/zombie_damaged.animation b/ZoFo/Content/Textures/Animations/zombie_damaged.animation new file mode 100644 index 0000000..6d0609d --- /dev/null +++ b/ZoFo/Content/Textures/Animations/zombie_damaged.animation @@ -0,0 +1 @@ +{"id":"zombie_damaged","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":128,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":1,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/zombie_death.animation b/ZoFo/Content/Textures/Animations/zombie_death.animation new file mode 100644 index 0000000..97aaa9c --- /dev/null +++ b/ZoFo/Content/Textures/Animations/zombie_death.animation @@ -0,0 +1 @@ +{"id":"zombie_death","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":96,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":9,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/zombie_idle.animation b/ZoFo/Content/Textures/Animations/zombie_idle.animation new file mode 100644 index 0000000..b96e1a3 --- /dev/null +++ b/ZoFo/Content/Textures/Animations/zombie_idle.animation @@ -0,0 +1 @@ +{"id":"zombie_idle","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":0,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":60}],"textureFrameInterval":0,"framesCount":2,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/zombie_walk.animation b/ZoFo/Content/Textures/Animations/zombie_walk.animation new file mode 100644 index 0000000..f6dbfa5 --- /dev/null +++ b/ZoFo/Content/Textures/Animations/zombie_walk.animation @@ -0,0 +1 @@ +{"id":"zombie_walk","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":32,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":8,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/GameCore/GameObjects/Entities/EntittyForAnimationTests.cs b/ZoFo/GameCore/GameObjects/Entities/EntittyForAnimationTests.cs index 2bad778..20e779e 100644 --- a/ZoFo/GameCore/GameObjects/Entities/EntittyForAnimationTests.cs +++ b/ZoFo/GameCore/GameObjects/Entities/EntittyForAnimationTests.cs @@ -14,11 +14,11 @@ namespace ZoFo.GameCore.GameObjects.Entities //public override GraphicsComponent graphicsComponent { get; } = new GraphicsComponent(new List { "тут пишите название анимации" }, "сдублируйте " + - public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List { "player_idle_rotate_weapon" }, "player_idle_rotate_weapon"); + public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List { "zombie_idle" }, "zombie_idle"); public EntittyForAnimationTests(Vector2 position) : base(position) { - graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0,16*12, 16 * 16); + graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0,16*20, 16 * 20); position = new Vector2(10, 10); } diff --git a/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Enemies/Zombie.cs b/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Enemies/Zombie.cs index bc504f9..a82a70c 100644 --- a/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Enemies/Zombie.cs +++ b/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Enemies/Zombie.cs @@ -11,12 +11,12 @@ namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies { class Zombie : Enemy { - public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent("Textures/icons/8"); + public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List { "zombie_damaged" }, "zombie_damaged"); public Zombie(Vector2 position) : base(position) { health = 5; speed =2; - collisionComponent.stopRectangle = new Rectangle(0, 0, 100, 100); + collisionComponent.stopRectangle = new Rectangle(0, 0, 52, 100); graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 100, 100); } @@ -26,12 +26,8 @@ namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies AppManager.Instance.server.players[0].position - position ); velocity=new Vector2(duration.X * speed, duration.Y*speed); - if(position.X>595 && 605>position.X && position.Y>495 && 505>position.Y) - { - velocity = Vector2.Zero; - } - //position.X += velocity.X*t; - //position.Y += velocity.Y * t; + + } } }