Results 1 to 18 of 18
Thread: RPG game question
- 11-04-2009, 02:55 AM #1
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:):):)Are you suggesting that Cocunuts migrate?!! -Monty Python
- 11-04-2009, 03:05 AM #2
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".My Hobby Project: LegacyClone
- 11-04-2009, 03:12 AM #3
So i need to write a separate file with all the monsters and a separate file with all the weapons?
Are you suggesting that Cocunuts migrate?!! -Monty Python
-
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.
- 11-04-2009, 04:08 AM #5
Still a little confused:confused:
Are you suggesting that Cocunuts migrate?!! -Monty Python
-
What precisely is confusing you?
- 11-04-2009, 04:12 AM #7
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 fileAre you suggesting that Cocunuts migrate?!! -Monty Python
-
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).
- 11-04-2009, 04:30 AM #9
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 programAre you suggesting that Cocunuts migrate?!! -Monty Python
-
That's what books are all about. Do you have a decent Java textbook that you're going through right now?
- 11-09-2009, 04:39 AM #11
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:(
Are you suggesting that Cocunuts migrate?!! -Monty Python
- 11-09-2009, 04:40 AM #12
Is there anything online?
Are you suggesting that Cocunuts migrate?!! -Monty Python
-
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!
- 11-09-2009, 04:58 AM #14
Thank you i will check them out
Are you suggesting that Cocunuts migrate?!! -Monty Python
- 07-07-2012, 09:52 PM #15
Member
- Join Date
- Jun 2012
- Posts
- 49
- Rep Power
- 0
Re: RPG game question
Check out TheNewBoston's Java tutorials on YouTube. :) he is a very good teacher online
- 07-08-2012, 12:51 AM #16
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.My API:Java Code:cat > a.out || cat > main.class
- 07-08-2012, 03:23 AM #17
Senior Member
- Join Date
- Apr 2012
- Posts
- 115
- Rep Power
- 0
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 funLegend has it the moderators and senior members of java-forums.org were able to code skyrim using only 701 lines of java... or so the legend goes.
- 07-08-2012, 05:56 AM #18
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Similar Threads
-
Question mark colon operator question
By orchid in forum Advanced JavaReplies: 9Last Post: 12-19-2010, 08:49 AM -
Implementing "Game Over" in Minesweeper game based on Gridworld framework.
By JFlash in forum New To JavaReplies: 2Last Post: 08-05-2010, 04:49 AM -
2D strategy game or 2D war game
By led1433 in forum Java 2DReplies: 5Last Post: 02-10-2009, 06:00 AM -
Tic Tac Game
By loggen in forum New To JavaReplies: 1Last Post: 12-12-2008, 07:36 AM -
game
By amith in forum AWT / SwingReplies: 0Last Post: 05-19-2008, 05:16 PM


LinkBack URL
About LinkBacks

Bookmarks