Results 1 to 10 of 25

Thread: Proceural Programming vs. Object Oriented Programming

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by SilverWarior View Post
    Lets say you are creating a strategy game.
    ...
    If you wish I will show you all how I would solve this problem myself using OOP aproach.
    I'm not sure exactly how the constraint you enumerated would favor an OOP approach on their own, as they're basically boolean truth tables.

    That said, such a game certainly favors a modular approach (to handle the various actions and movement cases), a database approach (to hold the zillions of parameters that would describe the characteristics of all the units in an easily editable fashion) and a scripting approach (for general AI and all scenario-specific behaviors about where/when things should move, what/how they should prioritize in their attack, etc.).

    On the other hand, I've known this kind of problems to be a good trap for "by the book" class hierarchies, as the best way to approach that problem with OO is IME not the one obvious to beginners. The common errors being not to differentiate actions from behaviors, and implementing those as methods of the entities rather than as distinct class hierarchies.

  2. #2
    Hey Eric you are free to present me with a third option for solution. I'll be glad to see it and study it. I bet I could learn something from it.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •