Best way to organize entities in a game?

后端 未结 5 1974
暗喜
暗喜 2021-01-30 15:24

Let\'s say I\'m creating an OpenGL game in C++ that will have many objects created (enemies, player characters, items, etc.). I\'m wondering the best way to organize these since

5条回答
  •  不知归路
    2021-01-30 15:54

    You should make a superclass of all your objects that has a generic render() method. declare this method virtual, and have each subclass implement it in its own way.

提交回复
热议问题