Reputation: 3
So I'm making a space invaders clone and I'm stuck on the wall part. I need to make destructible wall I don't know how to do it. So if anyone has any idea, it would be helpful to get some help from you people out there.
Upvotes: 0
Views: 103
Reputation: 473
The original Space Invaders had barricades that got destroyed pixel by pixel by the explosions of bullets that hit them. So if you want to make it realistic, when you detect a per-pixel collision of a bullet with a wall, draw the explosion and at the same time remove those pixels from the wall texture where they overlap.
The original arcade version never actually redrew the whole screen every frame so this process was automatic when the explosion disappeared. It never moved more than 4 or 5 objects each frame.
Of course you will have to manage rebuilding the 4 walls from the original undamaged texture every level. Happy programming.
Upvotes: 0