Zoyt
June 12, 2013, 3:24pm
1
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 I’m going to have to try it now.
Zoyt
June 12, 2013, 4:53pm
3
@Briarfox - Thanks! That would be an interesting competition… Hahaha… If only Codea could turn its apps into screen savers.
Yeah i wish it could 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.
Zoyt
June 12, 2013, 5:55pm
5
@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.
Luismi
August 13, 2013, 3:55pm
7
waoo very nice !!! nice work
Zoyt
August 13, 2013, 4:13pm
8
@Luismim - Haha, thanks. Super simple, but it works.
Ignatz
August 13, 2013, 5:59pm
9
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/