Contour shapes - 2 Questions

Hi, I am in the process of making a game, and I am planning on trying to get it as accurate and user-friendly as possible. It is a 2D-fighter game, kind of like Space Invaders or Galaga, and the enemies are imported GIF files. The bullets that our ship fires are also imported GIFs, along with our ship image.

Is there an easy way to check for collision between the objects that doesn't use a bounding box? Right now, basically I check for intersection between the smallest rectangles that can fit around the ships/bullets, but if the corner of the bullet happens to nick the very corner of an enemy, collision is detected. Is there a way to fix this? (Detecting the outline of the image, etc...?)

Also, I want the enemies to become darker the more they become hit. For example let's say that if an enemy is 50% dead, how can I make all of its pixels 50% darker? Thanks for any help...

Both of my questions may seem kind of elementary, but I have done very little image work in Java. And if you think it's elementary, then that's good! That means I have some good help on my side...

Once again thanks for any help!!

[1150 byte] By [aRyan316a] at [2007-9-23]
# 1

As answer on the first question: Yes but only with pixel collision which is some kind of slow to calculate. But you can improve the performance by first checking a collision with a bounding box and if a collision happend you check whether a `real` collision happend by-pixel.

On the second question: You can increase the alpha value of a black image over your ship images. This will look as if your ships would turn darker

_PeterMa at 2007-7-13 > top of java,Security,Cryptography...
# 2

hmm... Okay, I've been fooling around with a bunch of stuff (not this entire time...) but I am having a hard time setting the transparency.

The Graphics2D that I paint the image with is called "brush." I have the brush.setColor(0,0,0,50); method, and of course brush.paint(...). Yet when the image comes out, it is still the same transparency... I know that I am obviously doing it completely wrong; when I check the brush's transparency with getTransparency(), it is OPAQUE. How do I change this?

Or, what am I doing wrong? Thanks in advance for any help.

aRyan316a at 2007-7-13 > top of java,Security,Cryptography...