Entity class for a Slick2D game I'm working on a game with Slick2D and am just working through the Entity class. I'm making every variable protected and then accessing them with getters and setters. Yet it feels like I'm over-complicating things and it is more efficient to simply let some of these properties be public.

public abstract class Entity {
    protected Point location;
    protected Vector2f vector;
    protected boolean visible;
    protected Image image;

    public Entity() {
        location = new Point();
        vector = new Vector2f();
    }

    public void setLocation(int x, int y) {
        location.setX(x);
        location.setY(y);
    }

    public void setVelocity(int vx, int vy) {
        vector.x = vx;
        vector.y = vy;
    }
    public void update(){
        location.setX(Math.round(location.getX() + vector.x));
        location.setY(Math.round(location.getY() + vector.y));
    }

    public void setImage(String path) {
        try {
            image = new Image("res/" + path + ".png");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public int getX(){
        return location.getX();
    }
    public int getY(){
        return location.getY();
    }


    public Image getImage(){
        return image;
    }


Then in the main Game class:

public void render(GameContainer gc, Graphics g) throws SlickException {
    g.drawImage(player.getImage(), player.getX(), player.getY());
...
}


It just feels like additional work using so many methods as opposed to directly accessing the field.    

Additionally, is there any particular reason Vector2f()'s x and y fields are public while Point's x and y must be accessed through getters/setters?
It just feels like additional work using so many methods as opposed to directly accessing the field. 


Is it really? You have this:

g.drawImage(player.getImage(), player.getX(), player.getY());


With direct access, it would be:

g.drawImage(player.image, player.location.getX(), player.location.getY());


Which actually seems more complicated to me. It's longer, and you have to know of what type location is. Additionally, any decent IDE can generate fields plus getters and setters for you.

But the actual point of using getters and setters is that it encapsulates your code. For example, if you want to switch from using Point to using some other class. With getters/setters, you only have to change your Entity class, instead of that class plus your main plus maybe others.

Misc


correct indentation makes your code easier to read
your fields actually should not be protected, but private
I would not just print the stack trace inside the entity class, but thrown an exception and handle it elsewhere (just swallowing the exception will cause problems further on, because now the image is null). You could also try to recover by using a generic generated error image instead, so your application still works if one image file is damaged/lost