Destructible Environments or Deformable Terrain

Is it possible to do something like this in Corona.. If so, Can someone point me to some sample code ?

http://www.youtube.com/watch?v=hqvMGUNA8To

Thanks

I don't think so. As far as I'm aware, Corona can't write to a texture...and that would be the way I would implement it...

If anyone wants to prove me wrong, go for it. I would love to be able to do stuff like this.

@ mike4

I agree with you I don`t think this is possible yet but I wish it was
so hopefully they prove us wrong and make this possible!

+1

Moved out of Corona UI forum to New Users forum.

At present no, this is not feasible. Technically you could put something similar together with a bit of effort however I'm pretty sure it would fall over due to memory usage. (It would involve a large number of small tiles, basically.)

Peach

Do you think eventually it will be possible Peach? I have couple of ideas (apps)
but they need this method (similar to digging) so i`m looking forward to it.

With texture it's not possible but if you use vector graphic...

Thanks for all the comments everyone !. How exactly would it be possible using vector graphics ?

Draw object:
http://developer.anscamobile.com/content/displaynewline

you can fill it:
http://developer.anscamobile.com/reference/index/objectsetfillcolor

If you want to "digg" in object or bomb it you have to redraw it/replace with new figure in Lua code. Nasty stuff :)

Here are my wild and incomplete thoughts.

For the destructible parts of the scene, use something like physicseditor that makes it easier to turn odd shapes into physics bodies.

When the bomb collides with the destructible objects, draw a small circle which is the exact same color as the background. The circle would be positioned so that about half covers the existing background and the rest covers the object. Since this new circle is on top, it looks like you took a half circle byte out of the destructible object.

Repeat as more bombs falls, but when a bombs falls near where a previous bomb fell some special handling is needed. Each of these circles could be turned into a physics body as they are created. So, you could detect when a bomb hits a circle. It would also be hitting the destructible body because it's still there, just covered up by the circle. Use something like transition.to to move the bomb past the circle, check that its not colliding with more circles, and finally place a new circle.

>>Here are my wild and

Yeah, but you need to create looooooooooooooots of circles and just kill preformance with 1 fps...

views:1558 update:2011/10/29 17:13:10
corona forums © 2003-2011