i have a MainActor and a score named "lives" :
on "lives" :
add Event CreateActor
add Action Script Editor and write :
count=0;
// count being a global variable.
on MainActor :
add Event KeyDown ( c-key )
add Action Script Editor and write :
count++;
lives.TextNumber=count;
So, when i press "c", my score increases.
Then what i did is the following :
Create New Actor named "test".
add Event Draw Actor
add Action Script Editor and write :
int count=0;
void saveFiles()
{
FILE *arq = fopen ("count" , "wb");
if (arq)
{
fprintf (arq, "%dl", count);
fclose (arq);
}
}
void loadFiles()
{
FILE *arq = fopen ("count" , "rb");
if(arq)
{
fscanf (arq, "%dl", &count);
fclose (arq);
}
}
Still when i press on Add, it says = Redeclaration of "count".
Have i misunderstood something ?
