Example #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);
        }
Example #2
0
        public void execute()
        {
            Command temp = command;

            while (command != null && command.getTime() < TimerManager.instance.getCurrentTime())
            {
                command = command.next;
                if (temp.next != null)
                {
                    temp.next.prev = null;
                }
                else
                {
                    command = null;
                }
                temp.next = null;
                temp.prev = null;
                temp.execute();
                temp = command;
            }
        }