Package ruscz.game.gameOfProd.Windows
Class Camera
- java.lang.Object
-
- ruscz.game.gameOfProd.Windows.Camera
-
public class Camera extends java.lang.ObjectThis class handles movement of camera, resp movement of canvas
-
-
Field Summary
Fields Modifier and Type Field Description private WindowOfFreeMove.Canvascanvasprivate intcountprivate intendXprivate intendYprivate booleanisBoundprivate booleanisFirstMoveprivate booleanisReturningprivate booleanisStoppedprivate intstartXprivate intstartYprivate doubletimeprivate WindowOfFreeMovewindow
-
Constructor Summary
Constructors Constructor Description Camera(WindowOfFreeMove window, WindowOfFreeMove.Canvas canvas)
-
Method Summary
Modifier and Type Method Description voidboundCamera()Bounds camera back to playerbooleangetCameraBound()booleangetIsFirstMove()voidmoveBoundCamera()Moves camera so that hero is always in the center if possiblevoidmoveCamera()Decides which type of camera movement to usevoidmoveFreeCamera()Moves camera from current position to a designated end pointvoidreturnFreeCamera()Returns camera to the playervoidsetCameraBound(boolean bound)voidsetCameraEnd(int x, int y)voidsetCameraFirstMove(boolean move)voidsetCameraStart()voidsetCameraStopped(boolean stopped)voidsetCameraTime(double time)
-
-
-
Field Detail
-
window
private final WindowOfFreeMove window
-
canvas
private final WindowOfFreeMove.Canvas canvas
-
isBound
private boolean isBound
-
endX
private int endX
-
endY
private int endY
-
time
private double time
-
startX
private int startX
-
startY
private int startY
-
isReturning
private boolean isReturning
-
isStopped
private boolean isStopped
-
count
private int count
-
isFirstMove
private boolean isFirstMove
-
-
Constructor Detail
-
Camera
public Camera(WindowOfFreeMove window, WindowOfFreeMove.Canvas canvas)
-
-
Method Detail
-
moveCamera
public void moveCamera()
Decides which type of camera movement to use
-
moveBoundCamera
public void moveBoundCamera()
Moves camera so that hero is always in the center if possible
-
moveFreeCamera
public void moveFreeCamera()
Moves camera from current position to a designated end point
-
returnFreeCamera
public void returnFreeCamera()
Returns camera to the player
-
boundCamera
public void boundCamera()
Bounds camera back to player
-
setCameraStart
public void setCameraStart()
-
setCameraEnd
public void setCameraEnd(int x, int y)
-
setCameraTime
public void setCameraTime(double time)
-
setCameraBound
public void setCameraBound(boolean bound)
-
getCameraBound
public boolean getCameraBound()
-
setCameraStopped
public void setCameraStopped(boolean stopped)
-
setCameraFirstMove
public void setCameraFirstMove(boolean move)
-
getIsFirstMove
public boolean getIsFirstMove()
-
-