alestane icon

Untitled

alestane | PRO | 07/25/13 03:51:10 AM UTC | 0 ⭐ | 320 👁️ | Never ⏰ | []
Lua |

790 B

|

None

|

0 👍

/

0 👎

local rect = display.newImageRect( "rect.png", yolo, yolo)
    rect.myName = "rect"
    rect:setReferencePoint( display.CenterReferencePoint )
    local xExtent, yExtent = rect.width/2, rect.height/2
    rect.x = 150 + xExtent 
    rect.y = sidesH + yExtent
    local rectShape = { xExtent, yExtent; xExtent, -yExtent; 0, 0; -xExtent, -yExtent; -xExtent, yExtent }
    physics.addBody(rect, "dynamic", { density=1.0, bounce=0, friction=0, shape = rectShape})   
    rect:setLinearVelocity (10000, 0) --100 is normal   
    rect:rotate(90)
 
 
 
---------
 
 
local bottom = display.newImageRect( "bottom.png", levelend, sidesH)
    bottom:setReferencePoint( display.BottomLeftReferencePoint )
    bottom.x = 0
    bottom.y = screenH - sidesH
    physics.addBody( bottom, "static", { density=1.0, bounce=0, friction=0.5, isSensor = false})

Comments