#include_function ".\lib\common.dnh"

let MoveSpeed = 0;
let MoveAngle = 0;

task ManageMovement {
  loop {
    SetX(GetX+GetWrapSpeedX);
    SetY(GetY+GetWrapSpeedY);
    yield;
  }
}

function SetWrapSpeed(speed){
  MoveSpeed = speed;
}

function SetWrapAngle(angle){
  MoveAngle = angle;
}

function GetWrapSpeed {
  return MoveSpeed;
}

function GetWrapAngle {
  return MoveAngle;
}

function GetWrapSpeedX {
  return cos(MoveAngle)*MoveSpeed;
}

function GetWrapSpeedY {
  return sin(MoveAngle)*MoveSpeed;
}