Timeline for Java Text_RPG Game
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 27, 2017 at 3:05 | comment | added | aghast | As for how to implement the throw section, that's up to you. Really, there shouldn't be one - because you should never call your factory with an invalid subclass. But that's an exception - it detects when you did something crazy, like call your factory with an invalid subclass! So I'd suggest you throw a IdiotProgrammerException with an explanation of the problem. | |
Dec 27, 2017 at 3:01 | comment | added | aghast |
The key question is, do you need the stats to be an array? I think the answer is 'no' but it's up to you. For example, if you frequently find yourself processing the stats in order, then a loop would be good and so an array or list makes sense. But for most games of this type, that's not the case- you typically compute using player.str or monster.dex and call out the stats by name. For the subclass question, I'd say try writing two or three subclasses of monster. Then see if they are "really different" and so subclasses, or if you can fold them back in using some kind of init-parameter.
|
|
Dec 27, 2017 at 2:35 | vote | accept | David Jorgensen | ||
Dec 27, 2017 at 2:34 | vote | accept | David Jorgensen | ||
Dec 27, 2017 at 2:34 | |||||
Dec 27, 2017 at 2:33 | comment | added | David Jorgensen | Thank you very much for your help, I had some further questions. When implementing the stats for characters and monsters should I use an array to hold the stats or keep them as variables? What would the differences be? (I know this is really broad, not sure how to better phrase it) When I'm creating new character classes and monsters should I just make them whole new classes with their own constructors and just extend them out of the 'Monster' class or should I just change their name and use a method to change the stats and name within the class? How do you implement the 'throw' section | |
Dec 17, 2017 at 22:33 | history | answered | aghast | CC BY-SA 3.0 |