#tweetcoding Part 3 – Starfield, Sinescroller, TweetSynth & VintageFlash

My fourth entry is Starfield – another classic demoscene effect. Nothing special about this one – it simply uses FP10′s new 3D abilities to move some 2×2 pixel bitmaps. Would have been nice to get some rotation in there, but unfortunately most of the 140 characters are use up with creating the stars.

Starfield

for(i=j=550;i--;){if(!o[i]){o[i]=addChild(new Bitmap(new BitmapData(2,2,0,0)));p=o[i];p.x=r()*j;p.y=r()*j*.72;p.z=r()*j}o[i].z-=9;o[i].z%=j}

Fifth is Sinescroller. Perhaps the most common demoscene effect – scrollers go all the way back to the early crackintros in which coders would inject personal messages, greetings or credits. Unfortunately this is a fairly unimpressive sinescroller – only 3 characters, and pretty poor kerning.

Sinescroller

x=550;t=["R","M","D"];for(j=50;j--;){if(!o[j])(o[j]=addChild(new TextField())).text=t[j%4],o[j].x=j*9;p=o[j];p.x-=1;p.x%=x;p.y=s(i+=.5)*9+9}

TweetSynth is my sixth entry, and the first entry to use audio by seven minutes. Nothing to see here, but make sure your volume is down low first. I didn’t want to use random data, so I played with the numbers until it sounded interesting. Check out Zachberry’s entry too – he managed to get a much more interesting sound going.

if(!i){(o=new Sound()).addEventListener("sampleData",l);o.play();function l(e){for(c=5e3;c--;){w=e.data.writeFloat;w(s(i+1));w(s(i+=c))}}}

Number seven is VintageFlash, an attempt at recreating an “old film effect”. Managed to squeeze three separate elements into this one – the background flicker, random noise to simulate dust, and the vertical lines simulating scratches in the film.

vintageflash

p=900;n=r()*9-4;ls(p,0,.1);if(i=!i)g.clear();mt(0,n);lt(p,n);if(!m.round(n))o=n*p;ls(1);mt(o,0);lt(o+=n,p);k=r()*p;l=r()*p;mt(k,l);lt(k,l+n)

Onwards to Part 4.