Click here to Skip to main content
15,886,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi

I want to create a memory game in opengl , so I create some square (3*3)

by two for like this:

C++
for (float i = 0; i < 3 ; i++)
	{
		for (float j = 0; j < 3 ; j++)
		{
			glPushMatrix();
			glTranslatef(+j/9,-i/9,0);
			squre1();// create a cell
			glPopMatrix();
		}
	}

I want to change color of some squares randomly ,after 2 seconds those cells change to before color,and user should remember witch cell is changed and click on it ...

So I want each square selective and know witch cell is clicked.
The simple solution is use array for manage my work but how do it?
and what another solution ?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900