예제 #1
0
        public LandHumanPlayer(Land world, HumanPlayer human, GameManager gameManager)
            : base(world,human)
        {
            this.gameManager = gameManager;
            guy = new DrawableTexture("whiteSquare", this);
            guy.size.X = 10f;
            guy.size.Y = 10f;

            encounterTrigger.encounterHandlers += CreatureEncountered;

            physicalProperties = new LandPhysicalProperties();
            physicalProperties.activelyColliding = true;
            physicalProperties.radius = 10f;
            physicalProperties.collisionType = LandCollisionTypes.Solid;
        }
예제 #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;
            }
        }