Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3
1  Games Center / Archived Projects / Re: Super Halo Brothers on: 2005-12-14 00:44:21
Haha, its been a good two minutes and the music wont' stop   Grin

Hauk
2  Game Development / Newbie & Debugging Questions / Re: Ignoring words if not contained in array. on: 2005-12-07 23:18:17
I could kiss you!!!!!!

Thanks it works great!

You rock man! This place has never failed me EVER!

A very happy,

Hauk   Grin
3  Games Center / 4K Game Competition - 2005 / Re: Shot 4K on: 2005-12-07 00:52:42
addictive!
4  Games Center / 4K Game Competition - 2005 / Re: Hack on: 2005-12-07 00:45:53
BRILLIANT KEV!

Hauk
5  Game Development / Newbie & Debugging Questions / Re: Ignoring words if not contained in array. on: 2005-12-07 00:39:22
I see what you mean there, but is there a way of making it into simpler code? Without arrayLists? I really don't want to jump in the deep end if you get my meaning  Undecided

Hauk
6  Game Development / Newbie & Debugging Questions / Re: Ignoring words if not contained in array. on: 2005-12-06 23:28:07
Actually now that I think of it, I think you misunderstood me. It doesn't read in the entire sentence as a string, it reads in each individual word and treats it as a string. Sorry if i wasn't clear enough!

Any other ideas now that i've cleared that up?

Thanks jbanes!

Hauk
7  Game Development / Newbie & Debugging Questions / Re: Ignoring words if not contained in array. on: 2005-12-06 23:15:17
If I understand your problem, you want to "tokenize" a string. (i.e. Convert a string of text into an array of strings that can be processed.) Look up "java.util.StringTokenizer" as well as "java.lang.String.split()". Between the two of those you should be able to figure out a solution. Smiley

hmm, I'll give it a look up and post back here. And I remember you from my days of lurking here  Grin

Hauk
8  Game Development / Newbie & Debugging Questions / Ignoring words if not contained in array. on: 2005-12-06 23:05:23
Hi guys. Bit of a problem from me again. This time its not homework cos its not wednesday  Wink Its an exercise i found on the net  Tongue

But what I'm wondering is, how do i get a program to ignore a word(i.e String) if its not contained in an array.

Here's what I'm working on:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
public class PirateTranslater
{
   static String TranslateToPirate(String userWord)
   {

      String translatedForBlackBeard = "";

      String space = " ";

      String [] pirateVocabulary = {"ahoy",  "yo-ho-ho", "avast", "arrr", "me", "me bucko", "matey", "proud beauty", "comely wench", "scurvy dog", "whar", "be", "th'", "ye", "be tellin'", "be knowin'", "how many leagues", "barnacle-covered", "comely", "grog-filled", "broadside", "head", "galley", "fleabag inn", "Skull & Skuppers", "buried treasure"};

      String [] userText = {"hello", "hi",  "pardon me", "excuse me", "my", "friend", "sir", "madam", "miss", "stranger", "where", "is", "the", "you", "tell", "know", "how far", "old", "attractive", "happy", "nearby", "restroom", "restaurant", "hotel", "pub", "bank"};

         for(int i = 0; i < userText.length; i++)
         {

            if(userWord.equals(userText[i]))
            {
               translatedForBlackBeard = pirateVocabulary[i];  
           
            }
            else
            {
               return userWord ;
            }
         }

         return translatedForBlackBeard;
     
   }

   public static void main(String [] args)
   {
      System.out.println("Say somethin' to ol' BlackBeard!");

      String word = Console.readToken();

      while(word != null)
      {

         String convertedWord = TranslateToPirate(word);

         // deal with the word
        System.out.print(convertedWord + " ");

         //read in the next word
        word = Console.readToken();      
      }
   }
}


Here's the problem. If i remove the else statement in the method, it prints out all the words that can be translated(i.e those contained in userText) but doesn't print the ones that aren't contained in the method, i.e such as 'there' and 'could'. But if i do include the else staement, it just returns the original string. So any thoughts from you guys??

By the way. I'm using IO redirection for it, and here's the input in a .txt file:

1  
2  
hello there sir
could you tell me where is the nearest restaurant


Thats my input!

And again, I stress its NOT homework, I'm just trying to build my skills!

And I appreciate everything you guys do for me!

Thx

Hauk
9  Game Development / Newbie & Debugging Questions / Re: Question on IO redirection on: 2005-12-05 21:47:42
Ah, that answers it! Thanks man!

Hauk
10  Game Development / Newbie & Debugging Questions / Re: Question on IO redirection on: 2005-12-05 21:37:18
Ehm, guys! for once this has nothing to do with homework! I'm just curious as using it as an alternative to typing in reams of strings!!!

Please help!!

Hauk
11  Game Development / Newbie & Debugging Questions / Question on IO redirection on: 2005-12-05 17:33:20
Hey guys,

I've a bit of a problem concerning IO redirection. I was just wondering is it possible to make a program automatically store strings from a text file in an array. This problem isn't to do with homework this time, its more a personal query.

Thanks guys!

Hauk
12  Game Development / Newbie & Debugging Questions / Caesar Cypher problem on: 2005-11-30 00:28:48
Hey guys, me again

I'm trying to write a Caesar cypher program to help me learn and understand arrays, so I have to shift to the next letter from the letter in the message to create the cypher.

Here's what I have so far

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
public class CaesarCypher 
{
   static String encryptTheMessage(String message)
   {
      String newString = "";

      char alphabet [] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

      for(int i = 0; i < message.length(); i++)
      {
         char oldChar = message.charAt(i);
           
         newString = newString + alphabet[oldChar + 1];        
      }

      return newString;
   }

   public static void main(String [] args)
   {
      System.out.print("Enter a message to encrypt: ");

      String userMessage = Console.readString();

      String encryptedMessage = encryptTheMessage(userMessage);
     
      System.out.print("The encrypted message is: " + encryptedMessage);
   }
}


If you compile it, it gives you an out of bounds exception, but I don't know where I'm going wrong. I've written the problem out on paper and attempted the solution and just can't get it. So any ideas??

Thx guys

Hauk
13  Game Development / Newbie & Debugging Questions / Re: Hey guys. Problem with calculating averages. on: 2005-11-24 00:41:59
Hmm, okay. I did try working it out in pseudocode, i'll try it again in even simpler english.

P.S I'm not going to bed until its done!  Cry

Thanks guys, I knew I could rely on you  Grin

Hauk
14  Game Development / Newbie & Debugging Questions / Re: Hey guys. Problem with calculating averages. on: 2005-11-23 13:28:07
Okay, what we have to do is roll a dice a certain amount of times(integer read by console), then we have to get the amount of times each of the numbers on the dice came up. Then we have to repeat this process twenty times, calculating the average of the the elements in the array. THEN, we have to get the maximum amount of times a number came up in either of the user-requested 'amount of times', the mimimum amount of times a number came up.

Yes it is homework, but even if you didn't post up any code and just gave me a guiding direction, it would be greatly appreciated. Its just I've run out of time to get this done, and I need some help, so I thought I'd ask the community.

Thanks guys!

Hauk
15  Game Development / Newbie & Debugging Questions / Hey guys. Problem with calculating averages. on: 2005-11-22 23:28:01
Hey guys, haven't been here in ages, but anywho, I've a huge problem.

What I'm trying to do is test the "dice" 20 times to check its randomness. The program is meant to record the most amount of times the numer appeared, the least amount of times the number occured, and the average.

I've managed to get the program to calculate the amount of times a number occured, but I'm having trouble with the average, and the most amount of times it occured and the least amount of times it occured.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
public class  TestRandomness
{
   static int rolledNumber()
   {
      int rolledNumber = (int) (1 + (Math.random() * 6));

      return rolledNumber;
   }

   static double getAverage()
   {
      double takenAverage;

      for(int r = 1; r <= 20; r++)
      {
         takenAverage = ((counts[r] + 1) / 6);

         
      }
         return takenAverage;

   }

   public static void main(String [] args)
   {
      System.out.println("How many times do you want to throw the dice: ");

      int UserAmount = Console.readInt();
      int [] counts = new int [7];
      int [] averages = new int [7];

      for(int y = 0; y <= 20; y++)
      {

         for(int i = 1; i <= UserAmount; i++)
         {
            int returnedNumber = rolledNumber();

            counts[returnedNumber] = counts[returnedNumber] + 1;
         }


      }
     
      for(int x = 1; x <= 6; x++)
      {
         System.out.println(x + ": " + counts[x]);
      }

     

     
   }
}


I would try and figure it out myself, I truly would, but I've run out of time, and desperately need it done!

Thanks for any help guys!

Hauk
16  Games Center / Archived Projects / Re: Finally A Release JRPG 0.1 on: 2005-03-23 15:35:04
Cool game!

It worked fine and i was getting between 60-110fps, but I'm running 800Mhz and 256 RAM, so if it can run on my hunk of junk then it can run on anything!

Good job!

Hauk
17  Java Game APIs & Engines / Java 2D / Re: Reviving Mini Adventure on: 2005-01-26 18:57:09
Hey Krypto!

I don't see myself as a good java developer(yet!! I'm tied up at the moment) but I'd love to be a tester for you guys. I've done some testing before and enjoyed the experience, so give me a shout when there's some code to be tested!

Count me in!

Hauk
18  Discussions / Community & Volunteer Projects / Re: Project Proposal: JRPG on: 2005-01-26 18:53:55
I approved the project straight away. I'm looking forward to seeing what the community can do together as a team.

Good Luck Krypto!

Hauk
19  Games Center / 4K Game Competition - 2005 / Re: My Java 4k submission on: 2005-01-22 23:57:00
Hey Vorax,

They are very good graphics Shocked

Whats the actual storyline for the game? Are their going to be main characters or just "player"?

I look forward to seeing the first person views (in cockpit) shots, they'll really immerse the player in the game!!

Are you planning anything innovative for the radar, what you've done here shows extreme potential and a cool radar would really make it look polished and professional.

Excellent work, and good luck with the game!

Hauk

P.S I laughed like hell until i saw the P.S at the bottom Wink
20  Games Center / 4K Game Competition - 2005 / Re: Trooper on: 2005-01-08 23:07:46
Hey Kev,

Gave the game a go. The turret turns a bit too slow to be able to kill the troopers that land but i don't know what type of turret its meant to represent so thats not a problem Smiley

Wasn't able to check the frame-rate, so i can't tell you how efficient it ran, sorry!

I know how you feel with the not being able to sleep scenario. Basically every second night Wink

Nice little game!

Hauk
21  Games Center / Archived Projects / Re: Gravity thing on: 2005-01-07 17:06:40
Endless hours of fun! You can play "the sperm and the egg"

Hauk
22  Games Center / 4K Game Competition - 2005 / Re: Tilt 4k on: 2005-01-07 16:53:50
What a great little game Kev!

It's amazing what 4k can do isn't it! Keep up the good work!

Hauk
23  Discussions / Miscellaneous Topics / Re: Display Drivers: Need Urgent Help! on: 2004-12-22 21:38:14
Problem solved everybody, fixed it about 20 minutes ago and was just running a few checks to make sure everything was working.

Thanks for the input!

Hauk
24  Discussions / Miscellaneous Topics / Re: Display Drivers: Need Urgent Help! on: 2004-12-21 09:40:06
i'm using Win2k, i had this problem before but i forget how i fixed it. It took ages. I'll give those other ideas a shot when i get home and see what i can come up with.

Cheers,

Hauk
25  Discussions / Miscellaneous Topics / Display Drivers: Need Urgent Help! on: 2004-12-20 16:55:11
Hey everyone,

I installed new nVidia display drivers today and now i can't run my monitor through my graphics card. When i turn on the computer it goes to the "Video mode not supported" screen, and i have to go through the motherboard display.

Here's a little info:

Gfx card: Geforce 4 MX440
Drivers installed today: 66.93 winXP/2k

Please help, this is quite urgent!

Cheers,

Hauk
26  Discussions / General Discussions / Re: The Best Game you've Seen!!! on: 2004-12-15 14:05:47
My alltime favourite game is Operation Flashpoint:Cold War Crisis. I did my first ever scripting with this game, and this ignited my interest in learning other languages, and here i am.

My second favourite is The Elder Scrolls: Morrowind. I loved the freedom in that game and i loved being able to steal as much as you want, i nearly failed a year at school because of that game!

I've made a few missions in Operation Flashpoint, and if you have the game, here's the link to the mission:

http://www.ofpec.com/missions/view_type.php?type=1&pending=0&orderkey=ReleaseDate&orderdir=DESC&page=7&num=10

Its called Operation Knife Blade, and i have yet to finish the sequel, due to problems scripting an air evac.

Other games include the classics, Wolfenstein 3D, Doom 1 and 2.

Speed Freaks which is very addictive, on the PS1 and Syphon Filter 1,2,3 and The Omega Strain.

There my favourite games!

Hauk
27  Game Development / Newbie & Debugging Questions / Re: absolutly lost on: 2004-12-13 22:07:06
There are plenty of topics already covering your inquiry. For differant articles, use google, preferably tutorials that use the helloworld application as an example.

If you search these forums as well you'll come up with a wealth of results.

If you are completely new, then you'll need the JDK to compile your programs. Goto suns website for all the info you need.

Hope that helps!

Hauk
28  Game Development / Newbie & Debugging Questions / Re: HELP, how to start do a JAVA GAME on: 2004-12-13 16:52:53
Okay, heres Java game programming in a nutshell. This is an article from programmers heaven which is very useful and you should be able to learn it in about a week, or if you have a lot of time maybe 3 or 4 days.

He builds you up to making battleship. Theres' 3 tutorials, I've read the first two for you and they are very relaxed and not too heavy.

Here's the first topic:

http://www.programmersheaven.com/articles/userarticles/mark/tut1/tut1_1.htm

Here's the second:

http://www.programmersheaven.com/articles/userarticles/mark/tut2/tut2.htm

Here's the third:

http://www.programmersheaven.com/articles/userarticles/mark/tut3/tut3.htm

Now read ALL of this and come back with a status report or any questions.

AND will you post some of your research or code that you have written, so we can get an idea as to what you are doing, saying i don't know what to do isn't helping anyone and what i have given you the link to should help you out a lot!

NOW get reading/coding  Cool

Hauk

AND post something solid!
29  Game Development / Newbie & Debugging Questions / Re: HELP, how to start do a JAVA GAME on: 2004-12-12 21:26:07
Now I don't mean to insult you when I say this, but look up at all the resources that have been laid at your feet!

For a small shooting game, look at kevglasses Space Invaders 101.

Quote
she say hope me don't use the applet, she hope me use the thread


If you don't want to use an applet use webstart.
Here's a link to get it working in java webstart:

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/index.html

Now look at this stuff, LOOK AT IT, and then come back with questions, PLEASE Wink

Hauk
30  Discussions / General Discussions / Re: Where Are You? on: 2004-12-12 21:16:07
I'm from Ireland, so I voted UK cos its the closest to home.

Ah well,

Hauk
Pages: [1] 2 3
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (35 views)
2014-04-15 18:08:23

BurntPizza (31 views)
2014-04-15 03:46:01

UprightPath (46 views)
2014-04-14 17:39:50

UprightPath (29 views)
2014-04-14 17:35:47

Porlus (46 views)
2014-04-14 15:48:38

tom_mai78101 (67 views)
2014-04-10 04:04:31

BurntPizza (127 views)
2014-04-08 23:06:04

tom_mai78101 (227 views)
2014-04-05 13:34:39

trollwarrior1 (192 views)
2014-04-04 12:06:45

CJLetsGame (199 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!