Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

myfirstgame

Object Design for Game

This topic is 5556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In the Object-Oriented Approach, It likes has a rule that are every object is inherited from Null Object. That mean, it has a Null Object and then everything such as map, character and so on are inherited from that. Am I right? So, in design game, should we use this rule, we create a null object and than everything inherited from this class? if it is necessary, what and why do every object need to inherited from a Null Object, How good is this approach? By the way, I want to know, If I use C++ to make the game, so how about the editors, do these editors need to use MFC to create?Where can I find more MFC information and easy to be understand Thanks for help

Share this post


Link to post
Share on other sites
Advertisement
Basically OO has the advantage of inheritance and polymorphism over other the procedural paradigm. I don''t know where u picked up the idea that every single element in OO is derived from some null element.

Basically, to keep a clean design, you should group your game elements according to main features, then create base classes that contain these attributes.

For example, all the displayed 3d (or 2d) objects in your game will have data in common, like position,velocity etc... In my current game i have a bass class Node that has these basic properties, as well as accessors to these values, and a few other things. But Node cannot be drawn. Then i have derived classes such as MeshObject that contains a mesh pointer and a texture pointer, and knows how to draw itself.

As for using MFC for editors and the like, you would probably be better off using something like Visual Basic or something. I hear MFC is quite difficult to learn.

This room is green

Share this post


Link to post
Share on other sites
quote:
Original post by myfirstgame
In the Object-Oriented Approach, It likes has a rule that are every object is inherited from Null Object. That mean, it has a Null Object and then everything such as map, character and so on are inherited from that. Am I right?

Nope.

Object orientation is simply a paradigm that closely binds data with the functions that operate on it. The mechanism is extended via inheritance, which represents an IS-A relationship, but it is not mandatory to use inheritance. There''s also polymorphic dispatch, which allows the calling of functions in derived classes via a base class interface.

Object orientation is not a panacea. It provides a convenient, effective and efficient way to solve many problems, but should be used in consonance with other techniques and paradigms (eg generic programming) to achieve maximum productivity.

One last thing: some programming languages contain constructs providing explicit support for OO features, but it is possible to write OO code in any language that supports structured programming, such as C.

quote:
By the way, I want to know, If I use C++ to make the game, so how about the editors, do these editors need to use MFC to create?

Nope. You can use whichever GUI toolkit or technology you want - or don''t.

quote:
Where can I find more MFC information and easy to be understand?

MSDN Online

Share this post


Link to post
Share on other sites
In Java every class is derived from the Object class. In the case of java it is how they implemented generic Lists, vectors and stuff. If this is godd thing to do is up to the user i would say, but it is what you CAN achieve with OO techniques...

happy coding

--Spencer

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!