See post #31
Type: Posts; User: Norm
See post #31
Can you be changing a Tile that is not in the ArrayList?
It is very hard to understand what you are doing. There are many ways the code could do what you are describing.
If you get a reference to...
I don't understand what the problem is or what you are trying to do.
An ArrayList contains references to objects. You can change the contents of any of those objects and not effect the ArrayList. ...
I have no idea what you are talking about.
If you have any questions, you'll have to show the code and ask specific questions about it.
Time for some more debugging.
Do you see how the printing out of the values of the tiles before the if statement showed you what the problem was for detecting collisions?
With the new problem, you...
I guess it doesn't.
There is no relationship between some hardcoded values in a call to the drawRect() method and the values saved in an extension of the Rectangle class. You have to set them....
Where are they being set?
Did you look at what was printed? If width and height = 0, I don't think contains() can be true.
Where are the values of pt1 and pt2?
What is a Tile class object? What does its toString()...
The printlns should be BEFORE the values of the variables are used, not AFTER:
public boolean isCollidingWithFloor(Point pt1, Point pt2){
System.out.println("L.T.size="+Level.tile.size());...
Can you post the code with printlns in the isCollidingWithFloor() method
and also post the output from those printlns?
Did you print out the value of Level.tile.size() in the isCollidingWithFloor() method?
Is the tick() method being called? Add a println first thing in tick() that prints a message to see.
...
If the println line doesn't print anything that would indicate that the statement is not being executed.
Check the logic to see if it is possible that the println is not being executed. Add lots...
Please explain. Something must print or is there an error?
Can you post the println statement and the next few lines of code that shows where the println statement is located?
Is this the...
Which are the values of Level.tile.get(f),
which are pt1
and which are pt2
I would expect to see the values of all three printed just before this line:
if(Level.tile.get(f).contains(pt1)...
What is printed out by the printlns of the variables?
Check a virtual move before doing the actual move.
Can you explain what the problem is and post some print outs that shows it?
You haven't provided any useful information yet about what is happening.
I'd use the term shape instead of object. In OOP an object relates to an instance of a class.
A shape is something drawn on a screen.
What prints out when you print the contents of the variables...
Are you asking about the location of shapes drawn on a Graphics context?
What kind of shapes are you working with?
Can you explain what happens when the code is executed?
Try debugging the...