Old CRT shake and flicker effect
  • Ipad41001Ipad41001 December 2011
        xx = math.random(3) - 2
        yy = math.random(3) - 2
        translate(xx,yy)
    

    An effect to recreate jiggly old CRTs

    I put it at the start of the draw loop in sprite invaders and it looks great (actually it looks bad but that's the point)

    This simple effect can also be used when you want to show a game shaking (explosion, big Dino footsteps, etc). Just increase the numbers.

    For something I may be working on I used this on a flame. Instead of translate, I used it to flicker the tip of the flame. 11 minus 6.

  • Ipad41001Ipad41001 February 19

    Was thinking about neon lights

    function draw()
        isCRT = false
        --isCRT = true
        background(40, 40, 50)
        if isCRT then
            
            font("Inconsolata")
            fill(0, 255, 27, 255)
        else --neon sign
            font("MarkerFelt-Thin")
            fill(255, 0, 232, 255)
        end
        tw = 800 --text width
        th = 200 --text height
        fs = 200 --fontsize
        i = image(tw/10,th/10)
        fontSize(fs/10)
        setContext(i)
        text("Codea",tw/20,th/20)
        setContext()
        if isCRT then 
            fill(0, 255, 27, 255)
            xx = math.random(3) - 2
            yy = math.random(3) - 2
            translate(xx,yy)
        else --neon
            fill(255, 0, 232, 127)
        end
        if math.random() > .01 then
            sprite(i,WIDTH/2,HEIGHT/2,tw,th)
        end
        fontSize(fs)
        text("Codea",WIDTH/2,HEIGHT/2)
    end
    
  • MarkMark February 19

    I was fiddling around with a title screen for Orb-Bits, and found it amazing just how much pure random fud could be pushed out to generate "static." In its simplest implementation:

    for i = 1, 1000 do
            rect(math.random(WIDTH), math.random(HEIGHT), 1, 1)
    end
    

    I wouldn't use it as background for anything more active than a title screen. I'm just amazed that it works even when nothing else is going on.

  • Ipad41001Ipad41001 February 19

    Nice effect, it really triggers pattern recognition, I see so much that isn't there in it, just like real static.

  • Ipad41001Ipad41001 February 26

    A slightly different pattern of static

    function setup()
        
    end
    
    function draw()
        pr = image(WIDTH,1)
        for x = 1, WIDTH do
            dot = math.random(125)
            pr:set(x,1,dot,dot,dot,255)
        end
        for y = 1, HEIGHT do
            pps = math.random(WIDTH)
            --sprite(pr,(WIDTH/2)-ps[y],y)
            --sprite(pr,WIDTH+(WIDTH/2)-ps[y],y)
            sprite(pr,(WIDTH/2)-pps,y)
            sprite(pr,WIDTH+(WIDTH/2)-pps,y)
        end
    end
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with OpenID Sign In with Google

Sign In Apply for Membership

In this Discussion