Hi,
I got a problem with my Scenario "Heroes" and the movement precision combined with a scrolling world.
Im using the ScrollWorld and ScrollActor by SPower and i also use SmoothMover.
SmoothMover extends ScrollActor and ScrollActor extends Actor.
Here my problem:
Im using some movement precision with SmoothMover to make the spells actually fly to where you clicked.
For example my Archer is shooting arrows:
move_x and move_y are the parts the object hast to move to "simulate" this direct "line" to the target in every act().
Those two variables are the parameters for a new Arrow:
In Arrow:
Thats the movement process as it would work in a normal world.
But the problem is Im using a scrolling world, and there i dont want that object to move on the "camera", which is the "real" world, i want it to move on the "whole" world. For example i dont need to use the x and y coordinates, rather the globalX and globalY coordinates, but these are not double^^
Maybe it`s just a problem of reversed subclassing? (maybe ScrollActor should extend SmoothMover?)
The result is that if I shoot an Arrow, everything works. But if I shoot it and move while it is flying, i can influence the movement with the "camera" because the arrow is using the x and y coordinates instead of globalX and globalY :/
I know it`s complex but maybe someone hast the patience to help me :)
Thanks in advance,
Max
x = myinfo.getX();
y = myinfo.getY();
turnTowards(x,y);
angle = Math.atan2(y-getExactY(),x - getExactX());
move_x = Math.cos(angle) * speedArrow;
move_y = Math.sin(angle) * speedArrow;new Arrow(getRotation(), move_x, move_y);
public void movement()
{ setLocation(getExactX()+move_x,getExactY()+move_y);
}
