-
RPG game question
So im about to start a huge project for myself that will really challenge my abilities:D
So my question is im gonna have monsters(all text based and JOptionPanes and buttons etc. no graphics not that good yet:mad:
would i need to write like each monster up in different files and do like a project or can you put it in one big file?
next is about weapons
i want weapons with attack damage that you are "holding"
how would i go about adding weapons to the "character"
same with armor
all help and ideas are very much appreciated:):):)
-
There should be a base class called monster and each type of monster should inherit from that base class all the things that are in common with a "monster".
Same with equipment. There should be a base class that is equipment, and from there inherits weapon and armor, and from there swords and bows and breastplates and helms, etc.
Your goal is to reuse as much code as you can and be able to group like things together.
With monsters, if you have a base class you can then dump all the monsters in a list, for example, and update the state of each monster.
Or you can store all "equipment" in the players pack or equip only "armor".
-
So i need to write a separate file with all the monsters and a separate file with all the weapons?
-
No. Each class will be in its own file. So you will have many classes/files based on the descriptions given by mr matt above.
-
Still a little confused:confused:
-
What precisely is confusing you?
-
2 things
numero uno
what kind of file would i use to write the weapons in?
2
like do i keep each weapon separate in separate files or in on big file
-
If we can teach you one thing today, it is hopefully a better understanding of the concept of a class. With a few exceptions that we won't go into and that don't apply here, each class should be in its own file. Each type of weapon (be it a gun or knife, or ICBM) should be a separate class and thus in its own file. You may wish to create an ancestor class that all weapons inherit from, perhaps even call it Weapon, and perhaps make it abstract, but it too will be in its own file.
So for question number one:
1) "weapons" won't go in a file, it will likely consist of a group of classes, each in their own file. Weapons likely will be composed of other objects from other classes. For instance, a Gun class may hold Bullet objects.
2) See answer number 1).
-
so im starting to get the concept of a class but im not sure on like how to write it kinda
and like how to use it in the big program
-
That's what books are all about. Do you have a decent Java textbook that you're going through right now?
-
no i dont i was gonna get a good one cuz my school one is dated like 1995 or something but the book was like $30 and im poor:(
-
Is there anything online?
-
Yes, there are several options online. First and foremost are the Sun Java tutorials which come highly recommended: Sun Java Tutorials
Another option is to find second hand Java books on line. I got mine off of Amazon and they were quite helpful and quite cheap.
Much luck!
-
Thank you i will check them out
-
Re: RPG game question
Check out TheNewBoston's Java tutorials on YouTube. :) he is a very good teacher online
-
Re: RPG game question
I think you need a extremely good understanding of Game design as well as a excellent understanding of Programming languages. Then you can perform a project in Java that will allow you to effectively make a game in it.
Not to make anyone feel bad, but you can do whatever convention you want when you make a gain. You can have 50,000 lines of code for the whole game and have it all in one file. If that is how you like it, then do it. But there are reasons why you would use external classes. A file for everything will make debugging easier and much faster to spot.
So, if you are a newbie at Java, game design, and programming in general, jumping into such a huge project like this will be a huge issue. Make sure you understand how programs work and then make your way to programming games. Also, try Flash. Very simple, very easy to use, and the script is also very easy to use. If you want to stay with Java, stick with it and learn how it works first. Then jump into a game once you believe you have a grasp on how things work in Game/Software Design.
-
Re: RPG game question
I think a text-based game would be easy... but then I'm not an expert so I could be missing a lot.
weapons and equipment is the easy part, just a lot of classes. what I'm concerned about is the "story" you would have to branch out and keep track of events as they split and merge if you see what I mean. I think you could easily produce "battles" with a random generator that would pick enamies from a list (you could also get random drops from them in a similer way) the random generator would pick an index in a data structure... AHHH! you've just got me excited... want to partner up? could be fun
-
Re: RPG game question
Please note, this thread has been resurrected after almost 3 years old, the original poster not active for over a year, and is becoming a magnet for spam which has been deleted. I'm going to have to lock this thread