Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Decouple Scrollable views from GameArea #419

@LostMekka

Description

@LostMekka

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions