Hi, I’m making a simple 2D game in it I have three rows of of fifteen circles that need to be randomly generated as blue, green or red. I was wondering if you all would be able to explain how to randomize the three colors, or maybe point me in the direction of a good tutorial?
though since I’m calling it in my draw function it’s being called repeatedly, thus flashing all three colors o.o
so I’m working on a for loop to draw one row of fifteen circles, so I can then use a pointer in my main function which only gets called once. I’m getting errors though so I’ll make a new thread I suppose since this topic’s been closed. If this is against policy do let me know.
And I’m using the opengl library, to draw the shapes so I thought this was were my question belonged. If you still don’t see the connection in my new thread should I try a C programming forum? Since this is a combination of OpenGL and C?
Yeah, these issues really seem like they belong in a general programming forum. You probably want to store the colour variable in the circle class and have it randomized upon circle creation, and then, in the drawing code, have your program use each specific circle’s colour as you render them.