blob: e8c24c45c5bf33630724f9db7bf7a823d12e7ae9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
using Microsoft.Xna.Framework;
namespace V3.Objects.Movement
{
public class CountStepsMovement : PlayerMovement
{
public float WalkedPixels { get; private set; }
public override Vector2 GiveNewPosition(Vector2 currentPosition, int speed)
{
var movedDistance = base.GiveNewPosition(currentPosition, speed);
WalkedPixels += Vector2.Distance(currentPosition, currentPosition + movedDistance);
return movedDistance;
}
}
}
|