/*
* pattern.cpp
*
* Created on: 31-Oct-2012
* Author: Praveen Ojha
*/
#ifndef patt_h
#define patt_h
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////You need batteries here they are///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static int coinpatterns1[8][9]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
void Game::drawPattern(JNIEnv *env,float dt,int x,int y,int grp,int index,float angle)
{
int pa[9][8][9]=
{ {{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,1,0,0,1,0,0},
{0,0,0,0,0,0,0,0,0},
{0,1,0,0,0,0,0,0,0}},
{{0,0,0,0,1,0,0,0,0},
{0,0,1,0,0,0,0,1,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,1,0,0,0,0,1,0},
{0,0,0,1,0,0,1,0,0}},
{{0,0,0,0,0,0,0,0,1},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,1,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,1,0,0,0,0,0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0,0,0},
{0,0,1,1,0,0,1,0,0},
{0,0,0,1,0,1,0,0,0},
{0,0,0,0,1,0,0,0,0},
{0,0,0,1,0,1,0,0,0},
{0,0,1,1,0,0,1,0,0},
{0,0,0,1,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0}};
/*/
int i=0;
while(i<8)
{
int ay=y-(3.5*28)+28*i;
int h=0;
while (h<9)
{int ax=x-(4*28)+28*h;
__android_log_print(ANDROID_LOG_VERBOSE,"Log", "The value of 1 + 1 is %d", pa[index][h][i]);
if((pow((gd.herox -ax),2.0)+pow((gd.heroy -ay),2.0))<100)
{gd.coins++;
engine::playsound(env,gd.Scoin);
coinpatterns1[i][h]=1;
}
if(pa[index][i][h]==1&&coinpatterns1[i][h]==0)
{drawitems(env,0,ax,ay,5,0,0);
}
else
{//gd.batx[i*8+h]=-100;
//gd.baty[i*8+h]=-100;
}
h++;
};
i++;
}
}
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////Some problem using this will fix soon ///////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////