コード例 #1
0
ファイル: Sprite.java プロジェクト: paggerbua/Catroid
 public void createTouchDownAction() {
   ParallelAction whenParallelAction = ActionFactory.parallel();
   for (Script s : scriptList) {
     if (s instanceof WhenTouchDownScript) {
       SequenceAction sequence = createActionSequence(s);
       whenParallelAction.addAction(sequence);
     }
   }
   look.addAction(whenParallelAction);
 }
コード例 #2
0
ファイル: Sprite.java プロジェクト: paggerbua/Catroid
 public void createWhenScriptActionSequence(String action) {
   ParallelAction whenParallelAction = actionFactory.parallel();
   for (Script s : scriptList) {
     if (s instanceof WhenScript && (((WhenScript) s).getAction().equalsIgnoreCase(action))) {
       SequenceAction sequence = createActionSequence(s);
       whenParallelAction.addAction(sequence);
     }
   }
   look.setWhenParallelAction(whenParallelAction);
   look.addAction(whenParallelAction);
 }
コード例 #3
0
ファイル: Sprite.java プロジェクト: paggerbua/Catroid
 public void createWhenNfcScriptAction(String uid) {
   ParallelAction whenParallelAction = ActionFactory.parallel();
   for (Script s : scriptList) {
     if (s instanceof WhenNfcScript) {
       WhenNfcScript whenNfcScript = (WhenNfcScript) s;
       if (whenNfcScript.isMatchAll() || whenNfcScript.getNfcTag().getNfcTagUid().equals(uid)) {
         SequenceAction sequence = createActionSequence(s);
         whenParallelAction.addAction(sequence);
       }
     }
   }
   // TODO: quick fix for faulty behaviour - nfc action triggers again after touchevents
   // look.setWhenParallelAction(whenParallelAction);
   look.addAction(whenParallelAction);
 }
コード例 #4
0
ファイル: Bananas.java プロジェクト: Writkas/FuryShimp
  public Bananas(Vector2 origin, Vector2 destination, float speed, boolean large) {
    super(origin, destination, speed, "actors/banana.png");
    isLarge = large;

    textureRegion.setRegion(0, 0, WIDTH, HEIGHT);

    if (isLarge) setOrigin(WIDTH / 2, HEIGHT / 2);
    else setOrigin(WIDTH / 2 / 2, HEIGHT / 2 / 2);

    // Movimiento.
    ParallelAction pa = new ParallelAction();
    pa.addAction(Actions.moveTo(destination.x, destination.y, speed));
    pa.addAction(Actions.rotateBy(MathUtils.random(-360 * 4, 360 * 4), speed));
    addAction(pa);
  }