Hi,
I have a game which is an iPhone adaptation of this game. Here my ship makes paths and then the enclosed path gets filled if there is no enemy present in that enclosed area.
I have taken the playField as a 2D array (int playField[300][300]).
When the color of the enclosed path needs to be changed to show that it is filled, the path of the ship is flagged 2 and the area enclosed is flagged 1. So i have fill the area where
playFieldCountX=300, playFieldCountY=300;
for (int i=0; i<playFieldCountX; i++) {
for (int j=0; j<playFieldCountY; j++) {
if(playField[i][j]==0){
"What comes here??" }
I am currently filling the path by CGContextMoveToPoint, AddLineToPoint and then StrokePath of Quartz which is taking too much time.
Is there anything more simple? Like predefining a 1x1 image and rendering it at every pixel? Or just getting and setting the color of each pixel?
PS: I dont know OpenGL. If what you explain relates to OpenGL, please be more detailed about it. Thank you.