Ejemplo n.º 1
0
  @Override
  public void setSpatial(Spatial spatial) {
    super.setSpatial(spatial);

    if (spatial != null) {
      animControl = ActorFactory.findControl(spatial, AnimControl.class);
      characterControl = ActorFactory.findControl(spatial, CharacterControl.class);
      if (animControl != null && characterControl != null) {
        initChannels();
        animControl.addListener(this);
      }
    }
  }
Ejemplo n.º 2
0
  public CreepAnimControl(Creep creep) {
    this.creep = creep;

    // animations of creep
    animControl = creep.getCreepModel().getControl(AnimControl.class);
    animControl.addListener(this);

    // chanels
    channelAttack = animControl.createChannel();
    channelDead = animControl.createChannel();
    channelRunBase = animControl.createChannel();
    channelRunTop = animControl.createChannel();

    // random tool
    random = new Random();
  }