« Oh no, no more postings on Flex anymore! | Main | The mystery of the shifting pixel. »

Friday, April 16, 2004

Comments

Burak KALAYCI

I still have Wofenstein (and Spear of Destiny) around. It not only ran fine on a 286, it *required* at least a 286! If I remember correctly, I had a 386SX 20MHz machine at the time with a 40MB hardisk, 2MB Ram, 512KB VGA, both 5.25" and 3.5" drives but no sound card... Those were the days.

darron

I remember playing Doom on my 25 MHz Packard Bell.. and reducing the screen size by 50% so the game would run fast. IDDQD anyone? Ah.. the memories.

Nice post, by the way.

Peter

Great job Owen ... that's a pretty damn small filesize for a 3D cube :p

Richard Leggett

Wow that's amazing, only managed to knock off 4bytes by removing the clip from the library and using:

z = createEmptyMovieClip(i,i);
z.lineStyle(1);
z.lineTo(1,1);

Your code is surely too tight to knock off anymore!?!

Mario Klingemann

Well, somehow on my machine the swf becomes bigger than 555 bytes when I publish your fla, so that probably accounts to your FLASM optimizations afterwards.

But heres an ugly trick that brings me down to 547 bytes. Maybe you can squeeze that even more with some FLASM cosmetics:

k=l=m=n=0;

onEnterFrame = function () {
m += k=d ? (_ymouse-h)/2 : k*.99;
n += l=d ? (g-_xmouse)/2 : l*.99;
g = _xmouse;
h = _ymouse;
i = 8;
while (i--){
with (attachMovie('d', i, i, {j:[(i & 1)*100-50, (i >> 1 & 1)*100-50, (i >> 1 >> 1 & 1)*100-50]})) {
C = j[2]*Math.cos(n*.017453)-j[0]*Math.sin(n*.017453);
D = 200/(j[1]*Math.sin(m*.017453)+C*Math.cos(m*.017453)+200);
_x = 200+D*(j[2]*Math.sin(n*.017453)+j[0]*Math.cos(n*.017453));
_y = 200+D*(j[1]*Math.cos(m*.017453)-C*Math.sin(m*.017453));
_width = _height=D*6.65+1;
}
}
};
onMouseDown = onMouseUp=function () {
d = !d;
};

Ludwik

413 bytes of AS code:

S=Math.sin,T=Math.cos,k=l=M=N=0,q=2*(v=100),i=8,a=.0176,onMouseDown=onMouseUp=function(){d=!d},onEnterFrame=function(){Q=_ymouse,R=_xmouse,M+=(k=d?(Q-h)/2:k*.9)*a,N+=(l=d?(g-R)/2:l*.9)*a,g=R,h=Q,i=8;while(i--)with(eval(i))C=z*T(N)-x*S(N),D=q/(y*S(M)+q+T(M)*C),_x=q+D*(z*S(N)+x*T(N)),_y=q+D*(y*T(M)-C*S(M)),_width=_height=D*6};while(i--)O=attachMovie('d',i,i),O.x=(i&1)*v-50,O.y=(i>>1&1)*v-50,O.z=(i>>1>>1&1)*v-50

Ludwik

hmmm, the same with cropped lines:

S=Math.sin,T=Math.cos,k=l=M=N=0,q=2*(v=100),i=8,a=.0176,
onMouseDown=onMouseUp=function(){d=!d},
onEnterFrame=function(){
Q=_ymouse,R=_xmouse,
M+=(k=d?(Q-h)/2:k*.9)*a,
N+=(l=d?(g-R)/2:l*.9)*a,
g=R,h=Q,i=8;
while(i--)with(eval(i))
C=z*T(N)-x*S(N),
D=q/(y*S(M)+q+T(M)*C),
_x=q+D*(z*S(N)+x*T(N)),
_y=q+D*(y*T(M)-C*S(M)),
_width=_height=D*6};
while(i--)
O=attachMovie('d',i,i),
O.x=(i&1)*v-50,
O.y=(i>>1&1)*v-50,
O.z=(i>>1>>1&1)*v-50

Ludwik

It's possible to further reduce the code size by optimizing the bit operations. Do you know how :)?

asmqb

I don't know Flash from scratch (I'm a VB programmer) so I couldn't modify this code if my life depended on it, but can someone post a version of this that doesn't slow down after you "throw" it (if you know what I mean)?

Email me at asmqb7 at gmail dot com if you want more info / have no idea what I mean.

The comments to this entry are closed.

AdSense

My Photo

FineTune Player

Clustrmap

  • Locations of visitors to this page

Google Analytics