@Override public void nextFrame(StageGameState b) { if (phase == 0 && character.play("raiseUp", b.tpf)) { // allow to animate character.animationLock = false; phase++; } else if (phase >= 1 && phase < numFires + 1 && frameCount % delay == 0) { // determine spawn point float a = FastMath.nextRandomFloat() * FastMath.PI * 2; float p = FastMath.nextRandomFloat() * FastMath.PI * 2; Vector3f translation = new Vector3f( radius * FastMath.sin(p) * FastMath.sin(a), radius * FastMath.cos(p), radius * FastMath.sin(p) * FastMath.cos(a)); Fire fire = (Fire) LoadingQueue.quickLoad(new Fire(getUsers()), b); fire.setVelocity(translation.mult(.2f / (float) radius)); fire.model.setLocalTranslation(character.model.getLocalTranslation().add(translation)); b.getRootNode().updateRenderState(); phase++; } else if (phase >= numFires + 1) { finish(); } }
@Override public void nextFrame(StageGameState b) { // if animation is halfway through MeshAnimationController animControl = (MeshAnimationController) character.model.getController(0); if (phase == 0 && animControl.getCurTime() + b.tpf >= animControl.getAnimationLength("cast") / 2) { phase++; // calculate transformations Vector3f rotation = character.rotationVector; float angle = FastMath.atan2(rotation.x, rotation.z); Vector3f translation = new Vector3f(2 * FastMath.sin(angle), 3.7f, 2 * FastMath.cos(angle)); Echo e = (Echo) LoadingQueue.quickLoad(new Echo(getUsers(), target), b); e.rotate(rotation); e.setVelocity(rotation.mult(e.speed)); e.model.setLocalTranslation(character.model.getWorldTranslation().add(translation)); b.getRootNode().updateRenderState(); } else if (character.play("cast", b.tpf)) { finish(); } }
@Override public void act(StageGameState b) { // set scale model.setLocalScale(2); // create ice trail if (lifeCount % 12 == 0) { IceTrail f = (IceTrail) LoadingQueue.quickLoad(new IceTrail(40, .05f), b); f.model.setLocalTranslation(model.getWorldTranslation().clone()); b.getRootNode().updateRenderState(); } super.act(b); }
@Override public void nextFrame(StageGameState b) { if (phase == 0 && character.play("prayerUp", b.tpf)) { character.play("prayer", b.tpf); AquaCircle ac = (AquaCircle) LoadingQueue.quickLoad(new AquaCircle(getUsers()), b); ac.model.setLocalTranslation( character.model.getLocalTranslation().mult(new Vector3f(1, 0, 1))); b.getRootNode().updateRenderState(); phase++; } else if (phase == 1 && frameCount >= 18) { finish(); } }
public static void load() { LoadingQueue.push(new Model(Echo.filename)); }
public void init() { // dialogue code int[] times = new int[24]; for (int i = 0; i < times.length; i++) times[i] = i * 20; Actor[] a = {new Actor(), new Actor()}; a[0].setPortraits(0, new int[] {0}, new String[] {"khoa-test.png"}); a[0].setPortraits( 2, times, new String[] { "cy-test1.png", "cy-test2.png", "cy-test1.png", "cy-test3.png", "cy-test1.png", "cy-test2.png", "cy-test1.png", "cy-test3.png", "cy-test1.png", "cy-test2.png", "cy-test1.png", "cy-test3.png", "cy-test1.png", "cy-test2.png", "cy-test1.png", "cy-test3.png", "cy-test1.png", "cy-test2.png", "cy-test1.png", "cy-test3.png", "cy-test1.png", "cy-test2.png", "cy-test1.png", "cy-test3.png" }); a[1].setPortraits(0, new int[] {0}, new String[] {"monica-test.png"}); a[0].setPositions(0, new int[] {0}, new Point[] {new Point(160, 323)}); a[1].setPositions(0, new int[] {0}, new Point[] {new Point(520, 323)}); a[0].setPositions(2, new int[] {0}, new Point[] {new Point(160, 331)}); a[1].setPositions( 1, new int[] {60, 120}, new Point[] {new Point(480, 323), new Point(520, 323)}); String[] lines = { "Mickey:: Aw, we don't hate it. It's just kinda... scary. But the world's made of light AND darkness. You can't have one without the other, 'cause darkness is half of everything. Sorta makes ya wonder why we are scared of the dark...", "You accept darkness, yet choose to live in the light. So why is it that you loathe us who teeter on the edge of nothing? We who were turned away by both light and dark - never given a choice?", "I knew. But I was too stubborn to accept it. It's always the same. I try to wrap my mind around things my heart already knows, only to fail.", "Xehanort::Students do take after their teachers. Only a fool would be your apprentice. After all, none of this would have happened without you. YOU are the source of all Heartless. It was your research that inspired me to go further than you ever dared.", "Thinking of you, wherever you are. We pray for our sorrows to end, and hope that our hearts will blend. Now I will step forward to realize this wish. And who knows: starting a new journey may not be so hard, or maybe it has already begun. There are many worlds, and they share the same sky -\n one sky, one destiny." }; // int[] durations = {0, -1, 230, -2, 600}; int[] durations = {0, 0, 0, 0, 0}; /* DialogueGameState dialogueState = new DialogueGameState(lines, durations, a, "bg_twilight-kingdom.png"); dialogueState.setBgm("mitsu_no_yoake.ogg"); dialogueState.setStartsBGM(true); dialogueState.setEndsBGM(true); addState(dialogueState); */ Battle b = Battle.getCurrentBattle(); Character monica = (Character) LoadingQueue.push(new Monica()); ArrayList<Ability[]> ab = new ArrayList<Ability[]>(); // ab.add(new Ability[] {new EvasiveStart()}); monica.assignAI(new MonicaAI(monica)); b.setOps(new Character[] {monica}); // b.setOpAbilities(ab); b.setTargetTime(60); b.setExpYield(getExpYield()); b.setPlayerPosition(new Vector3f(0, 0, -20)); b.addOponentPosition(new Vector3f(0, 0, 20)); Battle.setCurrentBattle(b); addState(Battle.createBattleGameState()); }
public static void load() { LoadingQueue.push(new Model(AquaCircle.filename)); }