Why have the location of the rock in two places: the rectangle and the rockX variable?
Having the Rock's location saved in just one place would be less confusing.
Get rid of the rockX and rockY...
Type: Posts; User: Norm
Why have the location of the rock in two places: the rectangle and the rockX variable?
Having the Rock's location saved in just one place would be less confusing.
Get rid of the rockX and rockY...
Have you tried debugging the code by using println statements? For example add a println() statement just before this statement:
if(rock.rockRect.intersects(player.heroRect)){
that prints out...