Physical matrix effect

Hello,
I was looking at this thread and got inspired to write a stupid little script that has the matrix effect, but with physics. Here it is:

backingMode(RETAINED)
displayMode(FULLSCREEN)

function setup()
    characters = {"?","?","?","?","?","?","?","?","?","?","?","?","?","?","?"}
    objects = {}
    ground = physics.body(EDGE,vec2(0,0),vec2(WIDTH,0))
    
    fontSize(30)
    
    frameCount = 0
end

function draw() 
    fill(0, 0, 0, 30)
    rect(0,0,WIDTH,HEIGHT)
    
    frameCount = frameCount + 1
    if frameCount >= 20 then
        changeChar = true
        frameCount = 0
    else
        changeChar = false
    end
    fill(0, 255, 6, 255)
    for i,v in ipairs(objects) do
        if changeChar == true then
            v.info = characters[math.ceil(math.random(1,#characters))]
        end
        pushMatrix()
        translate(v.x,v.y)
        rotate(v.angle)
        text(v.info,0,0)
        popMatrix()
    end
end

function touched (t)
    table.insert(objects,physics.body(CIRCLE,fontSize()/2))
    objects[#objects].x = t.x
    objects[#objects].y = t.y
    objects[#objects].restitution = .9
    objects[#objects].info = characters[math.ceil(math.random(1,#characters))]
end

```

Hope you like it!

@zoyt Very cool, this app took up a surprising amount of my time. Cool idea. Think we need a matrix app competition :slight_smile: I’m going to have to try it now.

@Briarfox - Thanks! That would be an interesting competition… Hahaha… If only Codea could turn its apps into screen savers.

Yeah i wish it could :slight_smile: I’m working on finding all the matrix demos on the forums and putting them into one demo project to share when people ask for matrix examples.

@Briarfox - Haha. I only know of three: this one and the ones listed in the other thread. I’ve been on the codea forums (at least watching it, not participating) almost from its start, and that’s all I’ve seen.

Well good, thats all I found and the codea forum search was making my eyes bleed. I really need to start using google instead.

waoo very nice !!! nice work :slight_smile:

@Luismim- Haha, thanks. Super simple, but it works.

I have one here, converts any photo into a kind of Matrix effect by dripping pixels

http://coolcodea.wordpress.com/2013/06/13/83-a-bit-of-fun-the-matrix-effect/