D3 is a very delicious juicy game. It punches your face with fun-packed hammer each moment when you start the game. Then you progress... Then you progres even more... Then it stops... Stops slowly... then no more of that kick feeling.
@sn0k3 Hint: You go 3 loop levels deep but you think you are only going 2.
Classic java mistake.
I guess it's normal Java design to process the entire file, take one result, and throw away the rest of the processed data. And it's obviously normal Java style to do that heavy operation once for each entry in the file, instead of getting them all at once.
In fact, I think the program is already perfect Java. If you made it actually output a correct result in all cases that would be taboo in a Java world. It should work for a single line just fine, Java users can run the function for each line separately and then merge the results with an instance of a ListMergerFactoryAgentNegotiator after creating a new GenericMergerFactory and configuring it to be a List Merger, and then creating an ListMergerAgent for each processor
@sn0k3 because for each line on your file you overwrite the matrix with the values from the line read currently. last line read is 6,7,8 so you matrix at the end of your loop is
@ChrisMcFarland I don't know, a million dollars makes it harder, but I visited an oracle office some miles away and I got word from larry ellison himself that I have a job waiting and they would put me through whatever degrees are required for it
I can't do desk jobs, I blame school for that. It taught me that if you're sitting at a desk for any reason other than your hobbies, then you're being tricked into wasting your life chasing someone's money and they will do their best to keep you blind to that and worthless for anything else until you die and are replaced faster than a light bulb.
java.lang.ArrayIndexOutOfBoundsException: 3 at levelEditor.LevelLoader.readLevelFromPath(LevelLoader.java:29) at levelEditor.LevelLoader.main(LevelLoader.java:10)
@Jon why you think that if(numbers[x].equals("\n")) is a problem? It should be working, it just checks the array of the current line the current element does it is '\n' and if it is then it makes y++
Okay got that:
for(int i = 0; i < numbers.length; i++) {
if(numbers[i].equals("\n")) {
x = 0;
y++;
}
levelFile[y][i] = Integer.parseInt(numbers[i]);
}
and the error is that: java.lang.NumberFormatException: For input string: "\n" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at levelEditor.LevelLoader.readLevelFromPath(LevelLoader.java:33) at levelEditor.LevelLoader.main(LevelLoader.java:10)
If you want to be sure it doesn't crash regardless, you are going to want to include a try{}catch{} block in there to ensure you process the exceptions that could happen
guys, I have rooms in my project where, after fight, you can face an event unlockable with a sort of password. So far I have to set one room to reveal the code and another room with the puzzle to solve. My struggle is on the reveal method to use. since that there could be several rooms with a code for their own purpose I thought I could allow the player to just read once the passphrase and have to remember it.
the other option is that once you got the revelation when you step into the right room the passphrase will be already typed in. Do you think the former approach would be too lame?
// doing it the baller way for shits and giggles
for(;;) {
while (*fileData && !isdigit(*fileData++));
if (!*fileData) break;
*levelFile++ = atoi(fileData);
while (*fileData && isdigit(*fileData++));
}
@TheMuffinCoder keeping ship momentum on the shots is a huge deal, and may or may not be the kind of gameplay you want. it makes aiming for things while you're moving more difficult.
my asteroids game will have it, as that's been part of asteroids for a long time