Results 1 to 4 of 4
Thread: Weird crashes...
- 04-15-2011, 03:08 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 2
- Rep Power
- 0
Weird crashes...
I'm writing a little game in Java but I'm experiencing some weird crashes, that has brought my development to a halt.
My program is set to run in full screen for 5 sec and then shut down. When i experience the crashes, the shutdown doesn't happen and nothing is drawn to the screen... The program must still be running in the back, cause it keeps making println statements.
I'm trying to loop through an array and check on different object's current states.
Java Code:for(int i = 0; i < IL.insList.length; i++){ if(IL.insList[i].doTest() == true){ //Always returns true atm IL.insList[i].execute(); i = 0; }
The strange thing is that my application only crashes when I have more than one object in insList[].
My InstructionList class looks like this:
Java Code:package testapp; public class InstructionList { public InsMove[] insList; public InstructionList(){ insList = new InsMove[2]; insList[0] = new InsMove(); insList[1] = new InsMove(); } }
My InsMove class looks like this:
I really hope someone can help me solve this problem, as I can't seem to locate any errors myself.Java Code:package testapp; public class InsMove { public void execute(){ System.out.println("Working"); } public boolean doTest() { return true; } }
- 04-15-2011, 07:36 PM #2
Try updating your video hardware driver(s).
db
- 04-16-2011, 01:08 AM #3
Member
- Join Date
- Apr 2011
- Posts
- 2
- Rep Power
- 0
- 04-16-2011, 03:04 AM #4
This is an infinite loop:
Java Code:for(int i = 0; i < IL.insList.length; i++){ if(IL.insList[i].doTest() == true){ IL.insList[i].execute(); [COLOR="Red"] i = 0; //keeps resetting i to 0[/COLOR] } }
Similar Threads
-
Program crashes: NullPointerException
By d4nce2thisbeat in forum New To JavaReplies: 5Last Post: 11-20-2010, 09:33 PM -
Swing GUI crashes (using JNI)
By divs in forum AWT / SwingReplies: 4Last Post: 06-10-2010, 08:04 AM -
Multithreaded server crashes
By skarosg3 in forum Threads and SynchronizationReplies: 7Last Post: 05-26-2010, 09:24 AM -
Java crashes
By Nicole in forum Advanced JavaReplies: 2Last Post: 04-06-2009, 07:22 AM -
Java Crashes on Mac 10.3.9 not sure how to update
By patricknowow in forum New To JavaReplies: 1Last Post: 11-30-2007, 03:57 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks