Hi all,
I am trying to do a spinning rect, just like spin the bottle, but I am unable to.
I know I can just do random rotation for a specific or random time, that would work, but I want rotation that feels correct, and that is where the physics come in.
I would really like to keep rect2 behind rec1 to act as a shadow.
Anyone who would know what is needed here ? Here is my code so far.
[lua]physics = require(‘physics’)
physics.start()
physics.setGravity(0,0)
H = display.contentHeight
W = display.contentWidth
local rect2 = display.newRect( 1, 1, 50, 200 )
local rect1 = display.newRect( 1, 1, 50, 200 )
rect1:setFillColor ( 200, 0, 0 )
rect1.x = W/2
rect1.y = H/2
rect2.x = W/2 +10
rect2.y = H/2 +10
physics.addBody ( rect1, {density=1, friction=1, bounce=0})
rect1:applyForce( 500,500, rect1.x+rect1.x/2, rect1.y+rect1.y/2)[/lua] [import]uid: 61610 topic_id: 14541 reply_id: 314541[/import]