New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step branch #1

Merged
merged 261 commits into from Jul 21, 2016
Commits
Jump to file or symbol
Failed to load files and symbols.
+4 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

collapse speed formulae a bit

  • Loading branch information...
pvdz committed Feb 20, 2016
commit 34f41165fbbe00cf3d34e8ccca2d73dd2af35c1d
View
@@ -272,19 +272,19 @@ <h1>
// force speed (causes jitter)
if (ABS(vx= p.vx) < .1) vx *= RANDOM() * 3;
if (ABS(vy= p.vy) < .1) vy *= RANDOM() * 3;
p.vx = vx = (vx - COS(dtan) * acc) * F;
p.vy = vy = (vy - SIN(dtan) * acc) * F;
vx = vx - COS(dtan) * acc;
vy = vy - SIN(dtan) * acc;
// size of pixel
var size = FLOOR(1+(vx+vy)*(p.q ?.8:.2));
var size = p.q ? 4 : FLOOR(1+(vx+vy)*F*.2);
// paint pixel
if (!p.u) c.fillStyle = p.num ? 'yellow' : p.q ? 'pink' : 'black';
else if (p.u % 3 === 0) c.fillStyle = 'blue';
else if (p.u % 3 === 1) c.fillStyle = 'red';
else c.fillStyle = 'green';
c.fillRect(OX + FLOOR(p.x+=vx) + .5, OY + FLOOR(p.y+=vy) + .5, size, size);
c.fillRect(OX + FLOOR(p.x+=p.vx=vx*F) + .5, OY + FLOOR(p.y+=p.vy=vy*F) + .5, size, size);
}
requestAnimationFrame(R);
ProTip! Use n and p to navigate between commits in a pull request.