From 6b55b595c51ca36c8de55ff7f6d89b4a04bcab58 Mon Sep 17 00:00:00 2001 From: Lev Date: Tue, 20 Aug 2024 03:57:05 +0300 Subject: [PATCH] commit for merge fich for create StartCycledAnimation at AnimatedGraficsComponent --- ZoFo/Content/Content.mgcb | 161 ++++++++++-------- .../Animations/player_run_down.animation | 1 + .../Animations/player_run_left.animation | 1 + .../Animations/player_run_left_down.animation | 1 + .../Animations/player_run_left_up.animation | 1 + .../Animations/player_run_right.animation | 1 + .../Textures/Animations/player_run_right.zip | Bin 0 -> 2717 bytes .../player_run_right_down.animation | 1 + .../Animations/player_run_right_up.animation | 1 + .../Animations/player_run_up.animation | 1 + .../Entities/LivingEntities/Player/Player.cs | 31 ++-- 11 files changed, 116 insertions(+), 84 deletions(-) create mode 100644 ZoFo/Content/Textures/Animations/player_run_down.animation create mode 100644 ZoFo/Content/Textures/Animations/player_run_left.animation create mode 100644 ZoFo/Content/Textures/Animations/player_run_left_down.animation create mode 100644 ZoFo/Content/Textures/Animations/player_run_left_up.animation create mode 100644 ZoFo/Content/Textures/Animations/player_run_right.animation create mode 100644 ZoFo/Content/Textures/Animations/player_run_right.zip create mode 100644 ZoFo/Content/Textures/Animations/player_run_right_down.animation create mode 100644 ZoFo/Content/Textures/Animations/player_run_right_up.animation create mode 100644 ZoFo/Content/Textures/Animations/player_run_up.animation diff --git a/ZoFo/Content/Content.mgcb b/ZoFo/Content/Content.mgcb index b3a43e3..ee889c5 100644 --- a/ZoFo/Content/Content.mgcb +++ b/ZoFo/Content/Content.mgcb @@ -134,57 +134,84 @@ #begin Textures/Animations/player_left_idle.animation /copy:Textures/Animations/player_left_idle.animation -#begin Textures/Animations/player_look_down.animation -/copy:Textures/Animations/player_look_down.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_left_down.animation -/copy:Textures/Animations/player_look_left_down.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_up.animation -/copy:Textures/Animations/player_look_left_up.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_right.animation -/copy:Textures/Animations/player_look_right.animation - -#begin Textures/Animations/player_look_right_down.animation -/copy:Textures/Animations/player_look_right_down.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_right_up.animation -/copy:Textures/Animations/player_look_right_up.animation +#begin Textures/Animations/player_look_right_down.animation +/copy:Textures/Animations/player_look_right_down.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_up.animation +/copy:Textures/Animations/player_look_right_up.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_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_up.animation +/copy:Textures/Animations/player_look_up.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_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_down.animation +/copy:Textures/Animations/player_run_right_down.animation + +#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 + #begin Textures/Animations/player_running_top_rotate.animation /copy:Textures/Animations/player_running_top_rotate.animation @@ -221,18 +248,6 @@ #begin Textures/Animations/zombie_walk.animation /copy:Textures/Animations/zombie_walk.animation -#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_idle_gun.png /importer:TextureImporter /processor:TextureProcessor @@ -245,6 +260,18 @@ /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 @@ -269,18 +296,6 @@ /processorParam:TextureFormat=Color /build:Textures/AnimationTextures/Character/hr-level1_mining_tool-2.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/Character/hr-level1_running_gun.png /importer:TextureImporter /processor:TextureProcessor @@ -293,6 +308,18 @@ /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 @@ -413,18 +440,6 @@ /processorParam:TextureFormat=Color /build:Textures/GUI/background/waiting.png -#begin Textures/GUI/checkboxs_off.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.png - #begin Textures/GUI/checkboxs_off-on.png /importer:TextureImporter /processor:TextureProcessor @@ -437,6 +452,18 @@ /processorParam:TextureFormat=Color /build:Textures/GUI/checkboxs_off-on.png +#begin Textures/GUI/checkboxs_off.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.png + #begin Textures/GUI/checkboxs_on.png /importer:TextureImporter /processor:TextureProcessor @@ -473,18 +500,6 @@ /processorParam:TextureFormat=Color /build:Textures/GUI/mouse.png -#begin Textures/GUI/switch.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.png - #begin Textures/GUI/Switch_backgrownd.png /importer:TextureImporter /processor:TextureProcessor @@ -497,6 +512,18 @@ /processorParam:TextureFormat=Color /build:Textures/GUI/Switch_backgrownd.png +#begin Textures/GUI/switch.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.png + #begin Textures/icons/12.png /importer:TextureImporter /processor:TextureProcessor diff --git a/ZoFo/Content/Textures/Animations/player_run_down.animation b/ZoFo/Content/Textures/Animations/player_run_down.animation new file mode 100644 index 0000000..6dfae3f --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_down.animation @@ -0,0 +1 @@ +{"id":"player_run_down","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":528,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/player_run_left.animation b/ZoFo/Content/Textures/Animations/player_run_left.animation new file mode 100644 index 0000000..382a37c --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_left.animation @@ -0,0 +1 @@ +{"id":"player_run_left","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":792,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/player_run_left_down.animation b/ZoFo/Content/Textures/Animations/player_run_left_down.animation new file mode 100644 index 0000000..4fc1ba6 --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_left_down.animation @@ -0,0 +1 @@ +{"id":"player_run_left_down","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":660,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/player_run_left_up.animation b/ZoFo/Content/Textures/Animations/player_run_left_up.animation new file mode 100644 index 0000000..2ce06d9 --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_left_up.animation @@ -0,0 +1 @@ +{"id":"player_run_left_up","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":924,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/player_run_right.animation b/ZoFo/Content/Textures/Animations/player_run_right.animation new file mode 100644 index 0000000..f326ea9 --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_right.animation @@ -0,0 +1 @@ +{"id":"player_run_right","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":264,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/player_run_right.zip b/ZoFo/Content/Textures/Animations/player_run_right.zip new file mode 100644 index 0000000000000000000000000000000000000000..ca73be1b07bcd660399a1b7833cb28dfc4b72c8f GIT binary patch literal 2717 zcmaKuc{r47AIHZ`V;fy$OhlF}32~fsEX5ehD~%;h9m`8$vTq|#d{BvK=AJ6Bx?$7=E{(iTW8RUQn2n6B< zC1t|x2#3`QJ^*imTp-X9VD%yE2c!%crE;=Zd#U$9fA-KjYm=G(Z1%Dn2ka7KHU%xNlBWDEM0A}5)( zYUG4s+L*i*)qhOGvFyimFN)R28V{QFhkvP-!G$#@-h6ATc9j34(s6>jPPR60BUbg% z>!WkCVfg-)#>5q&G_W z3|FkRQZyH752&w%pRrQX{D@rQjv%@4D`q^fDPzv5^)~xx@-sfsOq`ahr4Y)Nti;Q~ z$Er7_p2NLXbk10an{TydK?EoTslBDJV_{!Cbnd8#W#Ai)hN{p$P{ZyrG4zeOJigP% zMC9hHRg-L-t1Tt&j_XyzbQZ=t=Cz`Uq~_LPiGX*IG${!sI@9biig|(i?Siiar;gW!vxqY!uyXH|YT^2m>~ba3f%*ZIA zxSec_t)Nr-jYjSHes5Uq=2w<=KCk$$#SQMJ*ebj{K59JciyRA`c}V@BE>_QjqEFov} zsjgQTnpl37-3%7HpLCB*sfkPH7-LqoGkCh%IGE=Iu73N<$oAPQ6C@Q;$o{%NP*jJ zGclVxJwgajA--2dfTz31zI+J8F=86Y-9rWO_9jbZ2i}IwpH?Zn zym;x}-XScvqvy zCs*=Mhj3yme8y2;t@2AJ+f;Z+ko3utg!d9uxPu!NmVN7rgf^aVnyM)QVQ9l@BV5lx z5cDm%bjgyLbo8u#Ot?HfGj%kRUNReo$*<-%R9>8Rkr^q7DlZkL ziMq__#9Uum`cC6IMC%Qsm9|ekuHy zr-Z3uyUXj>soNnb{NY)NA&)}c{8h!YL&FWqL-RAQ=$nqlNrR!$O{act{PWNy+Cmc{ zOYc?B9avz_oqz^7phJ?AjvobNroLDH>iaQy ztNGR##AV}_WXoiHr+mkU!)BDo5KTke%F=JTu)j5IGh*swwX&Z&j|=ubIU>NjjmAa< z$(7D*MH1@VmkZ$fJqsAYgexkPx+rPLRrORIg6^6)ytN|R?MpQ7&pQQ3k1=qr6Aa?$ z)L#6)`L=#LD7Z&HFdFuhC{hJ z_#5JRGOH@_bE98Ud-_-it!Jb)>k*;F+|nu^?_*z zWh05;Q091^sB3M+KXlO>DoV6(_ykkLh-Dtf#92Kp2Cqz!rLD}kz#^a@-yZ-2ATE&1 z&H_9?yiM%JaGJn7AAiR{0k69-d*|_P45tys#=yY)F#ibbZWgBjz-AqR>}Tyh>)j+y z{gX|SKd^`Nk8Zk~!>I$YIm*!eod2^uPWffSbhtUdezZSM5n!VXc=n+7LZHBZcCMkk Np!2}tAbEG*{tKd)Q5OIJ literal 0 HcmV?d00001 diff --git a/ZoFo/Content/Textures/Animations/player_run_right_down.animation b/ZoFo/Content/Textures/Animations/player_run_right_down.animation new file mode 100644 index 0000000..400a15d --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_right_down.animation @@ -0,0 +1 @@ +{"id":"player_run_right_down","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":396,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/player_run_right_up.animation b/ZoFo/Content/Textures/Animations/player_run_right_up.animation new file mode 100644 index 0000000..2470613 --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_right_up.animation @@ -0,0 +1 @@ +{"id":"player_run_right_up","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":132,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/Content/Textures/Animations/player_run_up.animation b/ZoFo/Content/Textures/Animations/player_run_up.animation new file mode 100644 index 0000000..7837205 --- /dev/null +++ b/ZoFo/Content/Textures/Animations/player_run_up.animation @@ -0,0 +1 @@ +{"id":"player_run_up","textureName":"Textures/AnimationTextures/Character/hr-level1_running","startSpriteRectangle":{"X":0,"Y":0,"Width":88,"Height":132},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"} diff --git a/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Player/Player.cs b/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Player/Player.cs index 8c3310a..c76c1bc 100644 --- a/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Player/Player.cs +++ b/ZoFo/GameCore/GameObjects/Entities/LivingEntities/Player/Player.cs @@ -33,8 +33,8 @@ public class Player : LivingEntity public Player(Vector2 position) : base(position) { graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30); - collisionComponent.stopRectangle = new Rectangle(0, 20, 30, 10); - speed = 5; + collisionComponent.stopRectangle = new Rectangle(0, 15, 30, 15); + speed = 2.5f; StartAnimation("player_look_down"); } @@ -46,28 +46,29 @@ public class Player : LivingEntity switch(AppManager.Instance.InputManager.ConvertVector2ToState(InputPlayerRotation)) { case ScopeState.Top: - + //if ((graphicsComponent as AnimatedGraphicsComponent).CurrentAnimation.TextureName!="player_run_up") + //(graphicsComponent as AnimatedGraphicsComponent).Star ("player_run_up"); break; case ScopeState.Down: - + StartAnimation("player_run_down"); break; case ScopeState.Right: - //StartAnimation("player_running_top_rotate"); + StartAnimation("player_run_right"); break; case ScopeState.Left: - + StartAnimation("left"); break; case ScopeState.TopRight: - + StartAnimation("player_run_right_up"); break; case ScopeState.TopLeft: - + StartAnimation("player_run_left_up"); break; case ScopeState.DownRight: - + StartAnimation("player_run_right_down"); break; case ScopeState.DownLeft: - + StartAnimation("player_run_left_down"); break; } #endregion @@ -95,15 +96,11 @@ public class Player : LivingEntity rect.Width += 100; rect.Height += 100; Entity[] entities = AppManager.Instance.server.collisionManager.GetEntities(rect, this); - if (entities.Length>0) + if (entities != null) { - DebugHUD.DebugSet("ent[0]", entities[0].ToString()); - if (entities != null) + foreach (Entity entity in entities) { - foreach (Entity entity in entities) - { - AppManager.Instance.server.DeleteObject(entity); - } + AppManager.Instance.server.DeleteObject(entity); } } }