im cant figure out how to make a incresing varible this is what i have
public void act()
{
int incresingturn = (incresingturn + 3 );
turn (incresingturn);
}
Your original post:
public void act()
{
int incresingturn = (incresingturn + 3 );
turn (incresingturn);
}
If you look at this code you have used a local variable in act() what this means that every time you go into
act incrsingturn is reinitialize by default to zero. so you will always get 3.
You neeed to make it a class instance variable which means you should delete the declation
int int incresingturn = (incresingturn + 3 ); from act () method
and place
int incresingturn; underneath your other instance variables like
MyClass{
int incresingturn;
int someOtherVariable;
......
and in the Act method just call your c;lass instance method like so;
incresingturn = (incresingturn + 3 ); // notice no "int" so no local variable
cheers Takashi