ign="justify"> toTable ();. Inv ();
}
state = stateBackup;;
} go ()
{(state)
{1:
up (); break; 2:
left (); break; 3:
down (); break; 4:
right (); break;
}
} goBack ()
{(! rightRot ("test")) (! leftRot ("test")) (state)
{1: down (); break; 2: right (); break; 3: up (); break; 4: left (); break;
}
} push ()
{sh = newShot (this);
score - = 40; thr = newThread (sh.go);
thr.Start ();
} inMe (int x, int y, bool fl = false)
{(y == 0 && fl)
{(int i = 0; i <4; i + +)
{(coord [i, 0] == x);
}
} (x == 0 && fl)
{(int i = y + 1; i <4; i + +)
{(coord [i, 1] == y);
}
} (int i = 0; i <4; i + +)
{(coord [i, 0] == x && coord [i, 1] == y);
};
} destroy ()
{
remove ();. Inv ();
} wounded ()
{
health -;
score - = 50;
toTable (); (health == 0)
{. Tanks_.GameOver (name);
}. MF.updateT ();
} cheatUse (string dir)
{(cheat == 0);
cheat -; (cheat> = 0)
{(dir == "l")
{
left ();
} (dir == "r")
{
right ();
}
};
score - = 200;. MF.updateT ();
}
}
}
КлассTanks - відповідає за ігровий процес гри
{
{thr; Tank_; Tank_1; gOver = false; Start ()
{
ClearTable ();
thr = newThread (newThreadStart (tableProc));
thr.Start ();
} tableProc ()
{
Tank_ = newTank ("down", true);
Tank_1 = newTank ("up", true);. Inv ();
} isTable (Tank t)
{(int i = 0; i <4; i + +)
{(MainWindow.table [t.coord [i, 0], t.coord [i, 1]] == true);