private RepeatAction getActionSequenceForButtons(float delay) {

    RepeatAction ra = new RepeatAction();
    SequenceAction sa = new SequenceAction();
    sa.addAction(Actions.delay(delay));
    sa.addAction(Actions.sizeBy(5, 5, .75f));
    sa.addAction(Actions.sizeBy(-5, -5, .75f));
    ra.setAction(sa);
    ra.setCount(RepeatAction.FOREVER);
    return ra;
  }
Beispiel #2
0
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(
       ExtendedActions.changeVariable(
           sprite, getFormulaWithBrickField(BrickField.VARIABLE_CHANGE), userVariable));
   return null;
 }
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(
       sprite
           .getActionFactory()
           .createChangeColorByNAction(sprite, getFormulaWithBrickField(BrickField.COLOR_CHANGE)));
   return null;
 }
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(
       ExtendedActions.legoNxtPlayTone(
           sprite,
           getFormulaWithBrickField(BrickField.LEGO_NXT_FREQUENCY),
           getFormulaWithBrickField(BrickField.LEGO_NXT_DURATION_IN_SECONDS)));
   return null;
 }
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(
       ExtendedActions.droneMoveDown(
           sprite,
           getFormulaWithBrickField(BrickField.DRONE_TIME_TO_FLY_IN_SECONDS),
           getFormulaWithBrickField(BrickField.DRONE_POWER_IN_PERCENT)));
   return null;
 }
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(
       ExtendedActions.glideTo(
           sprite,
           getFormulaWithBrickField(BrickField.X_DESTINATION),
           getFormulaWithBrickField(BrickField.Y_DESTINATION),
           getFormulaWithBrickField(BrickField.DURATION_IN_SECONDS)));
   return null;
 }
Beispiel #7
0
 public void createStartScriptActionSequenceAndPutToMap(Map<String, List<String>> scriptActions) {
   for (int scriptCounter = 0; scriptCounter < scriptList.size(); scriptCounter++) {
     Script script = scriptList.get(scriptCounter);
     if (script instanceof StartScript) {
       Action sequenceAction = createActionSequence(script);
       look.addAction(sequenceAction);
       BroadcastHandler.getActionScriptMap().put(sequenceAction, script);
       BroadcastHandler.getScriptSpriteMapMap().put(script, this);
       String actionName =
           sequenceAction.toString() + Constants.ACTION_SPRITE_SEPARATOR + name + scriptCounter;
       if (scriptActions.containsKey(Constants.START_SCRIPT)) {
         scriptActions.get(Constants.START_SCRIPT).add(actionName);
         BroadcastHandler.getStringActionMap().put(actionName, sequenceAction);
       } else {
         List<String> startScriptList = new ArrayList<>();
         startScriptList.add(actionName);
         scriptActions.put(Constants.START_SCRIPT, startScriptList);
         BroadcastHandler.getStringActionMap().put(actionName, sequenceAction);
       }
     } else if (script instanceof BroadcastScript) {
       BroadcastScript broadcastScript = (BroadcastScript) script;
       SequenceAction action = createActionSequence(broadcastScript);
       BroadcastHandler.getActionScriptMap().put(action, script);
       BroadcastHandler.getScriptSpriteMapMap().put(script, this);
       putBroadcastSequenceAction(broadcastScript.getBroadcastMessage(), action);
       String actionName =
           action.toString() + Constants.ACTION_SPRITE_SEPARATOR + name + scriptCounter;
       if (scriptActions.containsKey(Constants.BROADCAST_SCRIPT)) {
         scriptActions.get(Constants.BROADCAST_SCRIPT).add(actionName);
         BroadcastHandler.getStringActionMap().put(actionName, action);
       } else {
         List<String> broadcastScriptList = new ArrayList<>();
         broadcastScriptList.add(actionName);
         scriptActions.put(Constants.BROADCAST_SCRIPT, broadcastScriptList);
         BroadcastHandler.getStringActionMap().put(actionName, action);
       }
     }
   }
 }
Beispiel #8
0
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(
       sprite
           .getActionFactory()
           .createPhiroRgbLedEyeActionAction(
               sprite,
               eyeEnum,
               getFormulaWithBrickField(BrickField.PHIRO_LIGHT_RED),
               getFormulaWithBrickField(BrickField.PHIRO_LIGHT_GREEN),
               getFormulaWithBrickField(BrickField.PHIRO_LIGHT_BLUE)));
   return null;
 }
  @Override
  public List<SequenceAction> addActionToSequence(SequenceAction sequence) {

    sequence.addAction(ExtendedActions.changeBrightnessByN(sprite, changeBrightness));
    return null;
  }
Beispiel #10
0
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(
       ExtendedActions.setY(sprite, getFormulaWithBrickField(BrickField.Y_POSITION)));
   return null;
 }
 @Override
 public List<SequenceAction> addActionToSequence(SequenceAction sequence) {
   sequence.addAction(ExtendedActions.legoNxtMotorAction(sprite, motor, motorEnum, speed));
   return null;
 }
Beispiel #12
0
 @Override
 public List<SequenceAction> addActionToSequence(SequenceAction sequence) {
   sequence.addAction(ExtendedActions.comeToFront(sprite));
   return null;
 }
Beispiel #13
0
 @Override
 public List<SequenceAction> addActionToSequence(SequenceAction sequence) {
   sequence.addAction(new PrintAction(text, outputStream));
   return null;
 }
Beispiel #14
0
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(ExtendedActions.pointTo(sprite, pointedObject));
   return null;
 }
 @Override
 public List<SequenceAction> addActionToSequence(SequenceAction sequence) {
   sequence.addAction(ExtendedActions.legoNxtMotorStop(motorEnum));
   return null;
 }
 private void addActionToSequenceAndAct(BrickBaseType brick, float actDuration) {
   brick.addActionToSequence(sprite, sequenceAction);
   Array<Action> actionArray = sequenceAction.getActions();
   action = (TemporalAction) actionArray.get(0);
   action.act(actDuration);
 }
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(sprite.getActionFactory().createPreviousLookAction(sprite));
   return null;
 }
Beispiel #18
0
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(ExtendedActions.hide(sprite));
   return null;
 }
Beispiel #19
0
 @Override
 public List<SequenceAction> addActionToSequence(Sprite sprite, SequenceAction sequence) {
   sequence.addAction(ExtendedActions.phiroMotorStopAction(motorEnum));
   return null;
 }