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.

¡Hi mates! Two friends and I are planning to code a game for Android using AndEngine GLES 2.0 Anchor but we have a concept problem, we need the game to be as adaptative as possible, I mean, if we make a new map or a video, it has to be easily included on the game, making them plugable. For example:

When the game starts, shows a video as an introduction. After that, the game loads a level. When the level is finished, loads another level which is the second part of the mision, then, shows another video as outro, then shows another video, and then loads three more levels which are another mision and so.

My idea is to have a class that queries a DB or reads an XML file to determine which is the next thing the game has to load, sequentially, every time the last thing ended.

My mates said to me that it is a bad idea, a idea that breaks with the MVC pattern, because the Controller has to know by itself programatically which is the next thing that has to be loaded, but I think that my idea fits perfect on the Model, because the Controller is only a bridge between the View and the Model and I really don't like to hard code that, because I want the game to be extensible without touching any line of logic code to do that "simple task".

My mates said that one plausible solution to make adaptative without external resources is to hard code the flux secuentially on a Map on a class with constant values only, but that invalidates their argument about "Controller has to know everything" because works so similar as my idea but only a little faster because it hasn't to be loaded from a file or a DB.

There's another better way to do what we need?

(I do not look for an easy answer, I do not want someone make my job, I'm not a lecher, If someone says me that AndEngine does it for me, but not how, I will look for that by myself, but I need some guidance, because I've never programmed a game with multiple levels or some kind of "variable flux").

Thanks every one for your answers!

(I've post this on StackOverflow also, but I've found that page that seems more specialized on game development)

share|improve this question
Hi, just a bit of friendly advice: cross-posting a question on multiple SE sites is not allowed (see here). If you want to migrate your question you'll need to contact a moderator. –  Alex Apr 9 '13 at 14:23
How can I contact one? –  Aitor Gonzalez Apr 9 '13 at 15:51
You can flag your question and mark it under moderator attention->other (be sure to add a note saying you want it migrated). You need to decide which site you want to keep your question on first though. –  Alex Apr 9 '13 at 16:07
add comment

closed as off topic by Tetrad Apr 9 '13 at 20:49

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

This sounds like a pretty straightforward example of a need for data driven design. Using something such as XML to represent a manifest is not uncommon or even remotely "hard coded". Either way, your game will need to parse something for a list of levels and videos that are available to it, whether that means auto identifying files in a particular folder, or using XML to parse the list at run time.

Neither of these ideas are uncommon, and it is simply up to you as to which you would prefer. Loading all the files in a folder can represent a larger risk than loading specific files listed in an xml/txt manifest.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.