Jump to content

  • Log In with Google      Sign In   
  • Create Account


HuwFulcher

Member Since 31 Mar 2011
Offline Last Active Apr 27 2014 06:12 AM
-----

Posts I've Made

In Topic: Any way to make this simple tennis game more OO?

25 April 2014 - 10:07 AM

 


IMO, that's the wrong way to think about software architecture. It doesn't matter "how OO" a codebase is. What matters is how easy it is to maintain. Object orientation is just one tool of several that you can use to get the job done. The danger of focusing so much on OO is that you wind up with a rigid, inflexible monster that makes it impossible to make changes without negative consequences (like code breakage, or increased complexity of implementation).

 

Yep.  I saw a video of Jonathan blow talking about how he coded stuff in Braid.  It was very interesting.  He would just put a comment in a function instead of creating a new funtion, wrap that code in braces, and then code away, knowing that the code wasn't going to break any other code.  From an 'OO' point of view this is just rubbish, but when you're one of a few people trying to fix a bug in a game so you can ship it, you'd rather rewrite the same code snippet 10 times and test each fix once than change a function used in thousands of spots and have to test thousands of things when you make a change.

void someFunc() {

   // fix a bug here
   {
      // here is some code, wrapped in braces,
      // so the scope can't possible cause problems
      // anywhere else.  I can change this code all 
      // I want and not break anything else
   }
}

This may be going to far, but I really had to stop and think about it.  I'm still thinking about it...

 

 

Interesting idea! I'm going to focus on just coding out the program first and then see what can be made modular without causing too much grief in the long run


In Topic: Any way to make this simple tennis game more OO?

25 April 2014 - 07:46 AM

I see, thanks for all the help I am getting a bit too carried away early since I haven't even finished the project yet haha!


In Topic: Any way to make this simple tennis game more OO?

24 April 2014 - 03:23 PM

Thanks for all your input guys, this is really helpful I'll take it a step at a time and try and refine it more and more into fitting the OOP paradigm. In general for Game Development how OO should you go? I'm a little new on all of this so any more info (or if you need me to provide more) would be appreciated :)

 

Thanks once again!


In Topic: Any way to make this simple tennis game more OO?

24 April 2014 - 09:43 AM

Cool thanks for the response! I'll take a look at modifying it now and see if I can get something working :), is the original code an acceptable form of OOP or would it need refinement? 


In Topic: How do the maps work in Civilization?

30 June 2011 - 03:50 AM


Wouldn't constantly drawing the whole map be a massive drain on the machine running it?



It depends on how costly it is to draw the map. Obviously it isn't optimal, but it would achieve what he originally wanted, while requiring barely any modifications to his code.


Good point

PARTNERS