Alright guys bear with me for a moment, I'm trying to create an array than when I call it out using System.out.println( "("+LocationX+ "," +LocationY+")" ); it prints for me all the current objects (which in this case is the rocks) location in X and Y format.
Here's my code:
I know the code is wrong but what can I do to make it work?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | public class Rock extends Objects { int LocationX[] = { 0 }; int LocationY[] = { 0 }; public void act() { rockPosition(); rocksRecord(); } public void rockPosition() { int x = getX(); int y = getY(); int LocationX[]; int LocationY[]; } public void rocksRecord() { System.out.println( "(" +Lx[i]+ "," +Ly[i]+ ")" ); } } |