Search:

Type: Posts; User: kendraheartt

Search: Search took 0.42 seconds.

  1. Replies
    2
    Views
    373

    Creating new Object Help!!!

    Hi so I wanted to create 2 shields in my Space Invaders class that you can hit with a missile or bomb, but when I created them both, only one you are able to shoot at... here are my segments of code...
  2. Replies
    1
    Views
    812

    Help With Null Pointer Exception

    Null Pointer Exception fixed.
  3. Replies
    1
    Views
    474

    Null Pointer Exception

    Null Pointer Exception fixed.
  4. Replies
    17
    Views
    1,085

    Re: Help With Null Pointer Exception

    Row: 1, 2, 3... 25
    Col: 1, 2, 3.... 25
    shield[row][col] didn't show up when i put in the println statements and
    added what you told me to print i got an error saying the Variable Arrays could not...
  5. Replies
    17
    Views
    1,085

    Re: Help With Null Pointer Exception

    if ((!shield[row][col].isHidden () && (shield[row][col].overlaps (missile)) || shield[row][col].overlaps (bomb))) is the line where i keep getting the NPE... Sorry but I don't quite understand what...
  6. Replies
    17
    Views
    1,085

    Re: Help With Null Pointer Exception

    when I include both it comes back as both of them as null if i include both of them in the if statement (both the missile and the bomb), but if i only include one in the if statement it doesn't give...
  7. Replies
    17
    Views
    1,085

    Re: Help With Null Pointer Exception

    It works only if I isolate each variable (the bomb works if I don't include the || (!shield[row][col].isHidden () && shield[row][col].overlaps (missile)) portion and vice versa for the missile... is...
  8. Replies
    17
    Views
    1,085

    Re: Help With Null Pointer Exception

    It says Exception in thread "Thread-37" java.lang.NullPointerException
    at objectdraw.Drawbale2D.overlaps (Drawable2D.java:123)
    at Shield.isHit(Shield.java:103)
    at Bomb.run(Bomb.java:87)
    whenever...
  9. Replies
    17
    Views
    1,085

    Re: Help With Null Pointer Exception

    Okay, so I just did the same thing for the missile as I did the bomb, and I'm still getting the null pointer exception. Im pretty sure theres an error with theShield variable, but I cant seem to...
  10. Replies
    17
    Views
    1,085

    Help With Null Pointer Exception

    Null Pointer Exception fixed.
  11. Re: Need Help with Null Pointer Exception

    Oh okay thats what I did wrong :) I assigned it and it works now thank you so much :)
  12. Re: Need Help with Null Pointer Exception

    theShield is in the instance fields
  13. Re: Need Help with Null Pointer Exception

    I got this message when I ran the applet:

    Exception in thread "Thread-36" java.lang.NullPointerException at Missile.run(Missile.java: 108)
    this only happened when I shot the missile, but it the...
  14. Need Help with Null Pointer Exception

    Okay so I am writing a program for a space invaders game, and i keep getting a null pointer exception when in my missile class. I can't seem to figure out what went wrong... If anyone could help me...
Results 1 to 14 of 14