|
let's share our classes |
Hassan Kanso
Member #15,437
December 2013
|
Hey, Okay of course I said that idea so I should to start first : my classes : game class. (event queue ,event ,timer ,inputs register function...)
|
gezegond
Member #14,762
December 2012
|
If you want to enable other programmers to use your code, you should license it as either GPL or one of the permissive ones such as MIT. Most people usually license their whole games rather than just parts of it afaik.
|
Chris Katko
Member #1,881
January 2002
|
Is it Monday already? Game objects are very specialized. You may use x, y, for your objects, but I may use x, y, and "height" for game to denote drawing order. So using that alone, I'm going to have to inherit from your class and change the object handler, and the drawing I'm going to have to write myself anyway. I'm not saying don't do it. But many of the things that can be reused already exist in better libraries than we could ever produce in passing. Just because code exists doesn't mean you should use it because it can have bugs you don't know about, and functionality you don't fully understand--because random code is not held to the same standard as library code with clearly defined interfaces and encapsulation. gezegond made a good point about just make your code open-source and if anyone sees something they like, they can re-use it and send you a thank you letter. While I'm not an employed professional programmer yet (give me a couple months), in my experience, the only things I reuse are standardized, tested libraries with defined APIs, existing proven codebases (what I'm working on in the first place), and small, concise implementations of known algorithms (a single function/object implementing FFT, etc). If you're not careful what you bring in, you open pandoras box for errors that you will spend weeks trying to find. And random code that I write for my hobby games is definitely not subjected to rigorous quality control--and that's me! I know me, I know even less about a stranger across the internet. -----sig: |
Hassan Kanso
Member #15,437
December 2013
|
yeah I understand you mean it's better to share the source code of the game than share some classes, and if we want to share our classes we have to commit ourselves in a common reference like say : all position must be under "position" struct like position.y and position.x and it's forbidden to use bound word... |
l j
Member #10,584
January 2009
|
To a certain extent, a component-oriented design, instead of the classical object-oriented allows this more.
|
|