animations added
This commit is contained in:
parent
8dcfe82d2c
commit
94fc3d1858
11 changed files with 65 additions and 14 deletions
|
@ -251,12 +251,21 @@
|
|||
#begin Textures/Animations/player_top_mining.animation
|
||||
/copy:Textures/Animations/player_top_mining.animation
|
||||
|
||||
#begin Textures/Animations/Player/player_granade.animation
|
||||
/copy:Textures/Animations/Player/player_granade.animation
|
||||
|
||||
#begin Textures/Animations/Player/player_idle.animation
|
||||
/copy:Textures/Animations/Player/player_idle.animation
|
||||
|
||||
#begin Textures/Animations/Player/player_running.animation
|
||||
/copy:Textures/Animations/Player/player_running.animation
|
||||
|
||||
#begin Textures/Animations/Player/player_shoot_1.animation
|
||||
/copy:Textures/Animations/Player/player_shoot_1.animation
|
||||
|
||||
#begin Textures/Animations/Player/player_shoot_2.animation
|
||||
/copy:Textures/Animations/Player/player_shoot_2.animation
|
||||
|
||||
#begin Textures/Animations/running_top.animation
|
||||
/copy:Textures/Animations/running_top.animation
|
||||
|
||||
|
@ -374,6 +383,18 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/AnimationTextures/Character/hr-level1_running.png
|
||||
|
||||
#begin Textures/AnimationTextures/Player/Grenade.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/Player/Grenade.png
|
||||
|
||||
#begin Textures/AnimationTextures/Player/Idle.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -410,6 +431,30 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/AnimationTextures/Player/Run.png
|
||||
|
||||
#begin Textures/AnimationTextures/Player/Shot_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/Player/Shot_1.png
|
||||
|
||||
#begin Textures/AnimationTextures/Player/Shot_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/Player/Shot_2.png
|
||||
|
||||
#begin Textures/AnimationTextures/unicorn.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
|
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Dead.png
Normal file
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Dead.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Grenade.png
Normal file
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Grenade.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Shot_1.png
Normal file
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Shot_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Shot_2.png
Normal file
BIN
ZoFo/Content/Textures/AnimationTextures/Player/Shot_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -0,0 +1 @@
|
|||
{"id":"player_die","textureName":"Textures/AnimationTextures/Player/Dead","startSpriteRectangle":{"X":0,"Y":0,"Width":128,"Height":128},"frameSecond":[{"Item1":0,"Item2":3}],"textureFrameInterval":0,"framesCount":4,"isCycle":true,"offset":"0, 0"}
|
|
@ -0,0 +1 @@
|
|||
{"id":"player_granade","textureName":"Textures/AnimationTextures/Player/Grenade","startSpriteRectangle":{"X":0,"Y":0,"Width":128,"Height":128},"frameSecond":[{"Item1":0,"Item2":2}],"textureFrameInterval":0,"framesCount":9,"isCycle":false,"offset":"0, 0"}
|
|
@ -0,0 +1 @@
|
|||
{"id":"player_shoot_1","textureName":"Textures/AnimationTextures/Player/Shot_1","startSpriteRectangle":{"X":0,"Y":0,"Width":128,"Height":128},"frameSecond":[{"Item1":0,"Item2":1}],"textureFrameInterval":0,"framesCount":4,"isCycle":true,"offset":"0, 0"}
|
|
@ -0,0 +1 @@
|
|||
{"id":"player_shoot_2","textureName":"Textures/AnimationTextures/Player/Shot_2","startSpriteRectangle":{"X":0,"Y":0,"Width":128,"Height":128},"frameSecond":[{"Item1":0,"Item2":1}],"textureFrameInterval":0,"framesCount":4,"isCycle":true,"offset":"0, 0"}
|
|
@ -14,7 +14,7 @@ public class AssetManager
|
|||
{
|
||||
Animations = [ "player_look_down", "player_run_up", "player_run_down", "player_run_right",
|
||||
"player_run_left", "player_run_right_up", "player_run_left_up", "player_run_right_down",
|
||||
"player_run_left_down","player_running","player_idle" ],
|
||||
"player_run_left_down","player_running","player_idle", "player_shoot_1", "player_shoot_2", "player_granade"],//TODO разрешение указывать папку, из которой все анимации подтянуться, чтобы не мучаться с рутинным добавлением
|
||||
IdleAnimation = "player_idle"
|
||||
};
|
||||
}
|
|
@ -56,6 +56,7 @@ public class Player : LivingEntity
|
|||
}
|
||||
|
||||
|
||||
bool isLookingRight;
|
||||
public override void Update()
|
||||
{
|
||||
#region название current текстуры
|
||||
|
@ -73,13 +74,8 @@ public class Player : LivingEntity
|
|||
switch (AppManager.Instance.InputManager.ConvertVector2ToState(InputPlayerRotation))
|
||||
{
|
||||
case ScopeState.Top:
|
||||
if (idName != "player_run_up")
|
||||
StartAnimation("player_run_up");
|
||||
break;
|
||||
case ScopeState.Down:
|
||||
if (idName != "player_run_down")
|
||||
StartAnimation("player_run_down");
|
||||
break;
|
||||
case ScopeState.Down://i hope in draw animation will be rotated in the right way
|
||||
|
||||
case ScopeState.DownRight:
|
||||
case ScopeState.DownLeft:
|
||||
case ScopeState.TopRight:
|
||||
|
@ -90,8 +86,12 @@ public class Player : LivingEntity
|
|||
StartAnimation("player_running");
|
||||
break;
|
||||
case ScopeState.Idle:
|
||||
if (idName != "player_idle")
|
||||
StartAnimation("player_idle");
|
||||
if (idName != "player_shoot_1" && idName != "player_shoot_2" && idName != "player_granade")//TODO rethink
|
||||
{
|
||||
|
||||
if (idName != "player_idle")
|
||||
StartAnimation("player_idle");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (AppManager.Instance.InputManager.ConvertVector2ToState(InputPlayerRotation) != ScopeState.Idle)
|
||||
|
@ -216,12 +216,12 @@ public class Player : LivingEntity
|
|||
{
|
||||
InputPlayerRotation = updateInput.InputMovementDirection.GetVector2();
|
||||
InputWeaponRotation = updateInput.InputAttackDirection.GetVector2();
|
||||
if (InputPlayerRotation.X != 0f || InputPlayerRotation.Y != 0f)
|
||||
{
|
||||
InputPlayerRotation /= (InputPlayerRotation.Length());
|
||||
}
|
||||
if (InputPlayerRotation.X != 0f || InputPlayerRotation.Y != 0f)
|
||||
InputPlayerRotation /= (InputPlayerRotation.Length());
|
||||
DebugHUD.DebugSet("dir", InputPlayerRotation.ToString());
|
||||
DebugHUD.DebugSet("dir2", InputWeaponRotation.ToString());
|
||||
if (InputPlayerRotation.X != 0)
|
||||
isLookingRight = InputPlayerRotation.X > 0;
|
||||
}
|
||||
public void HandleInteract(UpdateInputInteraction updateInputInteraction)
|
||||
{
|
||||
|
@ -252,6 +252,8 @@ public class Player : LivingEntity
|
|||
reloading = 5;
|
||||
IsTryingToShoot = true;
|
||||
|
||||
StartAnimation("player_shoot_1");
|
||||
|
||||
List<Entity> entities = AppManager.Instance.server.collisionManager.GetEntities(GetDamageArea(InputWeaponRotation), this).ToList();
|
||||
entities.AddRange(AppManager.Instance.server.collisionManager.GetEntities(GetDamageArea(InputWeaponRotation, 2), this).ToList());
|
||||
entities.AddRange(AppManager.Instance.server.collisionManager.GetEntities(GetDamageArea(InputWeaponRotation, 3), this).ToList());
|
||||
|
|
Loading…
Add table
Reference in a new issue