Hello daniweb,
I am new to Java and to this forum! I am trying to put some objects into an array like this..
MovingPlatform[] platforms;
platforms = new MovingPlatform[1];
The problem is that I want to be able to access variables of objects within my array. I have tried this but I am getting "java.lang.NullPointerException" errors:
platforms[0].name = "platform1";
I am sure this is a simple syntax problem. Can anyone offer some insight?
Just in case here is what my object class looks like:
public class MovingPlatform {
int angle;
int speed;
int distance;
Room room;
String name;
int dir;
int progress;
}