开发者

XNA Components: should all game entities extend GameComponent or DrawableGameComponent?

I'm a newbie trying to build a primitive component based engine for a simple 2D game and I'm wondering if every开发者_JS百科thing from a "human" to a "crate" should extend one of the two. I can see advantages to having the Update and Draw called, but it seems like a lot of extra baggage for every single entity to carry around. Any thoughts would be appreciated.

On a different note, I can also see that a manager-type class, such as a particle engine should certainly extend DrawableGameComponent.


Personally, I don't use either of the game component classes. Game engines are highly specialised and you can't possibly have a single component-based design that will work for them all.

How difficult would it be to write your own base class that has Update & Draw methods? Not very... there's really nothing magic about XNA GameComponents. If they fit your purpose, fine, if they don't, it's really not the end of the world!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜