samedi 11 février 2017

Game development - Update method and State pattern

For my game, I use a State Pattern to handle my screens. The screen need to update and render each frame. And the game loop is in the Game class.

But I also need an update and render method in the Entity class. Should I use an interface in the Screen and Entity class (e.g. FrameProcess) ? Or can I leave it like this (see image)?

What is the best pratice in OOP ? Are there any pattern for that ?

Basic UML of this problem

Aucun commentaire:

Enregistrer un commentaire