SketchBook

打ち上げフルーツ

function setup() {
createCanvas(400, 400);
noStroke();
background("#97ece5");

let Count = 1;
setInterval(function() {
let Key_list = ["メロン", "イチゴ","ミカン", "スイカ", "カキ", "キウイ", "モモ", "サクランボ", "ブドウ", "レモン", "ヨウナシ", "バナナ", "アオリンゴ", "パイナップル", "リンゴ", "シャインマスカット"];
let min = 0;
let max = 15;
let One_Size = 2;
let Number = Math.floor(Math.random() * (max + 1 - 0)) + min;
let Draw_X = Math.floor(Math.random() * (400 + 1 - 0)) + 0;
let Draw_Y = Math.floor(Math.random() * (400 + 1 - 0)) + 0;
let name = Key_list[Number];
let List = list(name);
for(let y = 0; y < List.length; y++) {
for(let x = 0; x < List[0].length; x++) {
if(List[y][x] == 0) noFill();
if(List[y][x] == 1) fill("#000000");
if(List[y][x] == 2) fill("#00ff15");
if(List[y][x] == 3) fill("#9dffa5");
if(List[y][x] == 4) fill("#eede12");
if(List[y][x] == 5) fill("#e2dc8d");
if(List[y][x] == 6) fill("#ff0000");
if(List[y][x] == 7) fill("#ee8a8a");
if(List[y][x] == 8) fill("#906c6c");
if(List[y][x] == 9) fill("#246510");
if(List[y][x] == 10) fill("#32398b");
if(List[y][x] == 11) fill("#c0ffa7");
if(List[y][x] == 12) fill("#a5a8f2");
if(List[y][x] == 13) fill("#9061b8");
if(List[y][x] == 14) fill("#40009c");
let X = (x * One_Size) + Draw_X;
let Y = (y * One_Size) + Draw_Y;
rect(X, Y, One_Size);
}
}

if(Count % 20 == 0) {
clear();
background("#97ece5");
}
Count++;
}, 1000);
}

function list(name) {
let Meron = [
[0,0,0,1,0,0,0,0,0,0,0,0,0,0,],
[0,0,0,0,1,1,1,1,1,0,0,0,0,0,],
[0,0,0,0,0,0,1,0,0,0,0,0,0,0,],
[0,0,0,0,0,1,1,1,1,0,0,0,0,0,],
[0,0,0,1,1,0,1,0,3,1,1,0,0,0,],
[0,0,1,3,0,3,0,3,0,3,0,1,0,0,],
[0,1,3,0,3,0,3,0,3,0,3,0,1,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,1,0,0,0,0,1,0,0,0,0,],
[0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,],
[0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,],
[0,0,1,1,1,1,1,1,6,0,1,6,6,1,0,],
[0,1,0,6,1,6,6,1,6,6,6,6,6,6,1,],
[1,0,6,6,6,6,6,6,1,6,6,6,6,6,1,],
[1,6,6,6,6,6,6,6,1,6,6,6,6,6,1,],
[1,6,6,6,6,6,6,6,1,6,6,6,6,6,1,],
[1,6,6,6,6,6,6,6,1,6,6,6,6,6,1,],
[1,6,6,6,6,6,6,6,1,6,6,6,6,1,0,],
[0,1,6,6,6,6,6,1,0,1,1,1,1,0,0,],
[0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,],
];

let Budou = [
[0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,],
[0,0,0,0,0,0,1,1,1,0,1,8,1,0,0,],
[0,0,0,0,0,1,12,13,10,1,1,1,8,1,0,],
[0,0,0,1,1,14,13,13,14,14,1,8,1,8,1,],
[0,0,1,12,13,10,1,14,12,13,10,1,1,1,1,],
[0,0,1,13,13,10,14,1,13,13,10,14,14,1,0,],
[0,0,1,10,13,14,12,13,1,10,1,1,14,10,1,],
[0,0,1,14,14,1,13,13,10,14,10,10,1,14,1,],
[0,1,12,13,10,14,10,10,10,1,10,14,1,14,1,],
[0,1,13,13,10,1,14,14,1,1,1,1,1,1,0,],
[0,1,10,10,10,14,13,10,10,1,14,14,1,0,0,],
[0,1,14,14,1,14,10,10,14,1,14,14,1,0,0,],
[1,12,13,10,14,1,14,14,14,1,1,1,0,0,0,],
[1,13,13,10,14,1,1,1,1,1,0,0,0,0,0,],
[1,14,10,14,14,1,1,1,0,0,0,0,0,0,0,],
[0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,],
];

let Remon = [
[0,0,0,0,0,0,0,0,0,0,0,1,1,0,],
[0,0,0,0,0,0,0,1,1,1,1,11,2,1,],
[0,0,0,0,0,1,1,4,4,4,11,11,2,1,],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,1,9,9,9,9,9,9,9,1,0,],
[0,1,2,2,2,9,2,2,2,9,9,9,1,0,0,],
[0,1,9,9,9,9,2,2,9,9,9,9,1,0,0,],
[1,0,2,2,9,9,9,9,9,9,1,1,0,0,0,],
[1,2,2,2,9,9,9,9,1,1,0,0,0,0,0,],
[1,2,2,9,9,1,1,1,0,0,0,0,0,0,0,],
[0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,],
];

if(name == "メロン") return Meron;
if(name == "イチゴ") return Itigo;
if(name == "ミカン") return Mikan;
if(name == "スイカ") return Suika;
if(name == "カキ") return Kaki;
if(name == "キウイ") return Kiui;
if(name == "モモ") return Momo;
if(name == "サクランボ") return Sakuranbo;
if(name == "ブドウ") return Budou;
if(name == "レモン") return Remon;
if(name == "ヨウナシ") return Younasi;
if(name == "バナナ") return Banana;
if(name == "アオリンゴ") return Aoringo;
if(name == "パイナップル") return Painappuru;
if(name == "リンゴ") return Ringo;
if(name == "シャインマスカット") return Syainmasukatto;
}

Author: takamatsu