xxxxxxxxxx
196
//How do I make the mouse restart at a certain position after it touches the black lines or makes it to the end
//How do I make the black lines return to their positions after they make it to the middle
//Remember to make it faster after they make it and return it back to the start after they lose
//what is the cause of the ending shape
//make it so that if the mouse touches the line, the score becomes 0 and it starts again
var y = 100;
var otherY = 300;
var score = 0;
function setup() {
createCanvas(400, 400);
mouseY = 200;
}
function draw() {
background(255,255,255,10);
textAlign(CENTER);
//text("Press Enter for New Color",200,30);
text("Don't Touch the Black Line",200,30);
text("Move Your Mouse to the Other Side. Press Enter to Start",200,50);
text("Score:" + score,200,380);
//stroke(5,5,5);
//if (score == 1){
//y = y + 0.1;
//otherY = otherY - 0.1;
//}
if (score == 1){
y = y + 0.2;
otherY = otherY - 0.2;
}
if (score == 2){
y = y + 0.3;
otherY = otherY - 0.3;
}
if (score == 3){
y = y + 0.6;
otherY = otherY - 0.6;
}
if (score >= 4){
background(0,0,0,255);
stroke(255,255,255);
text("You Win!",200,200);
//make mouse at 400
}
if (y == 200){
y = 100
}
if (otherY == 200){
otherY = 100
}
if (mouseY < y + 35) {
} else{
strokeWeight(50);
line(0,y,400,y);
line(0,otherY,400,otherY);
y = y + 0.1;
y = 100;
}
if (keyCode === ENTER){
y = y + 0.1;
otherY = otherY - 0.1;
//stroke(random(256),random(256),random(256));
}
if (mouseX == y){
y = 100;
score = 0;
//mouse = 0;
}
if (mouseY == y){
y = 100;
score = 0;
//mouse = 200;
}
if (mouseX == otherY){
otherY = 300;
score = 0;
//mouse = 0;
}
if (mouseY == otherY){
otherY = 300;
score = 0;
//mouse = 200;
}
}
function keyPressed(){
if (keyCode === ENTER){
y = y + 1;
otherY = otherY - 1;
//stroke(random(256),random(256),random(256));
}
}
function mouseMoved(){
strokeWeight(30);
line(pmouseX,pmouseY,mouseX,mouseY,50,50);
if (mouseX >= 400){
y = 100;
otherY = 300;
mouseX = 0;
score = score + 1;
}
}
var score = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255,255,255,10);
textAlign(CENTER);
//text("Press Enter for New Color",200,30);
text("Don't Touch the Black Line",200,30);
text("Move Your Mouse to the Other Side. Press Enter to Start",200,50);
text("Score:" + score,200,380);
//stroke(5,5,5);
strokeWeight(50);
line(0,y,400,y);
line(0,otherY,400,otherY);
if (score == 1){
y = y + 0.1;
otherY = otherY - 0.1;
}
if (score == 1){
y = y + 0.2;
otherY = otherY - 0.2;
}
if (score == 2){
y = y + 0.3;
otherY = otherY - 0.3;
}
if (score == 3){
y = y + 0.6;
otherY = otherY - 0.6;
}
if (score >= 4){
background(0,0,0,255);
stroke(255,255,255);
text("You Win!",200,200);
//make mouse at 400
}
if (y == 200){
y = 100
}
if (otherY == 200){
otherY = 100
}
if (keyCode === ENTER){
y = y + 0.1;
otherY = otherY - 0.1;
//stroke(random(256),random(256),random(256));
}
if (mouseX == y){
y = 100;
score = 0;
//mouse = 0;
}
if (mouseY == y){
y = 100;
score = 0;
//mouse = 200;
}
if (mouseX == otherY){
otherY = 300;
score = 0;
//mouse = 0;
}
if (mouseY == otherY){
otherY = 300;
score = 0;
//mouse = 200;
}
}
function keyPressed(){
if (keyCode === ENTER){
y = y + 1;
otherY = otherY - 1;
//stroke(random(256),random(256),random(256));
}
}
function mouseMoved(){
strokeWeight(30);
line(pmouseX,pmouseY,mouseX,mouseY,50,50);
if (mouseX >= 400){
y = 100;
otherY = 300;
mouseX = 0;
score = score + 1;
}
}