[lua]local button = display.newRect(100,100,50,50)
local function create_something(event)
if event.phase == “ended” then
local something = display.newCircle(200,200,30)
local function move_something(event)
something.x = event.x
something.y = event.y
end
something:addEventListener(“touch”, move_something)
end
end
button:addEventListener(“touch”, create_something)[/lua]
this works just fine
good luck)
and thats just random funny stuff,try it)
[lua]local physics = require(“physics”)
physics:start()
local button = display.newRect(100,100,50,50)
local bounds = display.newRect(0,0,420,20)
bounds.x = display.contentWidth/2; bounds.y = display.contentHeight
physics.addBody(bounds, “static”, {friction=1,density=1,bounce=1})
local function create_something(event)
if event.phase == “ended” then
local something = display.newCircle(200,200,30)
physics.addBody(something, “dynamic”)
something:applyLinearImpulse(.10)
local function move_something(event)
something.x = event.x
something.y = event.y
end
something:addEventListener(“touch”, move_something)
end
end
button:addEventListener(“touch”, create_something)[/lua] [import]uid: 16142 topic_id: 12341 reply_id: 45077[/import]