Esempio n. 1
0
    @Override
    public void update(Actor actor) {
      super.update(actor);

      // update the base animation
      Animation base = getBase((Mobile) actor);
      if (base != null && !base.isPlaying()) {
        base.start();
      }
    }
Esempio n. 2
0
    @Override
    public void update(Actor actor) {
      super.update(actor);

      // update the state animation
      EntryState estate = (EntryState) actor;
      int entered = estate.getStateEntered();
      if (entered > _lastStateEntered) {
        int state = estate.getState();
        Animation anim = (_states != null && state < _states.length) ? _states[state] : null;
        if (anim != null) {
          anim.start();
          anim.tick((_view.getDelayedTime() - entered) / 1000f);
        }
        _lastStateEntered = entered;
      }
    }
Esempio n. 3
0
    @Override
    public void update(Actor actor) {
      super.update(actor);

      ActorSpriteConfig.StatefulModelEntry config = (ActorSpriteConfig.StatefulModelEntry) _config;

      // update the state animation
      EntryState estate = (EntryState) actor;
      int entered = estate.getStateEntered();
      if (entered > _lastStateEntered) {
        int state = estate.getState();
        ConfigReference<ModelConfig> model =
            (state < config.states.length) ? config.states[state].model : null;
        if (model != null && _entryModel != null) {
          _entryModel.setConfig(model);
        }
        _lastStateEntered = entered;
      }
    }