@Override
 public void visitLeaf(MovementAction movementAction) {
   // TODO Auto-generated method stub
   if (movementAction.getTimerOnTickListener() == null) {
     movementAction.setTimerOnTickListener(defaultTimerOnTickListener);
   }
 }
Esempio n. 2
0
  @Override
  public BevRunningStatus OnUpdate(Object inputParam, Object outputParam) {
    // TODO Auto-generated method stub
    MovementAction input = (MovementAction) inputParam;
    //		MovementAction output = (MovementAction) outputParam;

    input.trigger();

    if (input.isFinish) {
      return BevRunningStatus.k_BRS_Finish;
    }

    return BevRunningStatus.k_BRS_Executing;
  }
Esempio n. 3
0
  private void initMove() {
    final ScriptPaser scriptPaser = new ScriptPaser();
    scriptPaser.paser(context, this, handScriteNames[type_direction]);

    scriptPaser.setScriptTriggerDoCommandLisener(
        new ScriptPaser.ScriptTriggerDoCommandLisener() {

          @Override
          public void onCommandPause() {
            // TODO Auto-generated method stub

          }

          @Override
          public void onCommandMove(float dx, float dy) {
            // TODO Auto-generated method stub
            if (!isMoveable) return;
            if (scriptPaser.isMove()) {
              dx = scriptPaser.getDx();
              Log.e("script dx", dx + "");
              if (scriptPaser.getDx() > 0) {
                if (getX() + w >= moveRage.right) {
                  scriptPaser.setDx(-scriptPaser.getDx());
                }
              } else {
                if (getX() <= moveRage.left) {
                  scriptPaser.setDx(-scriptPaser.getDx());
                }
              }
            }

            dx = scriptPaser.getDx();

            Bullets.this.move(dx, dy);
          }
        });

    movementAction = new MovementActionSetWithThreadPool();
    movementAction.setMovementActionController(new MovementAtionController());
    MovementActionInfo info =
        new MovementActionInfo(
            2000, 1, 0, 4.0f, "", null, false, this, HandAnimaton.Move.getName());
    MovementActionItemBaseReugularFPS action = new MovementActionItemBaseReugularFPS(info);
    movementAction.addMovementAction(action);

    movementAction.isLoop = true;

    movementAction.setTimerOnTickListener(
        new MovementAction.TimerOnTickListener() {

          @Override
          public void onTick(float dx, float dy) {
            // TODO Auto-generated method stub
            if (!isMoveable) return;
            float bottom = Bullets.this.getY() + h;
            float top = Bullets.this.getY();
            Log.e("hand bottom", bottom + "");

            //				if(type_direction == TYPE_TWO_HAND_LEFT_UP || type_direction ==
            // TYPE_TWO_HAND_RIGHT_UP)
            //					dy *= -1;

            if (type == Top) {
              dy = -dy;
            }

            if ((bottom >= limit && type == Down) || (top <= limit && type == Top)) {
              //					dy = -dy;
              //					if(type==Down || (type==Top &&( type_direction == TYPE_TWO_HAND_LEFT_UP ||
              // type_direction == TYPE_TWO_HAND_RIGHT_UP))){
              if (type == Down) {
                type = Top;
                if (reflectCounter == stopRlectCount) {
                  limit = moveRage.height() - moveRage.height() * Math.pow(0.66d, reflectCounter);
                } else {
                  reflectCounter++;
                  limit = moveRage.height() - moveRage.height() * Math.pow(0.66d, reflectCounter);
                }

                drawWithoutClip = true;
                isMoveable = false;

              } else {
                type = Down;
                limit = moveRage.bottom;
              }
            }

            move(dx, dy);
          }
        });

    movementAction.initMovementAction();

    movementAction.start();

    //		setMovementAction(movementAction);

    movementActionShoot = new MovementActionSetWithThreadPool();
    info = new MovementActionInfo(2000, 1, 2, 0, "", null, false);
    MovementActionItemBaseReugularFPS reFlectaction = new MovementActionItemBaseReugularFPS(info);
    movementActionShoot.addMovementAction(reFlectaction);

    movementActionShoot.setTimerOnTickListener(
        new MovementAction.TimerOnTickListener() {

          @Override
          public void onTick(float dx, float dy) {
            // TODO Auto-generated method stub

            move(dx, dy);

            //				scriptPaser.nextScriptLine();

            //				scriptPaser.triggerAndDoCommandInSprite();

          }
        });

    movementActionShoot.initMovementAction();

    movementActionShoot.start();

    setMovementAction(movementActionShoot);
  }