int circleX;
int speedX = 5;
int circleY;
int speedY = 3;
int rectX= 0;
int rectY= 0;
int rect0= rectX + 70;
int rect1 = rectY + 30;
int rectp= 70;
int rectv= 30;
int rect2= rectX + 140;
int rect3 = rectY + 60;
int recto= 140;
int rectm= 0;
int rect4= rectX + 210;
int rect5 = rectY + 30;
int rectl= 210;
int rectr= 30;
int rect6= rectX + 280;
int rect7 = rectY + 60;
int rectq= 280;
int rectw= 0;
int rect8= rectX + 350;
int rect9 = rectY + 30;
int rectj= 350;
int rectk= 30;
int rect10= rectX + 420;
int rect11 = rectY + 60;
void setup () {
size(640,360);
circleX = 50;
circleY = 160;
}
void draw() {
background(0);
fill(255);
ellipse(circleX,circleY,24,24);
fill(0,0,255);
rect(rectj,rectk,70,30);
fill(255,0,0);
rect(recto,rectm,70,30);
fill(255,0,0);
rect(rectq,rectw,70,30);
fill(0,0,255);
rect(rectl,rectr,70,30);
fill(255,0,0);
rect(rectX,rectY,70,30);
fill(0,0,255);
rect(rectp,rectv,70,30);
fill(200);
rect(mouseX,340,100,20);
circleX = circleX + speedX;
circleY = circleY + speedY;
if (circleX > width) {
speedX = -5;
}
if (circleX < 0) {
speedX = 5;
}
if (circleY < 0) {
speedY = 3;
}
if ((circleX > mouseX)&&(circleY > 340 )&&(circleX<mouseX+100)){
speedY = -3;
}
if (circleY > 350 ){
speedY = 3;
}
if ((circleX >= rectX)&&(circleX <= rect0)&&(circleY>=rectY)&&(circleY<=rect1)) {
rectX = rectX + -500;
}
if ((circleX >= rectp)&&(circleX <= rect2)&&(circleY>=rectv)&&(circleY<=rect3)) {
rectp = rectp + -500;
}
if ((circleX >= recto)&&(circleX <= rect4)&&(circleY>=rectm)&&(circleY<=rect5)) {
recto = -500;
}
if ((circleX >= rectl)&&(circleX <= rect6)&&(circleY>=rectr)&&(circleY<=rect7)) {
rectl = -500;
}
if ((circleX >= rectq)&&(circleX <= rect8)&&(circleY>=rectw)&&(circleY<=rect9)) {
rectq = -500;
}
if ((circleX >= rectj)&&(circleX <= rect10)&&(circleY>=rectk)&&(circleY<=rect11)) {
rectj = -500;
}
}
arkanoid game
old game

Comments
Please log in or sign up to comment.