0

I'm quite new to making games in Java, and this is my first project making a game. For some reason, my code is causing a NullPointerException that I couldn't find the cause of it.

Edit: Was a very dumb mistake that caused a chain reaction it's solved now

blGNX
  • 1
  • 2
  • it's at this line: sr.SThreadsController.spawnFood(SThreadsController.java:118) – Stultuske Jan 24 '20 at 07:01
  • 1
    Now you get to experience *debugging*, the part of programming that many new programmers don't realize exists. So what is `null` on line 118, and *why*. – Kayaman Jan 24 '20 at 07:03
  • See the answers to the linked Q&A for various common causes of NPEs, and guidance on how to diagnose them. – Stephen C Jan 24 '20 at 08:17
  • Turns out it was a very stupid mistake, I referred to the wrong class at line 20 which caused a chain reaction of null pointers. Now I got the game working again, thanks for the suggestions anyway – blGNX Jan 24 '20 at 11:19

0 Answers0