in my game
player/user draws a bridge (set of rectangles)between two points
and turns on physics to check strength of bridge (which changes shape of original drawing).
user can turn-off physics at any time
once physics is turned off how to get back all the objects/sprites/rectangles to its original shape??
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
How to remove body from physics to get back original
First you probably want to pause and resume physics rather than turn it on/off. Keep your bridge beams in a table with the dimensions of x, y, width, height and center point. You may also want to store the dimensions for the physics shape and pivot joints too.
Just a thought,
-David
Thanks David for your thought
player may want to redesign whole bridge again, so i have to stop
i can't keep partial bridge in out of shape while designing it
Moved to Developer Support.
Bug forum is for suspected Corona bugs only ;)
Thanks,
Peach :)
so Peach,
this is not a bug, it is a limitation that you can't get back original once add objects to physics?? :)
why corona is not releasing memory even after i stopped physics and removed all drawn rectangles with removeSelf() and made to nil
To make sure I understand you properly, you wish to remove the physics bodies but not the images?
Your question about memory, removing all rectangles and memory not releasing - is there no change at all or is it just not as great as you'd expect?
Please use the below function and let me know results from before rectangles are removed and then again from after they have been removed;
1 2 3 4 5 6 7 8 9 10 | local function monitorMem(event) collectgarbage("collect") print( "\nMemUsage: " .. (collectgarbage("count")/1000) .. " MB") print("Texture Usage " .. system.getInfo( "textureMemoryUsed" ) / 1000000) return true end Runtime:addEventListener("enterFrame", monitorMem) |
Peach, i'll give this information later
now i'm facing other serious problem like this one below
http://developer.anscamobile.com/forum/2011/03/21/random-crashes-after-i-started-using-physics
Are you stopping physics or pausing it?
Are all collisions resolved when you do so?
i'm pausing it, then i'm clearing all physics bodies with removeBody (i read about it in forum, couldn't find in documentation though)
i'm not handling any collisions. i left it to physics engine, because i have no functionality for collisions.
i only need to break bridge if any joint reached max weight thresh hold.
If the memory usage isn't decreasing then the bodies aren't being removed which may very well be connected to this issue.
Can you please post plug and play sample code?
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
Sluggish response of the built in editor.....
Image Capture not working
OSX Lion and iOS5
changing image on collision
Which Android Permissions are usuable, how to turn off one?
native.setActivityIndicator(true) inneractive auto-reload bug
which ad system is the best choise for corona?
Mac OS complete SYSTEM FREEZE caused by CoronaSDK simulator (re-boot required)
No errors on Simulator....