• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Having serious issues trying to use ArrayList<Spatial> in JMonkeyEngine 3

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm trying to use JMonkeyEngine's SDK to develop a game from a book called JMonkeyEngine for beginners. I'm working on trying to trying to create an arraylist<spatial> created in an abstract application class. The class creates 6 spatials named creeps. The creeps have index and health user-data attached to them. I have special methods in the abtract app class that creates and attaches each creep one by one with user data. I have a special class besides the abstract app state called CreepControl that defines the behavior of each creep. The problem is that when I try to access the ArrayList<spatial> of the list of creeps in a node called creepNode from my CreepControl class, JMonkeyEngine is scene node based and creepNode is attached to rootNode, I get a null pointer exception. I'm sure I'm using ArrayList wrong somehow. When I create a dummy arraylist in the CreepControl class, I don't get a null pointer exception. Its only when I try to call is using gamePlayAppState.creepNode.getChildren();. I'm stuck on this. The game runs when I take out the call for the arraylist from gamePlayAppState.
 
reply
    Bookmark Topic Watch Topic
  • New Topic