Ok so i have a red circle and a blue circle
So the red circle is spinning and i want the blue circle to be stuck the side of that circle and just spin with the red circle…
While the red circle is spinning and the blue circle is stuck to the red one; you can touch the screen and the up but gets pulled back by the gravitational pull of the red circle…
Here i wrote the code of the red and blue circles and the red circle spinning…
I just can get the blue circle to stick to the red one and then make a gravitational pull for the red one…
THIS IS SAMPLE CODE… YOU CAN PUT THIS IN A MAIN.LUA
local physics = require("physics") physics.start() local spinner = display.newCircle( 0, 0, 50 ) spinner.x = display.contentCenterX spinner.y = display.contentCenterY spinner:setFillColor( 1, 0, 0 ) physics.addBody( spinner, "static", { bounce = 0 }) local player = display.newCircle( 0, 0, 25 ) player.x = display.contentCenterX player.y = display.contentCenterY - 200 player:setFillColor( 0, 0, 1 ) physics.addBody( player, "dynamic", { bounce = 0} ) local doTurn = function(event) spinner.rotation = spinner.rotation + 15 end Runtime:addEventListener( "enterFrame", doTurn )
Thanks to anyone who can help!
