Advertisement
alestane

Untitled

Aug 18th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1.     local allRamps = {} -- empty table for storing objects
  2.     local rampGfx = { "images/tyre.png"}
  3.    
  4.     function createRamp(event)
  5.         local ramp = display.newImage( myGroup, rampGfx[ math.random( #rampGfx ) ] )
  6.         table.insert(allRamps, ramp)
  7.         ramp.x, ramp.y = event.x, event.y
  8.         ramp.rotation = math.random( 360 )
  9.         ramp.xScale, ramp.yScale = 0.8, 0.8
  10.        
  11.         --transition.to(disk, { time = 500, xScale = 1.0, yScale = 1.0, transition = easingx.easeOutElastic }) -- "pop" animation
  12.        
  13.         physics.addBody( ramp, { density=0.3, friction=0.6 } )
  14.         ramp.linearDamping = 0.4
  15.         ramp.angularDamping = 0.6
  16.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement