Hi All,
I'm trying to clone space invader, collision with the green barriers.
Right now I have access to the pixels of the green barrier
I would like to draw a solid black circle around the collision point of the bullet, right now I'm using the following code, but it spread random pixels, not solid black circle and it's center the hitting point
int radius = 44;
for (int y = -radius; y <= radius; y++)
{
for (int x = -radius; x <= radius; x++)
{
if (x*x + y*y <= radius*radius)
{
int j = y + bullet.x;
int i = x + bullet.y;
uint8 pixelOffset = j*4 + i*pitch;
ptr += pixelOffset;
*ptr = 0xff000000;
}
}
}