posted 11 years ago
Hi Bryce. You have to think on a bit more of a conceptual level. Don't dig into the programming straight away. First write down on paper what you want everything to look like. Ask yourself questions.
There are orcs. There are heroes. Who knows about their whereabouts? Are there levels? Are there areas, such as caves or forests? Is it just one game in which we only care about one orc and one hero? How are orcs and heroes different?
Now, let's say that all that we want to do when we run the program, is perform one fight exactly, and print who wins. Now you know enough to have a good idea of what you want your application to look like:
You see? With the method declarations alone we already have a really good idea of how we want everything to work. We construct a new game using two fighters. A fighter has a name and some stats. The main method then simply looks like this:
The Game class knows enough about the two fighters to be able to determine the outcome of a random battle. All it needs are the methods provided by the Fighter class. If you want, you can also add methods setHealth()/setStrength() to the Fighter class to edit these properties after a battle is done.
I hope this answers some of your questions.