Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I everyone, i'm working on an indie game and i'm stuck with two problems

I have many similar units on screen so i decided to implement the flightWeight pattern so there is intrinsic and extrinsic parts

Q 1 : How to manage inheritance ?

If the game base class posses the object position and rotation for example and let says i have multiple inheritance level, where to put these attributes. I mean these attributes are state dependant so, it the should be the client to have these and manage it nut it the broke the inheritance. Any advices ?

Q 2 : How to manage state machine and behavior ?

My basic soldier unit have all the same same Ai behavior of cource ( they can attack, move, retreat, .. ) but their current state is not probably the same, one instance is moving another attack. So wich class should posses the state machine and the behavior ?

I don't know if it's clear. Feel free to ask more details, i will explain

Thanks in advance for any advices or anything !

share|improve this question
It's "Flyweight", not "Flightweight" :) –  FredOverflow May 11 '13 at 13:39
oups thanks for the info –  user30567 May 11 '13 at 14:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.