Jump to content
  • 0

How to make a player show attack frame while is moving?


Question

Posted

Hi everyone,

 

how to make a player show attack frame while is moving?

 

0cbaae72fb615ef1d44cf32435d027a5.gif

 

Will line changes in Entity.cs do it?

 

Thanks,

Tim

2 answers to this question

Recommended Posts

  • 0
Posted

You can go on the "UpdateSpriteAninmation" method in "Intersect.Client.Entities.Entity" and move the code block related to attacking before the one of moving. Something like the code below should work.

 

if (AttackTimer > Globals.System.GetTimeMs()) //Attacking
{
  ...
}
else if (IsMoving)
{
  ...
}

 

  • 0
Posted

i think you all you have to do is to define:

            public bool IsAttacking

and include that in Client/Entity.cs/UpdateSpriteAnimation() here:

             if (IsMoving && !IsAttacking)

and set IsAttacking to true/false in Client/Player.cs/Update()

×
×
  • Create New...