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

Game State implementation, example design. #12

Open
Daroslaw opened this issue Dec 5, 2014 · 1 comment
Open

Game State implementation, example design. #12

Daroslaw opened this issue Dec 5, 2014 · 1 comment

Comments

@Daroslaw
Copy link
Member

Daroslaw commented Dec 5, 2014

That's certainly something we ought to discuss. Current design concept:

  1. Our game scene is composed of Layers stored in a vector in State_Game:
    • base class Layer
    • MapLayer
    • StaticObjectLayer
    • MobileObjectLayer
    • VFXLayer (TBI in distant future)
  2. Each Layer contains data related to itself
    • MapLayer - map (walls, decoration, path meshes)
    • StaticObjectLayer - items and everything lying still on the floor but interactive
    • MobileObjectLayer - NPCs, player, projectiles
    • VFX - particle effects etc.
  3. Key variables/methods in Layers are protected, so they can easily communicate between each other.
  4. All Layers have one static XY coordinates that affect coordinates of objects stored inside them.
  5. Viewport will be made that uses those static coordinates.

If you have any suggestions, put them here.

Key problems related to this design that need solutions:

  1. How the Graphics will be handled and rendered as requested from Layers?
  2. How viewport should work in detail? (needs research)
@Sand3r-
Copy link
Member

Sand3r- commented Dec 5, 2014

Personally I think that layers they should be having that depth 'z' parameter, and graphic engine should just handle the order of rendering with regard to it. Also - the GraphicEngine has been prepared in such a way that it stores a pointers to GameObjects, so it can keep track of objects coordinates independently. What it means is that we'll only be in need of requesting new animations when in need (and these requests can be send during the update phase of the layer).

I haven't been thinking of viewport yet, but I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants