xxxxxxxxxx
74
let raleway;
let bug;
let t2;
let fillVal = 126;
let b1;
function preload() {
raleway = loadFont('data/Raleway-Medium.ttf');
img = loadImage('data/bonescape.jpg');
}
function setup() {
//createCanvas(windowWidth, windowHeight, WEBGL);
createCanvas(200, 200, WEBGL);//wordpress size
textFont(raleway);
//constructor(x, y, speed)
bug = new endTitle(2, 2, -1);//arguments
t2 = new endTitle2();
//b1 = new Bone();
//add boundary from icoMod pc
let y1 = createVector(10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0);
//set an array vectors responsive to height
let f = y1.array();
//print(y1[0]); // Prints "10.0"
//print(y1[1]); // Prints "20.0"
print(f[3]); // Prints "30.0"
// problem reading more than three positions
}
function draw() {
background(0);
//translate(-width/2,-height/2,0);////moves our drawing origin to the top left corner
bug.display();
bug.move();
//b1.display();
//rectMode(CENTER);
fill(fillVal);
rect(-12.5, 75, 25, 25);
let time = millis();
let time2 = second();
//rotating text
textAlign(CENTER, CENTER);
fill('#00ff00');//green zones
rotateX(time / 1000);
rotateZ(time / 1234);
textSize(width/4);
text('Hidden', 0, -40);
text('Forest', 0, 20);
push();
textSize(20);
fill(255);
text(time2 + " s", -80, -70);
text(time + " ms", -50, -90);
pop();
image(img, -mouseX, 0, 100, 100);
tint(255, 126); // Apply transparency without changing color
image(img, -12.5, 0, 100, 100);//bone
}
function keyPressed() {
if (keyCode === UP_ARROW) {
fillVal = 255;
} else if (keyCode === DOWN_ARROW) {
fillVal = 0;
}
return false; // prevent default
}
function mouseMoved() {
t2.display();
}