public void translate() { if (status == Status.Active) { if (!isHit) { alienTree.translate(direction.moveX() * distance, direction.moveY() * distanceDown); } else { alienTree.translate(directionDown.moveX() * distance, directionDown.moveY() * distanceDown); isHit = false; } //alienTree.performLowest(0); //alienTree.performLowest(6); animationCommand.execute(); } float a = (float)(((float)alienTree.totalActive()) / ((float)alienTree.getTotalElements())); long t = (long)(a * (float)timeOffset); Console.WriteLine(t); translationCommand.setTimeOffset(t); Receiver.instance.addCommand(translationCommand); }
public virtual int totalActive() { if (this.currentStatus == Status.Active) { int i = 0; GameObjectTree columnTemp = activeColumns; while (columnTemp != null) { if (columnTemp.getStatus() == Status.Active) { i = i + columnTemp.totalActive(); } columnTemp = columnTemp.nextNode; } return(i); } else { return(0); } }