i have images that have transparent background so when they get shot the bullet hits an invisible part and disappears how would i fix this so that when the bullet hits the actual image i then disappears
move(getImage().getWidth()/2); int headX = getX(), headY = getY(); move(-getImage().getWidth()/2);
if (!getIntersectingObjects(Boss.class).isEmpty()) { Boss boss = (Boss)getOneIntersectingObject(Boss.class); int homeX = boss.getX()-boss.getImage().getWidth()/2; int homeY = boss.getY()-boss.getImage().getHeight()/2; // put previous code here
// previous code here int imageX = headX-homeX; int imageY = headY-homeY; Color color = boss.getImage().getColorAt(imageX, imageY); if (color.getAlpha()>48) // code to apply damage
if (!getIntersectingObjects(Boss.class).isEmpty()) { Boss boss = (Boss)getOneIntersectingObject(Boss.class); int homeX = boss.getX()-boss.getImage().getWidth()/2; int homeY = boss.getY()-boss.getImage().getHeight()/2; move(getImage().getWidth()/2); int headX = getX(), headY = getY(); move(-getImage().getWidth()/2); int imageX = headX-homeX; int imageY = headY-homeY; Color color = boss.getImage().getColorAt(imageX, imageY); if (color.getAlpha()>48) { Boss.life--; }