@@ -0,0 +1,1528 @@
+/**%0D%0A * SnapGames%0D%0A * %0D%0A * Game Development Java%0D%0A * %0D%0A * GDJ105%0D%0A * %0D%0A * @year 2017%0D%0A */%0D%0Apackage com.snapgames.gdj.core.entity;%0D%0A%0D%0Aimport java.awt.Color;%0D%0Aimport java.awt.Graphics2D;%0D%0A%0D%0Aimport com.snapgames.gdj.core.Game;%0D%0A%0D%0A/**%0D%0A * compute and move the point of view to the Camera coordinates.%0D%0A * %0D%0A * @author Fr%C3%A9d%C3%A9ric Delorme.%0D%0A *%0D%0A */%0D%0Apublic class CameraObject extends AbstractGameObject %7B%0D%0A%0D%0A%09private GameObject target;%0D%0A%09private float tween = 1.0f;%0D%0A%0D%0A%09/**%0D%0A%09 * %0D%0A%09 */%0D%0A%09public CameraObject() %7B%0D%0A%09%09super();%0D%0A%09%09// TODO Auto-generated constructor stub%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * @param name%0D%0A%09 * @param x%0D%0A%09 * @param y%0D%0A%09 * @param width%0D%0A%09 * @param height%0D%0A%09 * @param layer%0D%0A%09 * @param priority%0D%0A%09 * @param color%0D%0A%09 */%0D%0A%09public CameraObject(String name, GameObject target, int tween) %7B%0D%0A%09%09super(name, (int) target.getX(), (int) target.getY(), Game.WIDTH, Game.HEIGHT, -1, -1, Color.BLUE);%0D%0A%09%09this.target = target;%0D%0A%09%09this.tween = tween;%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * @param name%0D%0A%09 * @param x%0D%0A%09 * @param y%0D%0A%09 * @param dx%0D%0A%09 * @param dy%0D%0A%09 */%0D%0A%09public CameraObject(String name, int x, int y, int dx, int dy) %7B%0D%0A%09%09super(name, x, y, dx, dy);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public void update(Game game, long dt) %7B%0D%0A%09%09this.x = target.getX() * tween;%0D%0A%09%09this.y = target.getY() * tween;%0D%0A%0D%0A%09%7D%0D%0A%0D%0A%09public void beforeDraw(Game game, Graphics2D g) %7B%0D%0A%09%09g.translate(-this.x / 2, -this.y / 2);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public void draw(Game game, Graphics2D g) %7B%0D%0A%09%7D%0D%0A%0D%0A%09public void afterDraw(Game game, Graphics2D g) %7B%0D%0A%09%09g.translate(this.x / 2, this.y / 2);%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

Add CameraObject.