they call me the UI designer (and i'm being real this time)
This commit is contained in:
parent
d6da52fd69
commit
2ca43ec836
11 changed files with 1192 additions and 298 deletions
|
|
@ -21,12 +21,12 @@ public class Entity : MonoBehaviour
|
|||
|
||||
protected void FlipSprite(Vector2 lookDirection)
|
||||
{
|
||||
if (lookDirection.x < 0f && isFacingRight)
|
||||
if (lookDirection.x > 0f && isFacingRight)
|
||||
{
|
||||
sprite.flipX = true;
|
||||
isFacingRight = !isFacingRight;
|
||||
}
|
||||
else if (lookDirection.x > 0f && !isFacingRight)
|
||||
else if (lookDirection.x < 0f && !isFacingRight)
|
||||
{
|
||||
sprite.flipX = false;
|
||||
isFacingRight = !isFacingRight;
|
||||
|
|
@ -37,6 +37,7 @@ public class Entity : MonoBehaviour
|
|||
if (!stalled)
|
||||
{
|
||||
rb.linearVelocity = moveDirection * speed;
|
||||
FlipSprite(moveDirection);
|
||||
}
|
||||
}
|
||||
public virtual void TakeDamage(float damage, Entity origin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue