I'm just getting started on an XNA game for Window Phone 7. For my Flash games I have my own framework that I was just going to port from AS3, but I have just found the built-in game component stuff in XNA. So should I use this stuff? Should my Entity class extend game component/drawable game component? I'm sure it will be quicker just to port my AS3 code, but I thought this built-in stuff may have some advantages?

UPDATE: I decided not to use them. It doesn't seem that they are meant to be used in the way I described.


I suppose it depends entirely on how you want to do things. I can say that most of the XNA tutorials and examples I've seen use them sparingly. Typically I see the built in GameComponent/DrawableComponent types being used as the base class for services, and then those services call customized draw/update methods on the child-objects they manage.

The main advantage you get from them is that if you add them to the Game.Components collection, the game will call their update, draw, and initialize methods during that phase of the game's cycle. You can get the same effect by just putting your own code into the Game's overrides for those methods and managing object collections yourself.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.