xxxxxxxxxx
104
let x
let y
let xSpeed
let ySpeed
Cbfootprint = 0
q1value = 0
q2value = 0
q3value = 0
q4value = 0
q5value = 0
q6value = 0
q7value = 0
q8value = 0
q9value = 0
q10value = 0
function setup() {
background(220);
createCanvas(windowWidth, windowHeight)
question1 = createP("How often do you eat meat in a week? A. Rarely B. Often. C.Everyday D. Never")
question1.position(0, 20)
input1 = createInput()
input1.position(200, 70)
question2 = createP("Do you turn off the lights when you leave a room? A. Rarely B. Often C. Always D. Never")
input2 = createInput()
input2.position(-1000, 1000)
question3 = createP("How do you get to work or school? A. Public Transportation B. Car C. Walking/Biking")
input3 = createInput()
input3.position(-1000, 1000)
question4 = createP("What do you mostly eat? A. Home Cooked meals B. Fast Food C. A good mix of both")
input4 = createInput()
input4.position(-1000, 1000)
question5 = createP("Do you unplug appliances/chargers when they're not being used? A. Yes B. No C. Sometimes")
input5 = createInput()
input5.position(-1000, 1000)
question6 = createP("How do you dry your clothes? A. Dryer B. Hang To dry C. Both")
input6 = createInput()
input6.position(-1000, 1000)
question7 = createP("Do you turn off the water when burshing your teeth? A. Yes B. No C. Bit of both")
input7 = createInput()
input7.position(-1000, 1000)
question8 = createP("Do you turn off the TV when you're not watching it? A. yes B. No")
input8 = createInput()
input8.position(-1000, 1000)
question9 = createP("Do you turn off your video game system when you're not using it? A. Yes B. No C. I don't own/use one")
input9 = createInput()
input9.position(-1000, 1000)
question10 = createP("What do you mainly recycle? A. I don't recycle B. Paper (Magazines, newspapers, etc.) C. Glass D. Plastic E. Cans F. All of the above")
input10 = createInput()
input10.position(-1000, 1000)
button = createButton("Click me!");
button.mousePressed(add);
button.position(155, 110)
x = random(0,width)
y = random(0,height)
xSpeed = random(1,5)
ySpeed = random(1,5)
frameRate(20000)
}
function draw(){
//background("black")
// Strive.drawTickAxes()
//x,y, diameter
button = createButton('Ball Run');
button.position(350, 450);
//rgb
// 0 -> 255
let red = random(0,255)
let green = random(0,255)
let blue = random(0,255)
fill(red,green,blue)
text(200,200,"Hi")
textSize(32);
text('', 10, 30);
fill(0, 102, 153);
text('word', 10, 60);
fill(0, 102, 153, 51);
text('word', 10, 90);
x = x + xSpeed
y = y + ySpeed
circle(x,y,50)
if(x > width || x < 0){
xSpeed = -xSpeed
}
if(y > height || y < 0){
ySpeed = -ySpeed
}
}