Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple Scrollable views from GameArea #419

Open
LostMekka opened this issue Nov 28, 2021 · 0 comments
Open

Decouple Scrollable views from GameArea #419

LostMekka opened this issue Nov 28, 2021 · 0 comments

Comments

@LostMekka
Copy link

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 GameAreaView or GameAreaCamera, that handles the Scrollable logic, but does not hold any world data and only points to an existing GameArea
  • Either remove the Scrollable interface from GameArea, or give each GameArea a default view/camera to preserve backwards compatibility
  • Let GameAreaComponentRenderer take a view/camera instead of a GameArea

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 projectionMode than the main view.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant