How to stack blocks like this game ?
I use dynamic bodyType for the blocks but the blocks falling down when stack too high .
local physics = require "physics" physics.start() physics.setGravity(0,15) local myGroup = display.newGroup() local land = display.newRect(200,400,400,10) physics.addBody(land,"static",{ density= 3.0, friction=0.5, bounce=0 } ) myGroup:insert(land) local y = 200 local function spawn() local block = display.newRect(200,y,50,50) myGroup:insert( block) physics.addBody(block,"dynamic",{ density=3.0, friction= 0.5, bounce=0 }) y = y - 50 myGroup.y = myGroup.y +30 end timer.performWithDelay(2000,spawn,0)