Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    If the video is supposed to be teaching how to program java, its using some poor techniques.
    Most of the static variables could be final. The others should be instance variables.

    The missing...
  2. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    Find in the code where the image is being drawn. Print out the values used by the drawImage method that controls the height of the image. When you find the value/variable that is making the image...
  3. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    What is the code on line 66? What you posted doesn't look like it would cause the NPE.
  4. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    what variable has a null value?

    Which line is line 66? You should not get an error on the call to the System.out.println() method.
  5. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    There is a variable at line 66 that has a null value when that line is executed. Find that variable and then backtrack to find out why is doesn't have a valid value.
  6. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    That will require that there be instances of the classes and that those are used instead of the name of the class when referencing variables in the class.

    Have you tried adding some println...
  7. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    The code is ugly in the way it uses static. I'll leave debugging to you.

    To debug the code, start by finding where the "tile" is drawn. Add some println statements there that print out the...
  8. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    How did you change the code when you removed the static modifier?

    Just deleting "static" would cause compiler errors so the program would not execute.


    When I execute the code I do not see...
  9. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    I see lots of static variables. These need to changed.
  10. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    You need to get rid of the static variables and use instances of the class.

    Some classes are missing. The posted code can not be compiled for testing.
  11. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    Post the new code and your questions if you are still having a problem.
  12. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    How did you rewrite the program so it uses instances of a class instead of using static variables?

    Post the full text of the compiler error messages and the new source code.

    See post#4
  13. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    There shouldn't be any static variables.

    Rename the classes so their names are NOT the same as Java SE classes.

    Change the extends Applet to extends Panel
  14. Re: As my player goes lower on-screen my tiles become smaller in height? D:

    Several problems:
    Why does the Applet class have a main() method? Is this an Applet or an application?

    Component and Character are Java SE classes. You should NOT use the same name for your...
Results 1 to 14 of 14