public static IGameState GetState(int index) { IGameState state; switch (index) { case 0: state = new LoadingState(); break; case 1: state = new MenuState(); break; case 2: state = new OverworldState(); break; case 3: state = new CutsceneState(); break; default: state = new LoadingState(); break; } return(state); }
public virtual void _on_Tween_tween_completed(Node node, NodePath path) { // set actor to idle if it's position tween has finished if (path == ":position") { State = OverworldState.IDLE; _animationStateMachine.Travel("Idle"); } }
// Update is called once per frame void Update () { switch(overworldState) { case OverworldState.walking: if (player.Walk()) canInteract = true; if(canInteract) if(player.Interact()) { overworldState = OverworldState.interacting; } break; case OverworldState.interacting: break; } }
public bool MoveBy(Vector2 direction) { if (State != OverworldState.IDLE) { return(false); } LookAt(direction); // collision detection if (TestMove(Transform, direction * MoveDistance)) { return(false); } // move and animate _animationStateMachine.Travel("Moving"); _tween.InterpolateProperty(this, "position", Position, Position + direction * MoveDistance, MoveTime); State = OverworldState.MOVING; return(_tween.Start()); }
public void Awake() { this.overworldGameState = OverworldState.PLANNING; // Delegate control of map loading to the OverworldManager. List <HexMapCsv> file = null; // Load the default map if (string.IsNullOrEmpty(hexGrid.mapToLoad)) { HexGridGenerator.GenerateDefault(hexGrid, hexGrid.width, hexGrid.height); } // Load from file else { file = HexMapFileSaver.ReadFile(hexGrid.mapToLoad); HexGridGenerator.GenerateFromFile(hexGrid, file); } this.monsterManager.SetInitialSpawn(this.hexGrid, file); OverworldEventManager.Instance().onHexTileClicked += ProcessTileSelection; }
public MenuRenderer(OverworldState overworldState) : base(overworldState) { whitePixelTextureData = ResourceManager.GetTextureData("white_pixel"); }
public override void Resume(OverworldState previousOverworldState) { base.Resume(previousOverworldState); Time = FadeTimeInSeconds; }
public PlayRenderer(OverworldState overworldState) : base(overworldState) { resetFlash(); playerInvincibleBefore = false; }
public void SetState(OverworldState state) { _currentState = state; StartCoroutine(_currentState.Start()); }
bool CheckOverworldArea(int area, OverworldState state = OverworldState.COLLECTED) { return(CheckFlag("Overworld State", area, state)); }
public EncounterIntroRenderer(OverworldState overworldState) : base(overworldState) { pixelTextureData = ResourceManager.GetTextureData("white_pixel"); }
public EncounterRenderer(OverworldState overworldState) : base(overworldState) { pixelTextureData = ResourceManager.GetTextureData("white_pixel"); }
public override void Resume(OverworldState previousOverworldState) { base.Resume(previousOverworldState); initNpcMovers(); }