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);
        }
Beispiel #2
0
        public override void translate(float xOffset, float yOffset)
        {
            GameObjectTree columnTemp = activeColumns;
            int            i          = 0;

            //collisionComponent.setPosition(collisionComponent.getPosX() + xOffset, collisionComponent.getPosY() + yOffset);
            while (columnTemp != null)
            {
                columnTemp.translate(xOffset, yOffset);
                columnTemp = columnTemp.nextNode;
                i++;
            }
            setCollisionComponent();
        }