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 [import]uid: 98708 topic_id: 16985 reply_id: 316985[/import]
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 [import]uid: 98708 topic_id: 16985 reply_id: 316985[/import]
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. [import]uid: 5317 topic_id: 16985 reply_id: 63697[/import]
@ 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 [import]uid: 30314 topic_id: 16985 reply_id: 63704[/import]
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 [import]uid: 52491 topic_id: 16985 reply_id: 63716[/import]
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. [import]uid: 30314 topic_id: 16985 reply_id: 63761[/import]
With texture it’s not possible but if you use vector graphic… [import]uid: 12704 topic_id: 16985 reply_id: 63771[/import]
Thanks for all the comments everyone !. How exactly would it be possible using vector graphics ? [import]uid: 98708 topic_id: 16985 reply_id: 63774[/import]
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
[import]uid: 12704 topic_id: 16985 reply_id: 63778[/import]
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. [import]uid: 67839 topic_id: 16985 reply_id: 63807[/import]
>>Here are my wild and
Yeah, but you need to create looooooooooooooots of circles and just kill preformance with 1 fps… [import]uid: 12704 topic_id: 16985 reply_id: 63808[/import]
Ok… I found that this technique (thanks to the vector bitmap masking example) …where you dynamically update and reload a bitmask works perfectly… Now the only problem is physics interaction between the updated image and the crate… Maybe someone can figure out a way to get the crate to respond to gravity and drop into the holes created by tapping the yellow rectangle … or move the crate sideways along the contours created by circles underneath the crate… any suggestions for modifying the code below to do this ?
http://dl.dropbox.com/u/47407164/bitmap-vector.zip
By the way… this example only seems to work on the MAC simulator… Windows version doesn’t seem to do update temp mask correctly… [import]uid: 98708 topic_id: 16985 reply_id: 64277[/import]
@ richard.cheso
Thanks thats pretty cool way to do it. The way I tried was similar I created a Rect
with same color as background and when you touch lets day sand to dig you
will basically be coloring the sand so it makes that illusion of your finger
digging. But in the end the same thing happened to me as your sample.
So hopefully someone can figure this out if its possible! [import]uid: 30314 topic_id: 16985 reply_id: 64389[/import]
I may have cracked this, both working physics and background reveal.
I had the physics working tonight and I found @richard.cheso 's code and used his method for the background mask removal.
The physics are fast even on a first gen NexusOne, the down side right now is the the image save/load is slow and causes a noticeable lag even on an iphone4.
Code is on GitHub and code resource here
http://developer.anscamobile.com/code/terradestructa
[import]uid: 110373 topic_id: 16985 reply_id: 83234[/import]