Hybrid view shows that a platform’s body moves with group transition, but a hero’s behavior evidences that it didn’t move.
What is wrong with my code?
Thank you for any help.
[code]
local physics = require( “physics” )
physics.start()
physics.setGravity(0 , 9.75);
physics.setScale( 30 )
physics.setDrawMode( “hybrid” )
local hero = display.newRect(0, 0, 20, 20)
hero:setFillColor(11, 174, 174)
hero.x = display.contentCenterX
hero.y = 0
physics.addBody(hero,“dynamic”, { density = 1, friction = 10, bounce = 0.3})
local platform = display.newRect(display.contentCenterX -100, display.contentHeight-100 , 200, 20)
platform:setFillColor(11, 14, 174)
physics.addBody(platform , “kinematic”, { density = 1, friction = 10, bounce = 0.3})
local group1 = display.newGroup()
group1:insert(platform)
transition.to( group1, { time=5000, y= group1.y - 200} )
[/code] [import]uid: 193524 topic_id: 34518 reply_id: 334518[/import]
Now I must move several dozen objects instead of one group…