xxxxxxxxxx
134
var font1
var hint
var r,g,b
var john
y=0
function setup() {
createCanvas(600, 600);
frameRate(20)
}
function draw() {
background(39, 39, 39);
r=random(0,100)
g=random(0,255)
b=random(0,255)
for(let i=0.8; i<3.8; i++){
for(let j=2; j<7; j++){
if(i%2 == 0){
fill(0, 0, 0);
}else{
fill(100, 219, 240);
}
if(j%2){
fill(255, 184, 100);
}
ellipse(i*80+30, j*80+10,100,100);
}
}
for(let i=0.8; i<3.8; i++){
for(let j=2; j<7; j++){
if(i%2 == 0){
fill(0, 0, 0);
}else{
fill(g, 219, 240);
}
if(j%2){
fill(255, 184, b);
}
ellipse(i*80+30, j*80+10,cos(millis()/200) * 30,cos(millis()/200) * 30);
}
}
push()
textSize(25)
textFont(font1)
fill(255, 184, 82)
text("Help find", 60,100)
pop()
textSize(40);
text("🎸", 250, 100);
push()
textSize(25)
textFont(font1)
fill(198, 254, 254)
text("Hint", 430,100)
pop()
image(john,24,5)
textSize(25)
text("↕️", 530,230)
push()
if (mouseIsPressed && mouseX>220 &mouseX<285 & mouseY>370 &mouseY <434) {
textSize(28);
text("🎸", 240, 417);
} else {
textSize(0.1);
stroke(0, 0, 0);
text("no", 170, 30);
pop()
}
for(let i=14; i<17; i++){
for(let j=12; j<17; j++){
if(i%2 == 0){
fill(186,186,186);
}else{
fill(200,200,200);
}
if(j%2){
fill(170,170,170);
}
rect(i*30, j*30, 30, 30);
}
}
//let x1 = map(mouseY, 0, height, 200, 500, true);
image(hint,0,0+y)
if(keyIsPressed){
if(key =="ArrowUp"){
y = y-5
}
}
if(keyIsPressed){
if(key =="ArrowDown"){
y = y+5
}
}
}
function keyPressed(){
if (key == "ArrowUp"){
y = y-10
}
if (key == "ArrowDown"){
y=y+10
}
}
function preload(){
font1=loadFont("font1.ttf")
hint=loadImage("hintcc.jpg")
john=loadImage("john.png")
}