SimpleNpc constructor
SimpleNpc({
- required Vector2 position,
- required Vector2 size,
- required SimpleDirectionAnimation animation,
- double speed = 100,
- Direction initDirection = Direction.right,
Implementation
SimpleNpc({
required Vector2 position,
required Vector2 size,
required SimpleDirectionAnimation animation,
double speed = 100,
Direction initDirection = Direction.right,
}) : super(
position: position,
size: size,
speed: speed,
) {
this.animation = animation;
lastDirection = initDirection;
lastDirectionHorizontal =
initDirection == Direction.left ? Direction.left : Direction.right;
}