Hi all it's me gain
How to i get use the view wit not making it parent wit the player
any help on that
thanks
void ViewFollowActor(char*name, int Fx, int Fy, int speed)
{
Actor*actor=getclone(name);
int X=view.width/2;
int Y=view.height/2;
if(x+X<actor->x-speed && actor->xscreen>xscreen+X+Fx)
{
x+=speed;
}
if(x+X>actor->x+speed && actor->xscreen<xscreen+X-Fx)
{
x-=speed;
}
if(y+Y<actor->y-speed && actor->yscreen>xscreen+Y+Fy)
{
y+=actor->yvelocity;
}
if(y+Y>actor->y+speed && actor->yscreen<xscreen+Y-Fy)
{
y-=speed;
}
}
ViewFollowActor("Player", 50, 50, 5);
view.x -= 5; //Change 5 to be same as the speed your main actor runs
view.x +=5;
view.y -= 5;
y += Player.yvelocity;
view.angle=direction(view.x+(view.width/2),view.y+(view.height/2),x,y);
view.directional_velocity=distance(view.x+(view.width/2),view.y+(view.height/2),x,y)/20;
Users browsing this forum: No registered users and 1 guest