Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on September 04, 2007

Title: Matrix Effect 3
Post by: bikemadness on September 04, 2007
This was my first way of imitating the look of the matrix effect - on the PS2 - it worked best that way.
This works with the 'forced flushed rate' box ticked only - the buffer isn't used.

The code is a lot shorter with the help of a suggestion by Jim on a (much) earlier piece of work.
It makes for a good tutorial sample.

Code: [Select]
open window 640,512
sn=11 rem anything greater, is noticably slower with fade enacted
seg=11
dim x(seg,sn),y(seg,sn)
for a=1 to sn
x(0,a)=int(ran(20))*16+164
y(0,a)=int(ran(16))*16+128
next a
repeat
setrgb 1,200,200,200
rectangle 160,128 to 484,408
for a=1 to sn
if y(0,a)>384 then
y(0,a)=128
x(0,a)=int(ran(20))*16+164
endif
y(0,a)=y(0,a)+16
for i=seg to 1 step-1
x(i,a)=x(i-1,a)
y(i,a)=y(i-1,a)
next i
l=int(ran(26))+97
m=int(ran(26))+97
setrgb 1,0,0,0
clear fill rectangle x(seg,a)-2,y(seg,a)+4 to x(seg,a)+14,y(seg,a)-12
for fade=1 to 1 rem 5
setrgb 1,0,200/fade,0 rem 500>200
text x(0,a),y(0,a),chr$(l)
text x(0,a),y(0,a),chr$(m)
next fade
next a
until (1=0)


Have a Yahappy day.
Title: Re: Matrix Effect 3
Post by: rain_storm on September 04, 2007
Classy! thats gotta be the best matrix effect I'v seen for Yabasic. Well done bikemaddness have some karma for your efforts :D
Title: Re: Matrix Effect 3
Post by: bikemadness on September 05, 2007
Thanks.
It was such a pity that I couldn't have the best of both worlds.
It was either looks or speed, especially after I learnt about 'dim' and 'buffering'.

Have a Yahappy day.
Title: Re: Matrix Effect 3
Post by: Shockwave on September 06, 2007
That looks pretty cool :) Nice one.

I haven't ever made a Matrix effect myself, at least I can't remember doing one, this must rank up there among the filled cubes, starfields etc as a very highly "done" thing.
Title: Re: Matrix Effect 3
Post by: rain_storm on September 06, 2007
Agreed it looks polished.