开发者

How to implement a destroyable wall in iPhone game development

开发者 https://www.devze.com 2023-01-21 23:06 出处:网络
I\'m pretty routined in writing iPhone applications with common UIViews. To extend my skills, I wanted to write a simple 2D game where a player needs to break complex wall structure with limited shoot

I'm pretty routined in writing iPhone applications with common UIViews. To extend my skills, I wanted to write a simple 2D game where a player needs to break complex wall structure with limited shoots.

One shot should d开发者_开发百科emage the wall, but not break through. A second shot at the same position would break through the wall.

No I ask myself how to handle such thing. I think drawing a shape wouldn't do the job since the wall should look damaged at the hit point.

I could draw the wall be setting single pixles. Then I could erase every set pixel in the impact area. But I think this would be very slow and memory consuming.

How to manage such things ?


Have you considered using physics engine such as Box2D/Chipmunk to make a wall of boxes like in games such as Angry Bird?

0

精彩评论

暂无评论...
验证码 换一张
取 消