Hi
Is it possible to apply setLinearVelocity(x, y) to a display group? I am trying to achieve that but with no luck. Here is my code:
[lua]local physics = require(“physics”)
physics.start()
physics.setGravity (0, 4)
local group = display.newGroup()
local deck = display.newRoundedRect(100, 200, 200, 18, 10)
deck:setReferencePoint(display.TopLeftReferencePoint);
deck.strokeWidth = 0
deck:setFillColor(140, 140, 140)
deck:setStrokeColor(180, 180, 180)
physics.addBody(deck, "kinematic ", { density = 1.0, friction = 1, bounce = 0 } )
local deck1 = display.newRoundedRect(100, 300, 200, 18, 10)
deck1:setReferencePoint(display.TopLeftReferencePoint);
deck1.strokeWidth = 0
deck1:setFillColor(140, 140, 140)
deck1:setStrokeColor(180, 180, 180)
physics.addBody(deck1, "kinematic ", { density = 1.0, friction = 1, bounce = 0 } )
group:insert(deck)
group:insert(deck1)
group:setLinearVelocity(-500, 0) [/lua] [import]uid: 167063 topic_id: 29714 reply_id: 329714[/import]
[import]uid: 147305 topic_id: 29714 reply_id: 119252[/import]