need help with a game please
in
Programming Questions
•
2 years ago
so i want to make a game where the mouse has to dodge balls that are bouncing around the screen. so far i am trying to just get 1 ball to bounce around but it just sits there. if someone could help me out that would be great! here is the code so far:
int velocityX;
int currentX,currentY;
void setup()
{
size(300,300);
background(150);
velocityX=1;
currentX=0;
currentY=height/2;
}
void draw()
{
background(150);
ellipse(currentX,currentY,20,20);
currentX=currentX=velocityX;
if(currentX>width)
{
velocityX=velocityX*-1;
}
if(currentX<0)
{
velocityX=velocityX*-1;
}
}
1