Search:

Type: Posts; User: Gravity Games

Search: Search took 0.11 seconds.

  1. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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...
  2. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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,...
  3. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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...
  4. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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...
  5. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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.
    ...
  6. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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.
  7. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    I just removed the second Level1, but why is the readFile() method not writing to the arraylist?
  8. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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...
  9. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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)
    ...
  10. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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...
  11. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    So how exactly would I go about changing it then? The normal method I use for integers clearly isn't working.
  12. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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.
  13. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    Okay:


    package scorpioengine.main;

    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
  14. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    No dice. It still gives me an error. Any other ideas?
  15. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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...
  16. Replies
    36
    Views
    3,874

    Re: Trouble Updating an Array

    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...
  17. Replies
    36
    Views
    3,874

    Trouble Updating an Array

    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.*;...
Results 1 to 17 of 17