I have two characters displayed in a game I am writing, the player and the enemy. defined as such:
public void player(Graphics g) { g.drawImage(plimg, x,
No need to use rectangles ... compare the coordinates of 2 players constantly.
like if(x1===x&&y1==y) remember to increase the range of x when ur comparing.
if(x1===x&&y1==y)
if ur rectangle width is 30 take as if (x1>x&&x2>x+30)..likewise y
if (x1>x&&x2>x+30)