Skip to content

Commit

Permalink
fix: тонущая органика
Browse files Browse the repository at this point in the history
    Тонущая органика останавливается и остается в подвешенном состоянии
    при столкновении с препятствием.

    fixes #13
  • Loading branch information
xlam committed Nov 8, 2018
1 parent 9536bbe commit aa36b78
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/ru/cyberbiology/Bot.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ public Bot(World world) {
* мозга-генома
*/
public void step() {
/*
if(alive == LV_ORGANIC_SINK || alive == LV_ORGANIC_HOLD)
{
botMove(this, 5, 1);
}*/
if (alive == LV_FREE || alive == LV_ORGANIC_HOLD || alive == LV_ORGANIC_SINK) {
botMove(this, 5, 1);
if (alive == LV_FREE || alive == LV_ORGANIC_HOLD) {
return;
}
else if (alive == LV_ORGANIC_SINK) {
// движение вниз в абсолютном направлении и остановка, если
// уперлись в препятствие
if (botMove(this, 5, 1) != 2) {
alive = LV_ORGANIC_HOLD;
}
return; //Это труп - выходим!
}

Expand Down

0 comments on commit aa36b78

Please sign in to comment.