Hi all,
I just started with corona and i’m experimenting with the bridge example. I reduced the example to 1 ball and changed the graphic to a wheel. Now i want another graphic stick to that wheel bij setting the x,y to the position of the wheel.
So I tried to d do something like this, but this isn’t working.
Can someone help me with this and tell me why this isn’t working pls
-- function to drop random coconuts and rocks
local randomBall = function()
choice = math.random( 100 )
local ball
ball = display.newImage( "coconut.png" )
ball.x = 40 + math.random( 380 ); ball.y = -40
physics.addBody( ball, { density=1, friction=1, bounce=0.6, radius=104 } )
-- ball.angularVelocity = math.random(800) - 400
ball.isSleepingAllowed = false
balls[#balls + 1] = ball
end
local body = display.newImage( "body.png" )
body.x = ball.x
body.y = ball.y
Thanks! [import]uid: 55005 topic_id: 15805 reply_id: 315805[/import]
[import]uid: 52491 topic_id: 15805 reply_id: 58570[/import]