Where is the "stage" put in the program?

From ggc

Jump to: navigation, search

Declare it with the instance variables:

private int stage;

Initialize it in the startGame method body:

stage=0;

Use it in advanceFrame:

if(stage==0)
{
    //do something
}
else if(stage==1)
{
    //do something different
}
else if(stage==2)
{
    //do something else different
}

Somewhere in the advanceFrame method you will need to update it when it changes from the first part of the game to the part where they stay/switch:

stage=1;




Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter