update
This commit is contained in:
parent
5c8e3ae20c
commit
91d471ea15
@ -21,7 +21,7 @@
|
|||||||
function draw() {
|
function draw() {
|
||||||
background(0);
|
background(0);
|
||||||
|
|
||||||
drawGrid(32);
|
drawGrid(255, 32);
|
||||||
textInfo("作品模板", "2022-12-12");
|
textInfo("作品模板", "2022-12-12");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(0);
|
background(0);
|
||||||
drawGrid(32);
|
drawGrid(255, 32);
|
||||||
单摆.draw();
|
单摆.draw();
|
||||||
单摆.update();
|
单摆.update();
|
||||||
textInfo("单摆", "2022-12-14");
|
textInfo("单摆", "2022-12-14");
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(255);
|
background(255);
|
||||||
drawGrid(32, 0);
|
drawGrid(0);
|
||||||
|
|
||||||
let hx = width / 2;
|
let hx = width / 2;
|
||||||
let hy = 100;
|
let hy = 100;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
function draw() {
|
function draw() {
|
||||||
clear();
|
clear();
|
||||||
background(0);
|
background(0);
|
||||||
drawGrid(32);
|
drawGrid(255);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
mouseIsPressed &&
|
mouseIsPressed &&
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(0);
|
background(0);
|
||||||
drawGrid(32);
|
drawGrid(255);
|
||||||
|
|
||||||
for (let i = 0; i < plantsNumber; i++) {
|
for (let i = 0; i < plantsNumber; i++) {
|
||||||
planets[i].update();
|
planets[i].update();
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
clear();
|
clear();
|
||||||
background(64);
|
background(0);
|
||||||
drawGrid();
|
drawGrid();
|
||||||
转盘.update();
|
转盘.update();
|
||||||
转盘.draw();
|
转盘.draw();
|
||||||
@ -67,8 +67,8 @@
|
|||||||
draw() {
|
draw() {
|
||||||
push();
|
push();
|
||||||
// 绘制盘面
|
// 绘制盘面
|
||||||
fill(0);
|
fill(200);
|
||||||
stroke(200);
|
stroke(128);
|
||||||
strokeWeight(2);
|
strokeWeight(2);
|
||||||
translate(this.x, this.y);
|
translate(this.x, this.y);
|
||||||
circle(0, 0, 500);
|
circle(0, 0, 500);
|
||||||
@ -85,7 +85,7 @@
|
|||||||
// 绘制文字
|
// 绘制文字
|
||||||
push();
|
push();
|
||||||
noStroke();
|
noStroke();
|
||||||
fill(200);
|
fill(0);
|
||||||
if (i == Math.floor(this.hand.heading / 每一格的角度)) {
|
if (i == Math.floor(this.hand.heading / 每一格的角度)) {
|
||||||
fill("red");
|
fill("red");
|
||||||
stroke("yellow");
|
stroke("yellow");
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(0);
|
background(0);
|
||||||
drawGrid(32);
|
drawGrid(255);
|
||||||
playdemos([追逐鼠标, 小车追逐, 小车巡游, 小车巡线], 10);
|
playdemos([追逐鼠标, 小车追逐, 小车巡游, 小车巡线], 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(0);
|
background(0);
|
||||||
drawGrid(32);
|
drawGrid(255);
|
||||||
noFill();
|
noFill();
|
||||||
strokeWeight(2);
|
strokeWeight(2);
|
||||||
stroke("lightgreen");
|
stroke("lightgreen");
|
||||||
|
@ -5,11 +5,14 @@ function loadJavaScript(path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function playdemos(list, delay = 10) {
|
function playdemos(list, delay = 10) {
|
||||||
let n = Math.floor((frameCount / (delay * 60)) % list.length);
|
let fps = frameRate();
|
||||||
list[n]();
|
fps = 60;
|
||||||
|
let n = floor((frameCount / (delay * fps)) % list.length);
|
||||||
|
let func = list[n];
|
||||||
|
func();
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawGrid(fade = 64, color = 255) {
|
function drawGrid(color = 255, fade = 32) {
|
||||||
push();
|
push();
|
||||||
colorMode(RGB);
|
colorMode(RGB);
|
||||||
stroke(color, fade);
|
stroke(color, fade);
|
||||||
|
Loading…
Reference in New Issue
Block a user