Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

How to start programming a simple TCG game in JAVA?


This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 Mardumesh


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 30 October 2015 - 01:32 PM

I'm a beginner in JAVA. So I wonder, where should I begin with a simple TCG game, nothing fancy. I created 4 TCG cards (2x hero and a soldier against each other) and I want them to interact with each other in a 2D graphical environment in JAVA(for a start:). I want to make something like Might and Magic Duel of Champions with cards and heroes from ancient history(educational game for kids to interest them in history and archaeology). So I need to know what should be the skeleton for the game, on what part of the hard coding should I concentrate at first. Simple "where to begin". If you can suggest sites, books or examples of code where I can begin. But I prefer advice from programmers. :) Thanx for the help.

#2 lespauled


    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts

Posted 31 October 2015 - 04:17 AM

Long before you think about programming it, you need to plan it out.  It is a necessary step to any programming task.  


Depending on complexity of your proposed game, it can be rather short, or very long.


You are already close to having the "blue sky" version of the project plan: A game like M&M DoC with cards ...... etc.


From there, break it down, little by little, until everything is broken down into very small parts.  After this stage is complete, you should have an idea of the rules of your game, where things go in respect to program objects, etc.


For example:  Each card will contain the following information ..............

My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#3 lethalwire


    while(false){ ... }

  • Senior Member
  • PipPipPipPipPipPip
  • 766 posts

Posted 09 November 2015 - 12:56 PM

I think lespauled made this clear, but games (even small ones) can be relatively big, time-consuming projects and complex projects.


During planning, I'd design all of the models in the game. For instance, I would create basic POJOs (plain-old java objects) like Card, HeroCard, Deck, CardGame, etc... (I'm not all too familiar with TCGs)


I would then try and create all of the scenarios (use cases) for each model. For example, "A card can be randomly chosen from a deck." This will give you a decent idea of the methods you will need to implement. This also gives an idea about how these models/objects will be interacting with each other and which are dependent on each other.


I think planning these steps out will help you later when it seems like you're in a tangled mess of code.


If you don't have any experience in with the GUI libraries for Java, there are many great tutorials online.

Ages ago, I would use these simple GUI programs as guides for my programs:

http://www.ntu.edu.s...ua/programming/ (Updated: 2015)

http://www.leepoint.net/ (Updated: unknown)


And of course, Oracle's GUI/Swing tutorial. Though it's a bit daunting, I'll list it here anyway for reference:


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download