This site requires JavaScript, please enable it in your browser!
Greenfoot back
SharpShaBoom
SharpShaBoom wrote ...

2023/12/22

do Transparent pixels count toward the isTouching method?

SharpShaBoom SharpShaBoom

2023/12/22

#
Hey when using the isTouching method do the "hit boxes" include transparent pixels? I'm making some very strangely shaped monsters for my game and there's going to be a lot of transparent space in the images that I don't to be part of there hit boxes.
nccb nccb

2023/12/22

#
Yes. Greenfoot's built-in collision detection uses bounding boxes for collision detection, so it doesn't care if the pixels are filled or transparent. You may be interested in this pixel-based collision detection scenario , which has code you could use for colliding based on transparent/non-transparent pixels.
You need to login to post a reply.