Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » let's share our classes

This thread is locked; no one can reply to it. rss feed Print
let's share our classes
Hassan Kanso
Member #15,437
December 2013

Hey,
I am a c++ /allegro 5 programmer...coding need a team ,and if you are not in a team it will take a lot of your time . So what I say let's share our classes and what we have done ,so other game developer will not need to rewrite the same object...I mean by that someone give the particle system class other one give button class,collision functions,jump functions,fire functions,text box class and like that things ...after that the progression of the programming will increase a lot and we will have more time for graphics design and the story and that other things.

Okay of course I said that idea so I should to start first :

my classes :

game class. (event queue ,event ,timer ,inputs register function...)
page class.
button class.
text box class (input box).
text class.
timer class.
check box class.

::)::)

gezegond
Member #14,762
December 2012
avatar

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
avatar

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:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

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...
then all programmer who want to share some codes must be accepted from the common reference...and that need a team to check the codes...it's a good project if it done but I'm not excited for it :p ...thank you anyway.

l j
Member #10,584
January 2009
avatar

To a certain extent, a component-oriented design, instead of the classical object-oriented allows this more.

Go to: