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; } }
public void StartFight(Creature playerCreature, Creature otherCreature, Land land, Vector2 position) { fightWorld = new FightWorld(land, position, playerCreature, otherCreature); this.playerCreature = playerCreature; this.enemyCreature = otherCreature; Rectangle rect = gameManager.getActiveBoxArea(); activeBox = new ActiveBox(gameManager.world, new Camera(rect.Width, rect.Height, fightWorld)); activeBox.position = UserInterfaceManager.getUserInterfaceArea("activebox").getCenter(); activeBox.texture.filter = Color.Transparent; fadeTime = 1f; fightState = FightState.starting; }