Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Text Attack!  (Read 7877 times)
0 Members and 1 Guest are viewing this topic.
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« 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  Tongue)

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: 0
More enemies
Being able to battle more than once.
Boss battle
Saving
Medals for defeating enemies
Checking if it works.
Accounting to your suggestions
General debugging

Special attacks
EDIT: New jar that works!!
My jar is here.
It's still pretty bad though.
UPDATE ALPHA 0.1.1!
Added two special attacks!

Smiley
Offline 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.
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #2 - Posted 2012-11-08 07:57:31 »

That happens with me too. Kiss

Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« 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
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« 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.

Smiley
Offline Joshua Waring
« Reply #5 - Posted 2012-11-08 08:08:19 »

O and Cheesy please post a screenshot (it is in the WIP rules Smiley )

The world is big, so learn it in small bytes.
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #6 - Posted 2012-11-08 08:11:08 »

If I can get a manifest file on my project. Tongue

Smiley
Offline 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.
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #8 - Posted 2012-11-08 09:29:42 »

IT WORKS!!  Grin

Smiley
Offline RylandAlmanza

Junior Devvie


Medals: 3



« Reply #9 - Posted 2012-11-08 09:49:15 »

It seems to hang whenever I try to attack the goblin. Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline 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.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« 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.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #12 - Posted 2012-11-09 04:14:08 »

Nothing happens when I enter a or d when I first play.
Same.
Offline 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.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« 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.
Offline 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  
// From your code.

// You need to use .equals with Strings like so.
if (input.equals("a")) {
   EnDamage = 50;
   key = 1;
}
// This if statement will never be executed.
if (input == "d") {
   PlayerDamage = (PlayerDamage - 25);
   key = 2;
}
// At this point, even with the modified code, the game will either
// exit or run forever, the logic needs adjusting.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
/*
 * This is how I would set up the following code, notice
 * variable names start with a lower case letter.
 */

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).
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #16 - Posted 2012-11-09 05:14:00 »

I'm changing it. Grin

Smiley
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #17 - Posted 2012-11-09 07:46:34 »

I've changed it!  Cheesy and I've tested it! Grin All other problems you have had should be fine.

Smiley
Offline RylandAlmanza

Junior Devvie


Medals: 3



« Reply #18 - Posted 2012-11-09 08:29:31 »

Quote
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!"
Offline Gjallar

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #19 - Posted 2012-11-09 10:13:10 »

Quote
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  Grin
Online 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. Smiley
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #21 - Posted 2012-11-10 00:02:30 »

WHY IS EVERYONE LOOKING AT MY SOURCE CODE?!!

Smiley
Offline 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.
Online 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. Smiley
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #24 - Posted 2012-11-10 00:11:04 »

Oh.  Grin

Smiley
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #25 - Posted 2012-11-10 00:15:20 »

To improve your code and possibly learn something they didn't know?
From this game?
Offline Phased
« Reply #26 - Posted 2012-11-10 00:17:36 »


the "possibly learn something they didn't know?" was more a general on why people may be decompiling the code.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #27 - Posted 2012-11-10 00:18:36 »

Ah. ok you are absolutely correct then.
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #28 - Posted 2012-11-10 06:10:10 »

New update!!
UPDATE ALPHA 0.1.1!

Smiley
Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #29 - Posted 2012-11-10 06:32:31 »

Slightly offtopic but to solve your Main Class crisis Smiley

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.

Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!