Beispiel #1
0
        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);
        }