Hi, I'm making a simple 2D game where you use a cannon to shoot balls of the same color, I'd like to put my three rows of circles into three loops where 15 are drawn and translated over 28 units each time, but I've been running into some issues. Could I get ya'll to take a look at my code and explain what I'm doing wrong?
Here's my code snippet I'm having issues with:
Code:
int Circle1 [20];
for
(Circle1=0; Circle1<15; Circle1++)
{
glPushMatrix();
glTranslatef(d+28,455,1);
random_generator(0,3);
if (randomValue == 0)
{
glColor3f(0,.5,0);
}
else if (randomValue == 1)
{
glColor3f(.5,0,0);
}
else
{
glColor3f(0,0,.5);
}
glLineWidth(1.0);
drawCircle(14,200);
glPopMatrix();
}
When I compile it I get errors for the
Code:
(Circle1=0; Circle1<15; Circle1++)
line of code saying:
In function 'displayFunction':
error: incompatible types when assigning to type 'int[20]' from type 'int'
warning: comparison between point and integer
error: lvalue required as increment operand