I'm sorry in advance if this is a stupid question, but I cannot seem to get this program of mine to work. The goal of the program is to get acquainted with creating our own classes, and I can't seem to get some of it to work. I'm not sure if I should post all the code here- it would probably take up too much room, so I will add it and externally link.
Here are the main classes of my program: Classes here
I will have a "Game driver" class with a main method to run the playGame method in the game class to make it run. The assignment is to have two bumper cars on a grid from -10 10 on both the x and y axis- we are supposed to generate a random length and direction for movement and make the cars "bouce" off the wall if they are to go outside the boundary.
I am getting an error on the Grid class at:
System.out.print("What integer would you like to. . . : ");
car1ID = scan.nextInt();
saying it "cannot find symbol" with the car1ID highlighted.
Other than that, I can't find anything wrong. Only problem is, it would successfully compile before I made a few changes to the Game class- I was getting the wonderful nullPointerException error and tried to fix it- and I ended up making it worse.
The program is pretty much done and seems like it should work (in theory) but I can't even get to the point where I can test it. If you guys have any ideas as to what is wrong, I would really love to hear them. I'm completely lost right now. Thanks in advance guys!
[ November 02, 2004: Message edited by: Mr Anderson ]