Hey guys so my game is a stacking game where you have to get to a certain height with the blocks but how would I figure out when the final block is at the certain height??
local physics = require("physics") physics.start() -- blocks u get to use below local numberofblocksallowed = 9 local checkpointreached = false local bg = display.newImage("bg.png",160,240) bg:scale(5,9) local ground = display.newRect(180,500,360,50) physics.addBody(ground,"static") local function spawnBear (event) if(numberofblocksallowed \>=1) then local bear = display.newImage("bear.png",event.x,50) physics.addBody(bear,"dynamic") numberofblocksallowed = numberofblocksallowed-1 print(numberofblocksallowed) end end Runtime:addEventListener("tap",spawnBear) local stackline = display.newRect(230,0,600,10) local function finalblock (event) if (numberofblocksallowed ==0) then --would I put code in here end end