I try to use graphic2d to make objects . How can we differentiate the variable between 2 object that we created. For example the below code;
from above code,i have 2 rectangle variable , which is r1 and r2, and i can differentiate between them and i can do
"if (r1.intersects(r2))" in the actionPerformed method.
So my question is;
how about below code when using Graphic2d, how can i differentiate between these 2 triangle,
so that it can fit into "if (r1.intersects(r2))", as only one variable "lukis" only exist and it is used to make 2 triangle.
How can i make it so that it can fit into(......intersects(.....) ), meaning what variable should i put into these 2 dots area?