so heres a crude angrybirds that i found on youtube and I did the tutorial but I have a problem on the last line of code when I try to click the circle:
local physics = require(“physics”)
physics.start( )
local circle = display.newCircle( display.contentCenterX -100, display.contentCenterY, 20 )
physics.addBody( circle, “dynamic”, {density = 1.0, friction = 0.3, bounce = 0.2, radius = 20} )
local floor = display.newRect( 284, display.contentCenterY +150, 570, 4 )
physics.addBody( floor, “static”, {density = 1.0, friction = 0.3, bounce = 0.2} )
for i = 0, 10 do
local rect = display.newRect( display.contentCenterX + 50, (display.contentCenterY - 100) + (20 * i), 20, 20 )
physics.addBody( rect, “dynamic”, {density =1.0, friction = 0.3, bounce = 0.0})
end
function circleTouched(event)
if event.phase == “began” then
display.getCurrentStage():setFocus(circle)
elseif event.phase == “ended” then
circle:applyLinearImpulse( ((event.xStart - event.x) / 2), ((event.yStart - event.y) / 2), circle.x, circle.y )
display.getCurrentStage():setFoucs(nil)
end
end
circle:addEventListener( “touch”, circleTouched )
Im also curious why my debugger doesnt output anything useful when the simulator errors
Thanks, -hendrix.k99
P.S. my code starts on line 9 on my editor
