简体   繁体   English

"Java 控制台资源管理器角色扮演游戏"

[英]Java console explorer RPG game

This is more of a general question not a specific coding one, but in school we got this assignment to make our own dungeon RPG console explorer game you know the one with tons of text where you type where to go, etc. My question here to the more experienced programmers is what would be the best way to fundamentally approach this like read the text from a file and store the play options into an array, etc. I am open to having to learn anything new.这更像是一个一般性问题,而不是一个特定的编码问题,但是在学校里,我们得到了这个任务来制作我们自己的地牢 RPG 控制台探索游戏,你知道那个有大量文本的游戏,你可以在哪里输入去哪里等等。我的问题在这里更有经验的程序员是从根本上解决此问题的最佳方法,例如从文件中读取文本并将播放选项存储到数组中等。我愿意学习任何新东西。 Thanks in advance.提前致谢。

"

Objected Oriented programming is Java's forte.面向对象编程是Java 的强项。 If you are going with Java, try to take advantage of these primitives.如果您使用 Java,请尝试利用这些原语。

For example, reading everything from a file and having a user select inputs with his keyboard would be something more akin to scripting, which you could perfectly do with something like Python and would therefore be a situation of using a rocket launcher to kill a mouse.例如,从文件中读取所有内容并让用户用他的键盘选择输入将更类似于脚本,你可以用 Python 之类的东西完美地做到这一点,因此会是使用火箭发射器杀死鼠标的情况。

The array thing, not sure what you mean, but generally storing such information statically in an array is generally not a good idea, especially if the information is already stored in files (unless you're going to be using them all of the time).数组的东西,不确定你的意思,但通常将这些信息静态存储在数组中通常不是一个好主意,特别是如果信息已经存储在文件中(除非你将一直使用它们) .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM