masteryoom
|
 |
«
Posted
2012-11-08 07:13:12 » |
|
I am currently developing a text game called Text Attack! (that's the name) Here is a screenshot (from eclipse  )  It is currently in stage Alpha 0.1.1! Here are some things I am going to do: Working on: 5 Going to do: 4 Done: 0Not happening: 0More enemiesBeing able to battle more than once.Boss battleSavingMedals for defeating enemiesChecking if it works.Accounting to your suggestions General debuggingSpecial attacksEDIT: New jar that works!! My jar is here. It's still pretty bad though. UPDATE ALPHA 0.1.1!Added two special attacks!
|
|
|
|
Joshua Waring
|
 |
«
Reply #1 - Posted
2012-11-08 07:57:01 » |
|
Couldn't find main class error
|
The world is big, so learn it in small bytes.
|
|
|
masteryoom
|
 |
«
Reply #2 - Posted
2012-11-08 07:57:31 » |
|
That happens with me too. 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Riven
|
 |
«
Reply #3 - Posted
2012-11-08 08:00:00 » |
|
There is no "Main-Class" entry in META-INF/MANIFEST.MF
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
masteryoom
|
 |
«
Reply #4 - Posted
2012-11-08 08:06:18 » |
|
That's probably because Eclipse did not provide one *damn you Eclipse!* Ill try to get one.
|
|
|
|
Joshua Waring
|
 |
«
Reply #5 - Posted
2012-11-08 08:08:19 » |
|
O and  please post a screenshot (it is in the WIP rules  )
|
The world is big, so learn it in small bytes.
|
|
|
masteryoom
|
 |
«
Reply #6 - Posted
2012-11-08 08:11:08 » |
|
If I can get a manifest file on my project. 
|
|
|
|
Joshua Waring
|
 |
«
Reply #7 - Posted
2012-11-08 08:13:51 » |
|
Couldn't you just create a folder in your .jar called META-INF and put a file called MANIFEST.MF inside with the text 1 2
| Manifest-Version: 1.0 Main-Class: textPack.Battle |
Or just add in Main-Class: textPack.Battle into the existing one? EDIT: Nope
|
The world is big, so learn it in small bytes.
|
|
|
masteryoom
|
 |
«
Reply #8 - Posted
2012-11-08 09:29:42 » |
|
IT WORKS!! 
|
|
|
|
RylandAlmanza
|
 |
«
Reply #9 - Posted
2012-11-08 09:49:15 » |
|
It seems to hang whenever I try to attack the goblin. 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Joshua Waring
|
 |
«
Reply #10 - Posted
2012-11-08 11:19:38 » |
|
Nothing happens when I enter a or d when I first play.
|
The world is big, so learn it in small bytes.
|
|
|
Jimmt
|
 |
«
Reply #11 - Posted
2012-11-09 04:13:20 » |
|
You should still have a GUI component, even if it's a text game (use JTextArea/JTextField or whatnot) running from the command line is pretty clusmy.
|
|
|
|
Jimmt
|
 |
«
Reply #12 - Posted
2012-11-09 04:14:08 » |
|
Nothing happens when I enter a or d when I first play.
Same.
|
|
|
|
Phased
|
 |
«
Reply #13 - Posted
2012-11-09 04:15:15 » |
|
You should still have a GUI component, even if it's a text game (use JTextArea/JTextField or whatnot) running from the command line is pretty clusmy.
It may be his first game, so the GUI component could be done when the game is completed instead of when it is in development.
|
|
|
|
Jimmt
|
 |
«
Reply #14 - Posted
2012-11-09 04:17:06 » |
|
You should still have a GUI component, even if it's a text game (use JTextArea/JTextField or whatnot) running from the command line is pretty clusmy.
It may be his first game, so the GUI component could be done when the game is completed instead of when it is in development. Yeah, but basic GUI is very easy, very few lines of code.
|
|
|
|
Vladiedoo
|
 |
«
Reply #15 - Posted
2012-11-09 04:30:13 » |
|
masteryoom, - Your code is not formatted. If you are using Eclipse simply enter ctrl + shift + f to format/organize your code.
- I feel like you are using way too many while loops, it makes me nervous.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
if (input.equals("a")) { EnDamage = 50; key = 1; }
if (input == "d") { PlayerDamage = (PlayerDamage - 25); key = 2; }
|
1 2 3 4 5 6 7 8 9 10 11
| if (input.equals("a") || input.equals("A")) { enDamage = 50; key = 1; } else if (input.equals("d") || input.equals("D")) { playerDamage -= 25; key = 2; }
|
When I have more time I can try and help point you in the right direction for your game logic. Otherwise keep at it, text games are great first games to make, good luck. EDIT: Both Screem's and actual's posts are better ways of comparing the input (I find actual's the most effective though).
|
|
|
|
masteryoom
|
 |
«
Reply #16 - Posted
2012-11-09 05:14:00 » |
|
I'm changing it. 
|
|
|
|
masteryoom
|
 |
«
Reply #17 - Posted
2012-11-09 07:46:34 » |
|
I've changed it!  and I've tested it!  All other problems you have had should be fine.
|
|
|
|
RylandAlmanza
|
 |
«
Reply #18 - Posted
2012-11-09 08:29:31 » |
|
Congratulations! You beat the goblin! Press enter to end the game Now when your game is famous, I can be like, "I played Text Attack before it was cool. I was actually the FIRST person to beat it!"
|
|
|
|
Gjallar
|
 |
«
Reply #19 - Posted
2012-11-09 10:13:10 » |
|
Congratulations! You beat the goblin! Press enter to end the game Now when your game is famous, I can be like, "I played Text Attack before it was cool. I was actually the FIRST person to beat it!" That is a very realistic assumption 
|
|
|
|
Screem
|
 |
«
Reply #20 - Posted
2012-11-09 12:40:16 » |
|
Instead of 1
| if(input.equals("a") || input.equals("A")) |
You could just use the "equalsIgnoreCase(string)" method like so: 1
| if(input.equalsIgnoreCase("a")) |
Same thing for every other input where casing doesn't matter. 
|
|
|
|
masteryoom
|
 |
«
Reply #21 - Posted
2012-11-10 00:02:30 » |
|
WHY IS EVERYONE LOOKING AT MY SOURCE CODE?!!
|
|
|
|
Phased
|
 |
«
Reply #22 - Posted
2012-11-10 00:06:37 » |
|
To improve your code and possibly learn something they didn't know?
edit: A general statement on why someone may be decompiling the code for any game.
|
|
|
|
Screem
|
 |
«
Reply #23 - Posted
2012-11-10 00:10:29 » |
|
I haven't looked at your source code; I simply saw Vladiedoo's post and suggested a way to improve the code he posted. 
|
|
|
|
masteryoom
|
 |
«
Reply #24 - Posted
2012-11-10 00:11:04 » |
|
Oh. 
|
|
|
|
Jimmt
|
 |
«
Reply #25 - Posted
2012-11-10 00:15:20 » |
|
To improve your code and possibly learn something they didn't know?
From this game?
|
|
|
|
Phased
|
 |
«
Reply #26 - Posted
2012-11-10 00:17:36 » |
|
To improve your code and possibly learn something they didn't know?
From this game? the "possibly learn something they didn't know?" was more a general on why people may be decompiling the code.
|
|
|
|
Jimmt
|
 |
«
Reply #27 - Posted
2012-11-10 00:18:36 » |
|
Ah. ok you are absolutely correct then.
|
|
|
|
masteryoom
|
 |
«
Reply #28 - Posted
2012-11-10 06:10:10 » |
|
New update!! UPDATE ALPHA 0.1.1!
|
|
|
|
ra4king
|
 |
«
Reply #29 - Posted
2012-11-10 06:32:31 » |
|
Slightly offtopic but to solve your Main Class crisis  The easiest way to create a runnable JAR in Eclipse: Right click your project and click Export:  Choose "JAR file" and click Next:  Choose "Export all output folders for checked projects" and choose the output file, then hit Next:  *OPTIONAL* If you want to automate building your JAR file and save your settings, you can save them in a "jardesc" file. It's best to create a "jar.jardesc" in your project's folder, then hit Next:  Click "Browse" next to the "Main Class" field and choose the class that contains your main method:  Hit ok and finish:  Your jardesc file should be created and your JAR file should be wherever you saved it:   To run your "jardesc" file in the future, double click it, click "Finish", and click "Yes" for all "Overwrite?" prompts.
|
|
|
|
|