-
Notifications
You must be signed in to change notification settings - Fork 139
Description
Is your feature request related to a problem? Please describe.
GameArea instances currently hold data about the world (GameBlock collection) as well as the view. (Scrollable) This means that if you need to change the view, you need to copy whole object with the complete GameBlock data.
Describe the solution you'd like
I propose to separate GameArea from the Scrollable implementation:
- Add a
GameAreaVieworGameAreaCamera, that handles theScrollablelogic, but does not hold any world data and only points to an existingGameArea - Either remove the
Scrollableinterface fromGameArea, or give eachGameAreaa default view/camera to preserve backwards compatibility - Let
GameAreaComponentRenderertake a view/camera instead of aGameArea
Describe alternatives you've considered
Making the visible part of a GameArea dynamically resizable would also mean that the world data does not have to be copied, but this would miss out on the cool features listed below. While making the views/cameras resizable would also not hurt, the decoupling makes it fairly easy to create a new view/camera, so the actual resizing support can go down in priority.
Additional context
This separation would enable a lot of cool picture-in-picture game features, for example:
- Item description panels can include an extra 5by5 view of the item and its surroundings, that also updates the same way as the main view.
- Follow-cams for characters. Surveillance simulator, anyone?
- Dialogue boxes showing the character you speak to, maybe even using a different
projectionModethan the main view.