commit for merge fich for create StartCycledAnimation at AnimatedGraficsComponent

This commit is contained in:
Lev 2024-08-20 03:57:05 +03:00
parent a4e877668b
commit 6b55b595c5
11 changed files with 116 additions and 84 deletions

View file

@ -134,57 +134,84 @@
#begin Textures/Animations/player_left_idle.animation #begin Textures/Animations/player_left_idle.animation
/copy: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 #begin Textures/Animations/player_look_down_weapon.animation
/copy:Textures/Animations/player_look_down_weapon.animation /copy:Textures/Animations/player_look_down_weapon.animation
#begin Textures/Animations/player_look_left.animation #begin Textures/Animations/player_look_down.animation
/copy:Textures/Animations/player_look_left.animation /copy:Textures/Animations/player_look_down.animation
#begin Textures/Animations/player_look_left_down.animation
/copy:Textures/Animations/player_look_left_down.animation
#begin Textures/Animations/player_look_left_down_weapon.animation #begin Textures/Animations/player_look_left_down_weapon.animation
/copy: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 #begin Textures/Animations/player_look_left_down.animation
/copy:Textures/Animations/player_look_left_up.animation /copy:Textures/Animations/player_look_left_down.animation
#begin Textures/Animations/player_look_left_up_weapon.animation #begin Textures/Animations/player_look_left_up_weapon.animation
/copy: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 #begin Textures/Animations/player_look_left_weapon.animation
/copy:Textures/Animations/player_look_left_weapon.animation /copy:Textures/Animations/player_look_left_weapon.animation
#begin Textures/Animations/player_look_right.animation #begin Textures/Animations/player_look_left.animation
/copy:Textures/Animations/player_look_right.animation /copy:Textures/Animations/player_look_left.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 #begin Textures/Animations/player_look_right_down_weapon.animation
/copy: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 #begin Textures/Animations/player_look_right_down.animation
/copy:Textures/Animations/player_look_right_up.animation /copy:Textures/Animations/player_look_right_down.animation
#begin Textures/Animations/player_look_right_up_weapon.animation #begin Textures/Animations/player_look_right_up_weapon.animation
/copy: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 #begin Textures/Animations/player_look_right_weapon.animation
/copy:Textures/Animations/player_look_right_weapon.animation /copy:Textures/Animations/player_look_right_weapon.animation
#begin Textures/Animations/player_look_up.animation #begin Textures/Animations/player_look_right.animation
/copy:Textures/Animations/player_look_up.animation /copy:Textures/Animations/player_look_right.animation
#begin Textures/Animations/player_look_up_weapon.animation #begin Textures/Animations/player_look_up_weapon.animation
/copy: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 #begin Textures/Animations/player_right_idle.animation
/copy: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 #begin Textures/Animations/player_running_top_rotate.animation
/copy: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 #begin Textures/Animations/zombie_walk.animation
/copy: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 #begin Textures/AnimationTextures/Character/hr-level1_idle_gun.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -245,6 +260,18 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/AnimationTextures/Character/hr-level1_idle_gun.png /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 #begin Textures/AnimationTextures/Character/hr-level1_mining_tool-1.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -269,18 +296,6 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/AnimationTextures/Character/hr-level1_mining_tool-2.png /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 #begin Textures/AnimationTextures/Character/hr-level1_running_gun.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -293,6 +308,18 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/AnimationTextures/Character/hr-level1_running_gun.png /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 #begin Textures/AnimationTextures/unicorn.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -413,18 +440,6 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/GUI/background/waiting.png /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 #begin Textures/GUI/checkboxs_off-on.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -437,6 +452,18 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/GUI/checkboxs_off-on.png /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 #begin Textures/GUI/checkboxs_on.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -473,18 +500,6 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/GUI/mouse.png /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 #begin Textures/GUI/Switch_backgrownd.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -497,6 +512,18 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:Textures/GUI/Switch_backgrownd.png /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 #begin Textures/icons/12.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor

View file

@ -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"}

View file

@ -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"}

View file

@ -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"}

View file

@ -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"}

View file

@ -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"}

Binary file not shown.

View file

@ -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"}

View file

@ -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"}

View file

@ -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"}

View file

@ -33,8 +33,8 @@ public class Player : LivingEntity
public Player(Vector2 position) : base(position) public Player(Vector2 position) : base(position)
{ {
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30); graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30);
collisionComponent.stopRectangle = new Rectangle(0, 20, 30, 10); collisionComponent.stopRectangle = new Rectangle(0, 15, 30, 15);
speed = 5; speed = 2.5f;
StartAnimation("player_look_down"); StartAnimation("player_look_down");
} }
@ -46,28 +46,29 @@ public class Player : LivingEntity
switch(AppManager.Instance.InputManager.ConvertVector2ToState(InputPlayerRotation)) switch(AppManager.Instance.InputManager.ConvertVector2ToState(InputPlayerRotation))
{ {
case ScopeState.Top: case ScopeState.Top:
//if ((graphicsComponent as AnimatedGraphicsComponent).CurrentAnimation.TextureName!="player_run_up")
//(graphicsComponent as AnimatedGraphicsComponent).Star ("player_run_up");
break; break;
case ScopeState.Down: case ScopeState.Down:
StartAnimation("player_run_down");
break; break;
case ScopeState.Right: case ScopeState.Right:
//StartAnimation("player_running_top_rotate"); StartAnimation("player_run_right");
break; break;
case ScopeState.Left: case ScopeState.Left:
StartAnimation("left");
break; break;
case ScopeState.TopRight: case ScopeState.TopRight:
StartAnimation("player_run_right_up");
break; break;
case ScopeState.TopLeft: case ScopeState.TopLeft:
StartAnimation("player_run_left_up");
break; break;
case ScopeState.DownRight: case ScopeState.DownRight:
StartAnimation("player_run_right_down");
break; break;
case ScopeState.DownLeft: case ScopeState.DownLeft:
StartAnimation("player_run_left_down");
break; break;
} }
#endregion #endregion
@ -95,15 +96,11 @@ public class Player : LivingEntity
rect.Width += 100; rect.Width += 100;
rect.Height += 100; rect.Height += 100;
Entity[] entities = AppManager.Instance.server.collisionManager.GetEntities(rect, this); Entity[] entities = AppManager.Instance.server.collisionManager.GetEntities(rect, this);
if (entities.Length>0) if (entities != null)
{ {
DebugHUD.DebugSet("ent[0]", entities[0].ToString()); foreach (Entity entity in entities)
if (entities != null)
{ {
foreach (Entity entity in entities) AppManager.Instance.server.DeleteObject(entity);
{
AppManager.Instance.server.DeleteObject(entity);
}
} }
} }
} }