like aoe

hi, its me again, now im trying to do the view move like in the Real Time Strategy games, but just in the x axis
angle = direction(x + width / 2, y + height / 2, Player.x, y + height / 2);
directional_velocity = distance(x + width / 2, y + height / 2, Player.x, y + height / 2) / 25;
xvelocity = (Player.x - (x + width * .5)) / 25;
#define halfwidth 512
#define halfX view.width / 2
#define halfY view.height / 2
Sgt. Sparky wrote:draw actor for view:
- Code: Select all
angle = direction(x + width / 2, y + height / 2, Player.x, y + height / 2);
directional_velocity = distance(x + width / 2, y + height / 2, Player.x, y + height / 2) / 25;
that should work
notice that I do not use Player.y,
that is because you do not want the view to move up and down
if(Able == 1)
{
angle = direction(x + width / 2, y + height / 2, Player.x, y + height / 2);
directional_velocity = distance(x + width / 2, y + height / 2, Player.x, y + height / 2) / 25;
}
Able = 1;