79086046

Date: 2024-10-14 11:55:47
Score: 1
Natty:
Report link

I am not sure how the og space invaders guys have done it but, My extrapolation from the pygame knowledge that I have is, create a 2d array with 255 color value as base and 0s as transparent, make it as an pixel array object.

whenever you want to blit this array, you can convert it to surface using make_surface() function. create a mask out of this surface and use overlap method to detect which index in the 2d array the collision happens, with a radius r make the cells 0s inside the circle with point of collision as center. Now in the next iteration, use this modified 2d array to create surface and blit it.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Stiles Stillinski