Aki Sakata
akisoqls.com

Aki Sakata|akisoqls.com
>> 2018
>>>> 180415

180415

2018

p5.js

var csw = 940;
var csh = 700;
// default
// csw = 940 csh = 700

var pixw = 20;
var pixh = 5;
// default
// pixw = 20 pixh = 5

var speed = 100;
// default
// 100

var wariai = 15
// default
// 10

var xm = 0;
var ym = 0;



var pixx = csw/pixw;
var pixy = csh/pixh;
console.log(pixx,pixy);

function setup() {
createCanvas(csw, csh);

background(255);
}

function draw() {
 name();
}

function name() {
for(var i=0; i<speed; i=i+1){
var x = Math.floor( Math.random()*pixx);
var y = Math.floor( Math.random()*pixy);
var a1 = random(0,wariai);
console.log(a1);
noStroke();
if(csh>530){
rect(pixw/2*x,pixh*y,pixw/2,pixh/2);
rect(pixw/2*x+csw/2,pixh*y,pixw/2,pixh/2);
}
if (
a1<=1
){
var g1 = random(18,160);
var b1 = random(10,20);
fill(255,g1,b1);
}else
if(
a1>1 && a1<=3
){
var r2 = random(18,160);
var g2 = random(10,20);
fill(r2,g2,225);
}else{
var gray =random(240,255);
fill(gray);
}
rect(pixw*x,pixh*y,pixw,pixh);
}
}



別ページで再生

(C) 2017 Aki Sakata