Tenstrike Trio(連撃の三重奏)
const SX = 1000;
const SY = 1000;
const CX = SX / 2;
const CY = SY / 2;
const R = 480;
function pointLine(px, py, qx, qy, count) {
for (let i = 0; i < count; i++) {
let amt = i / count;
let x = lerp(px, qx, amt);
let y = lerp(py, qy, amt);
point(x, y);
}
}
function player(x, y) {
stroke(color(0, 0, 255, 204));
fill(color(0, 255, 255, 204));
circle(x, y, 16);
noStroke();
fill(color(0, 0, 255, 255));
circle(x, y, 4);
}
function neurolink(x, y) {
stroke(color(0, 153, 0, 153));
fill(color(0, 255, 0, 51));
circle(x, y, 64);
}
function neurolinks() {
for (let i = 0; i < 3; i++) {
let th = i / 3 * TWO_PI - HALF_PI + PI / 3;
let x = CX + 0.5 * R * cos(th);
let y = CY + 0.5 * R * sin(th);
neurolink(x, y);
}
}
function earthShakerCircle(x, y) {
stroke(color(153, 51, 0, 153));
fill(color(255, 102, 0, 51));
circle(x, y, R / 3);
}
function earthShakerArc(px, py, qx, qy) {
let start = atan2(qy - py, qx - px) - QUARTER_PI;
let stop = start + HALF_PI;
let d = 4 * R;
stroke(color(153, 153, 0, 153));
fill(color(255, 255, 0, 51));
arc(px, py, d, d, start, stop, PIE);
}
function tenstrikeTrioEarthShakerArc(th) {
let px = 0.5 * SX;
let py = 0.5 * SY;
earthShakerArc(px, py, px + cos(th), py + sin(th));
}
function tenstrikeTrioEarthShakerCircle(th) {
let r = 0.5 * R;
let x = r * cos(th) + CX;
let y = r * sin(th) + CY;
earthShakerCircle(x, y);
}
function tenstrikeTrioEarthShakerPlayer(th) {
let r = 0.5 * R;
let x = r * cos(th) + CX;
let y = r * sin(th) + CY;
player(x, y);
}
function tenstrikeTrioGuideLine() {
stroke(color(0, 0, 0, 51));
noFill();
rect(CX - 24, CY - 0.5 * R - 24, 48, 48);
rect(CX - 24, CY - 24, 48, 48);
strokeWeight(4);
pointLine(CX + R, CY, CX, CY, 20);
pointLine(CX - R, CY, CX, CY, 20);
strokeWeight(1);
}
function tenstrikeTrioGuideLine1() {
tenstrikeTrioGuideLine();
for (let i = 0; i < 5; i++) {
let th = i / 5 * TWO_PI - HALF_PI;
let x = CX + R * cos(th);
let y = CY + R * sin(th);
line(CX, CY, x, y);
}
strokeWeight(4);
pointLine(CX + cos(QUARTER_PI) * R, CY + sin(QUARTER_PI) * R, CX, CY, 20);
pointLine(CX - cos(QUARTER_PI) * R, CY + sin(QUARTER_PI) * R, CX, CY, 20);
strokeWeight(1);
}
function tenstrikeTrioGuideLine2() {
tenstrikeTrioGuideLine();
for (let i = 0; i < 5; i++) {
let th = i / 5 * TWO_PI + HALF_PI;
let x = CX + R * cos(th);
let y = CY + R * sin(th);
line(CX, CY, x, y);
}
strokeWeight(4);
pointLine(CX + cos(QUARTER_PI) * R, CY - sin(QUARTER_PI) * R, CX, CY, 20);
pointLine(CX - cos(QUARTER_PI) * R, CY - sin(QUARTER_PI) * R, CX, CY, 20);
strokeWeight(1);
}
function tenstrikeTrioEarthShaker1() {
tenstrikeTrioGuideLine1();
tenstrikeTrioEarthShakerArc(0.2 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerArc(0.4 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerArc(0.6 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerArc(0.8 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.2 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.4 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.6 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.8 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.2 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.4 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.6 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.8 * TWO_PI - HALF_PI);
let x = CX;
let y = CY - 0.5 * R;
let d = 24;
player(x - 24, y - 24);
player(x - 24, y + 24);
player(x + 24, y - 24);
player(x + 24, y + 24);
}
function tenstrikeTrioEarthShaker2() {
tenstrikeTrioGuideLine2();
tenstrikeTrioEarthShakerArc(0.1 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerArc(0.3 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerArc(0.7 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerArc(0.9 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.1 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.2 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.3 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.4 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.6 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.7 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.8 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerCircle(0.9 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.1 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.3 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.7 * TWO_PI - HALF_PI);
tenstrikeTrioEarthShakerPlayer(0.9 * TWO_PI - HALF_PI);
player(CX, CY + 0.4 * R);
}
function setup() {
createCanvas(SX, SY);
}