Hi,
I’ve got some square png’s which move down the screen in a column as sensors, using a transition. When the bottom image collides with a platform I cancel and remove the transition and switch the sensors off. I then have a loop which tries to set the y value of each image to place each one sitting directly on top of the one below. I do this because I want the blocks to move down the screen at a regular speed, touch the platform (which could be at any height) and stop immediately, Tetris-style.
I’m using the physics engine because the maths involved with the platform motion etc was killing me. I’m open to suggestions.
My problem is that while everything works fine, when the images collide with the platform, at the point of turning off the transition they bounce back up a little. I have friction, bounce and density all set to 0.0.
I tried putting in a loop to set the y position when they land, but it caused this exception:
Assertion failed: (m_world->IsLocked() == false), function SetTransform, file /Users/ansca/.hudson/jobs/Pong-DMG/workspace/platform/mac/…/…/external/Box2D_v2.1.2/Box2D/Box2D/Dynamics/b2Body.cpp, line 395.
/Applications/Corona Game Edition Beta/Corona Terminal: line 9: 4955 Abort trap “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
I guess the easy answer, if anyone knows it, would be how to make blocks move down the screen until they collide with something, then become stationary objects on a platform.
Thanks,
matt. [import]uid: 8271 topic_id: 2022 reply_id: 302022[/import]