I'm assuming by spawning in objects, I only need the list once and then the objects themselves will take care of the rest. Any order of spawning the objects in will probably do, but the way I did it...
Type: Posts; User: Gravity Games
I'm assuming by spawning in objects, I only need the list once and then the objects themselves will take care of the rest. Any order of spawning the objects in will probably do, but the way I did it...
Well, I might not need infinite, but I will need enough for full length levels. A relatively large max number, like 9999 should work (maybe not even that large). I will need larger levels than 5x5,...
Well exactly what I need is a level format that allows an infinite amount of tiles on both the X and Y "axis" (for lack of a better word) I'm thinking that loading a list of objects to spawn from a...
Okay, I'll try to combine the methods further. I also think I figured out the problem with my level format. Instead of using a text file that goes sort of like this:
to draw five rows of blocks...
Thankfully good ol' "printlns" pointed me in the right direction again. It appears that the problem might not be with the arraylist in the Level class, but with the way my JPanel interprets it.
...
I have a Windows OS, the double slashes worked before I changed the arrays to arraylists. Also, I'll try combining all that code into one method and see if that helps.
I just removed the second Level1, but why is the readFile() method not writing to the arraylist?
Alright, using the links you posted, I changed the Array completely to an Array List. The problem is that now, although the program runs, it no longer will show the tiles in the level.
Here's the...
Searching through my code, I found that "array" isn't actually used in the code anywhere. So how do I implement the ArrayList? (Sorry if this is a stupid question, I'm relatively new to Java)
...
It sounds like an ArrayList is exactly what I need, because I need the String to be able to change size on the fly, as its for the level format of my game (it would get boring real quick if all the...
So how exactly would I go about changing it then? The normal method I use for integers clearly isn't working.
Not that I'm aware, I remembered to make the File methods read from "Level1", my only guess is that they're reading it from when its first initialized.
Okay:
package scorpioengine.main;
import java.awt.*;
import java.io.*;
import java.util.*;
import java.lang.*;
No dice. It still gives me an error. Any other ideas?
Well, I was trying to use the previously defined array and change its size. I named it the same as the class for simplicity reasons, but I guess I could rename it "stage" or something similar if you...
Okay, since you asked, here's a modified version of the simple program I used to trace the problem to the array (originally it didn't have the array parts):
package stringtest.main;
import...
Hello, Gravity Games here, and I'm having trouble updating an array so my level's size isn't hardcoded.
Here's the code:
package scorpioengine.main;
import java.awt.*;
import java.io.*;...