fixed return of camera
This commit is contained in:
parent
5741aef781
commit
050344648d
@ -99,8 +99,10 @@ public class InteractionCell extends Cell {
|
||||
if (!window.getCamera().getCameraBound()) {
|
||||
window.getCamera().returnFreeCamera();
|
||||
}
|
||||
WindowOfFreeMove.setCanPersonMove(true);
|
||||
else {
|
||||
Person.setInEvent(false);
|
||||
WindowOfFreeMove.setCanPersonMove(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -78,12 +78,20 @@ public class Camera {
|
||||
if (coordX != endX || coordY != endY) {
|
||||
int distanceX = endX - startX;
|
||||
int distanceY = endY - startY;
|
||||
if (Math.abs(distanceX) < CELL_SIZE && Math.abs(distanceY) < CELL_SIZE) {
|
||||
isBound = true;
|
||||
isReturning = false;
|
||||
return;
|
||||
}
|
||||
int stepX = distanceX * speed / CELL_SIZE;
|
||||
int stepY = distanceY * speed / CELL_SIZE;
|
||||
canvas.setLocation(coordX + stepX, coordY + stepY);
|
||||
}
|
||||
if (coordX == endX && coordY == endY && isReturning) {
|
||||
isBound = true;
|
||||
isReturning = false;
|
||||
window.setCanPersonMove(true);
|
||||
window.getMapPainter().getActualMap().getPerson().setInEvent(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +113,6 @@ public class Camera {
|
||||
}
|
||||
speed = 1;
|
||||
isReturning = true;
|
||||
isBound = true; //SMTH WRONG, BUT IT WORKS
|
||||
}
|
||||
|
||||
public void setCameraStart() {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Roses are red<br/>violets are blue
|
||||
<cameraFree> -40 0 1
|
||||
<cameraFree> -240 -40 1
|
||||
unexpected "{"<br/>on line 32
|
||||
<end>
|
||||
Loading…
x
Reference in New Issue
Block a user