Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Re: Random Errors Occurring When Running Game in Eclipse

    What were the last values that printed out before you got the error:
    ArrayIndexOutOfBoundsException: -5

    Are you getting the error still?
  2. Re: Random Errors Occurring When Running Game in Eclipse

    The problem with the way this prints out is that you do NOT see the values of x and y. You see the sum of the variables.
    Try this: System.out.println("x=" + x + ", y" + y);

    What was the last...
  3. Re: Random Errors Occurring When Running Game in Eclipse

    Do you know what a variable is?
    Do you know what variables are being used to compute the indexes to the arrays?
    Those are what you should print out. Show the variables' values.
    The variables you...
  4. Re: Random Errors Occurring When Running Game in Eclipse

    No. Comments do not cause anything to print out.
    Do you know what a variable is?
    Do you know what variables are being used to compute the indexes to the arrays?
    Those are what you should print...
  5. Re: Random Errors Occurring When Running Game in Eclipse

    println refers to the println method of the out variable in the System class.
    You use it like this:
    System.out.println("var=" + var); // print the value of var

    You need to print out the values...
  6. Re: Random Errors Occurring When Running Game in Eclipse

    That error message was BEFORE you added the println. What about AFTER you added the println?
    Where are the print outs of the values used in the line where the index value is wrong?

    Did you add a...
  7. Re: Random Errors Occurring When Running Game in Eclipse

    I don't see how a println statement can cause errors.
    Please copy and paste here the full text of the error messages.
  8. Re: Random Errors Occurring When Running Game in Eclipse

    Add a println just before the statement with the invalid index to print out the contents of all the variables used in the computing the index.
  9. Re: Random Errors Occurring When Running Game in Eclipse

    What are the values of x, y and width when this statement is executed?
    Could the value of the expression be -6?
  10. Re: Random Errors Occurring When Running Game in Eclipse

    Have you looked at the lines in your code where the array index goes out of bounds and determined why it gets a bad value? What code is at line 34 in Screen.java? Or line 105 in EscapeComponent.java
Results 1 to 10 of 10