xxxxxxxxxx
60
/*
// ORIGINAL: https://editor.p5js.org/jpcaldwell/sketches/ajmXgh8xv
// This sketch is a clone of tixy.land
// a minimal creative coding environment
// created by @aemkei
//
// Replace the return statement in
// the tixy() function with your own
// expression to change the animation
*/
function setup() {
createCanvas(350, 350);
}
function draw() {
background(0);
let t=millis() / 1000;
let i=0;
for (let y=0; y<16; y++) {
for (let x=0; x<16; x++) {
let s = tixy(t, i, x, y);
if (s > 0) {
fill(255);
} else {
fill(255, 34, 68);
}
ellipse(25 + (x * 20), 25 + (y * 20), min(18, abs(s) * 18));
i++;
}
}
}
/*
// Given the [t]ime, pixel [i]ndex, pixel [x], and pixel [y],
// return a value beteen -1 and 1.
// Positive values produce a white pixel, negative values produce red.
// Pixels are scaled relative to the returned value.
*/
function tixy(t, i, x, y) {
// return i / 256;
//return (x + y) % 2;
// return random(-1, 1);
return 3 - (i + t) % 6;
//return (x + y) / 32;
//return cos(t + i + x * y);
//return 4 * t & i & x & y;
//return sin(x/2) - sin(x-t) - y+6;
//return x + y - ((t * 10) % 32)
//return ((x^y)%2?sin:cos)(t)
//return sin(t-sqrt((x-7.5+sin(t * .75) * 2)**2+(y-7.5+cos(t * .25) * 2)**2));
//return s=Math.sin,c=Math.cos,(x+y)%2?x*s(t)+y*c(t):y*c(t)+x*s(t);
//return (((x-8)/y+t*5)&1^1/y*8&1)*y/5;
//return d=y*y%5.9+1,!((x+t*50/d)&15)/d;
//return 'p}¶¼<¼¶}p'.charCodeAt(x)&2**y;
//return x==0 | x==15 | y==0 | y==15;
// return (x-8)*(y-8) - sin(t)*64;
// return cos(t + x) % sin(t + y);
}