int objectX = width/2;
int objectY = 200;
int snelheidY = 1;
int score = 0;
int richting = 1;
int positiebal;
int bal = ellipse(objectX, objectY, 50, 50);
void setup()
{
size(400, 400);
positiebal = height/2
textSize(12);
}
void draw() {
background(0, 0, 0);
ellipse(positiebal, objectY, 50, 50);
if(objectY > 375)
snelheidY = -snelheidY;
if(objectY<25)
snelheidY = -snelheidY
objectY = objectY + snelheidY;
text("score = " +score,4,10);
}
void mousePressed()
{
if (dist(mouseX, mouseY, positiebal, 200)<=200)
{score=score+1;
snelheidY = snelheidY+1
}
}
"" "" "" "" "" "" "" "" "" "" "" "" ""처리 JS 빈 점수와 가속기
나는 다음과 같은 질문이 : 1. 볼이 내려갈 때 볼을 가속 시키지만 볼이 올라갈 때 작동하지 않는 것처럼 보입니다. 2. 점수 시스템은 볼을 눌렀을 때만 올라야하지만, 그렇게하지는 않습니다.
추가 지식이있는 사람이 다음 질문을 설명해주십시오.