Jump to content

Space Invaders: Destroying bases incrementally?


glen_a_smith
 Share

Recommended Posts

Hi Guys,

 

New to Phaser, and working on a Space Invaders clone per the sample code in the phaser repo. It's going great but I've hit a blocker.

 

I wanted to add those protective bases that decompose on collision. In the original arcade game, the bases decompose dynamically as bullets hit them (see pic) so I can't really just use static animations since it's just the pixels around the bullet collision that get decomposed.

 

post-17971-0-13196100-1450736311.png

 

How would you guys approach the problem? I know there are facilities to just draw on the bitmap of the Sprite (eg copy BitmapData)? Perhaps I could do that and just remove a few random pixels (or draw in black on them?) around the collision x/y?

 

Happy to do the homework, just after a bit of inspiration on how best to approach it?

 

Thanks,

 

Glen.

 

Link to comment
Share on other sites

Take a look at the Tanks demo on the Phaser website. Much like you have already thought about, it uses a bitmap for the ground, which take circular damage as it is hit by the player bullets. You could probably do something similar with the shields, either cutting circles out of them or using some other damage pattern.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...