private void checkForCollision() { for(int i = 0; i < world.arrayNum; i++){ if(world.isBlock[i] && playerRect.intersects(world.blocks[i])) { xDirection(0); yDirection(0); System.out.println("HIT!"); } } }
I have this method constantly updated and everytime i do hit the block it does print out HIT but it never stops my player from moving into it. Do you see anything wrong?