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 started developing tcg for android, using ADT bundle.

What is the right approach/way for making/storing cards/game info, local sqlite, some kind of data file? some service? or something else?

share|improve this question
    
Your questions are very broad and all combined in one stackexchange question. Maybe splitting them up in multiple questions and specify what you want to know and what you already know will help getting better answers. –  thalador May 23 '13 at 12:20
1  
I suggest you read the faq. 'How to start' and 'which technology to use' are off topic on this site. Also, you should avoid more than one question per post. –  petervaz May 23 '13 at 12:23
    
I edited my question, to be more specific and clear, I apologize. –  Alex Fleshler May 23 '13 at 12:30
add comment

closed as not a real question by msell, Josh Petrie, John McDonald, Anko, Maik Semder May 23 '13 at 20:18

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

You could probably benefit of a data driven approach. I'm assuming the premisse that every card might have one or more associated effects, or it can just have some stats and no special effect, something like M:tG.

You can create the effects each on it own class and probably use a factory to generate them as the cards are instantiated. The more generic the effect, the easier to reuse.

Then you create the cards as data, if they are saved on xml, sqlite, or whatever is up to you. With this approach you only need to change the code if implementing new effects, any new card using existing effects will just be added to the data files.

example:

<card name="Fireball" type="INSTANT" cost="2">
  <effects>
    <effect value="3">DAMAGE_OPPONENT<effect>
  </effects>
</card>

<card name="Leech" type="SORCERY" cost="4">
  <effects>
    <effect value="3">DAMAGE_OPPONENT<effect>
    <effect value="3">HEAL_PLAYER<effect>
  </effects>
</card>

<card name="Healing Monk" type="Creature" cost="3" attack="1" defense="1">
  <effects>
    <effect when="COME_IN_PLAY" value="1">HEAL_PLAYER<effect>
    <effect when="LEAVE_PLAY" value="1">HEAL_PLAYER<effect>
  </effects>
</card>

Of course those are only illustrative, you need to design the TGC first and only then you can design a good data model.

share|improve this answer
    
This might also gives some clue where to start: badlogicgames.com/wordpress/?p=2668 –  nosferat May 24 '13 at 12:34
add comment

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