Gornova/MarteEngine — Issue #75: World does not create a (default) Camera
Author: Stef569
Created: 2012-02-16 21:37:34+00:00
State: open

When an entity goes out of bounds it is still rendered. This happens because the camera checks what entities are out of bounds. But by default the world has no camera...

I would propose to create a simple camera in the world constructor. This camera has the same size as the window and does not move. It does check for entities outside of the camera bounds.

Instead of world.setCamera(Camera)
To start following an entity:
world.camera.followEntity(Entity)
stop:
world.camera.stopFollowingEntity
scroll around:
world.camera.scroll(targetX,targetY)

The best thing is that all the if camera!= null calls in world can be removed since there is always a camera instance.