Exemple #1
0
        public override void Update(UpdateState state)
        {
            switch (this.state)
            {
            case LandManagerState.loading:

                if (land.isLoaded())
                {
                    if (minimapFinishLoadAnimation == null)
                    {
                        minimapLoopAnimation.destroy();
                        minimapLoopAnimation = null;
                        Vector2 minimapPosition = UserInterfaceManager.getCurrentUpperLeftCorner() + new Vector2(100f, 100f);
                        minimapFinishLoadAnimation = new Animation(world, minimap, minimapPosition, 0f, new Vector2(200f, 200f), 1.2f, Animation.InterpolationType.linear, true);
                    }
                    else if (minimapFinishLoadAnimation.isFinished())
                    {
                        minimapFinishLoadAnimation.destroy();
                        minimapFinishLoadAnimation = null;

                        loadPreviewer = null;

                        Rectangle activeBoxArea = gameManager.getActiveBoxArea();
                        activeBox  = new LandActiveBox(land, world, new Point(activeBoxArea.Width, activeBoxArea.Height));
                        landCamera = activeBox.camera;

                        LandCameraControl control   = new LandCameraControl(land, landCamera);
                        HumanPlayer       metaHuman = new HumanPlayer(land);
                        LandHumanPlayer   human     = new LandHumanPlayer(land, metaHuman, gameManager);

                        PlayerManager.getPlayer("player1").addControlable(human);

                        control.setAnchor(human);

                        land.addContentRequirer(human);
                        land.addUpdateNode(human);

                        activeBox.position = UserInterfaceManager.getUserInterfaceArea("activebox").getCenter();

                        this.state = LandManagerState.inland;
                    }
                }
                break;

            case LandManagerState.inland:
                land.Update(state);
                break;
            }
        }
Exemple #2
0
        public override void Update(UpdateState state)
        {
            switch (this.state)
            {
                case LandManagerState.loading:

                    if (land.isLoaded())
                    {
                        if (minimapFinishLoadAnimation == null)
                        {
                            minimapLoopAnimation.destroy();
                            minimapLoopAnimation = null;
                            Vector2 minimapPosition = UserInterfaceManager.getCurrentUpperLeftCorner() + new Vector2(100f, 100f);
                            minimapFinishLoadAnimation = new Animation(world, minimap, minimapPosition, 0f, new Vector2(200f, 200f), 1.2f, Animation.InterpolationType.linear, true);
                        }
                        else if(minimapFinishLoadAnimation.isFinished())
                        {
                            minimapFinishLoadAnimation.destroy();
                            minimapFinishLoadAnimation = null;

                            loadPreviewer = null;

                            Rectangle activeBoxArea = gameManager.getActiveBoxArea();
                            activeBox = new LandActiveBox(land, world, new Point(activeBoxArea.Width, activeBoxArea.Height));
                            landCamera = activeBox.camera;

                            LandCameraControl control = new LandCameraControl(land, landCamera);
                            HumanPlayer metaHuman = new HumanPlayer(land);
                            LandHumanPlayer human = new LandHumanPlayer(land, metaHuman, gameManager);

                            PlayerManager.getPlayer("player1").addControlable(human);

                            control.setAnchor(human);

                            land.addContentRequirer(human);
                            land.addUpdateNode(human);

                            activeBox.position = UserInterfaceManager.getUserInterfaceArea("activebox").getCenter();

                            this.state = LandManagerState.inland;
                        }
                    }
                    break;
                case LandManagerState.inland:
                    land.Update(state);
                    break;
            }
        }