Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local allRamps = {} -- empty table for storing objects
- local rampGfx = { "images/tyre.png"}
- function createRamp(event)
- local ramp = display.newImage( myGroup, rampGfx[ math.random( #rampGfx ) ] )
- table.insert(allRamps, ramp)
- ramp.x, ramp.y = event.x, event.y
- ramp.rotation = math.random( 360 )
- ramp.xScale, ramp.yScale = 0.8, 0.8
- --transition.to(disk, { time = 500, xScale = 1.0, yScale = 1.0, transition = easingx.easeOutElastic }) -- "pop" animation
- physics.addBody( ramp, { density=0.3, friction=0.6 } )
- ramp.linearDamping = 0.4
- ramp.angularDamping = 0.6
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement