Physics collision issue

I am new to Codea, and have been trying out the physics routines, and I keep coming across a problem where physics body objects pass through each other.

Is this a bug, or is there something wrong with my code?

Video: http://www.youtube.com/watch?v=s4OrZZylY_Y

Code:


block = nil
block2 = nil

function setup()
    block = physics.body(POLYGON, vec2(-50,50), vec2(-50,-50), vec2(50,-50), vec2(50,50))
    block.x = 0
    block.y = 0
    block.type = STATIC
    block.sleepingAllowed = false

    block2 = physics.body(POLYGON, vec2(-50,50), vec2(-50,-50), vec2(50,-50), vec2(50,50))
    block2.x = 60
    block2.y = 700
    block2.sleepingAllowed = false
end

function draw()
    background(40, 40, 50)

    strokeWidth(0)
    noStroke()

    fill(200,0,0,255)
    pushMatrix()
    translate(block.x, block.y)
    rect(0,0,100,100)
    popMatrix()
    
    fill(0,200,0,255)
    translate(block2.x, block2.y)
    rect(0,0,100,100)
    popMatrix()
end

I have just figured it out. The bodies rotate, and I need to adjust the transformation matrix rotation, e.g.:

rotation(block1.angle)

But this leads to another question. Block1 type is STATIC, yet it is moved by the impact of block2. Is the only way to prevent that to have a large mass on the static body?

.@nomore you could edit your first post by putting 3 tildes before and after your code: it will look good in one single bloc.