package Ocarina2D;
import java.awt.Color;
import Ocarina2D.TextEngine.TextBox;
import puppyeyes.engine.Actor;
import puppyeyes.engine.Level;
import puppyeyes.engine.Actor;
import puppyeyes.engine.Level;
public class GameIntro extends Level {
public GameIntro() {
super();
depth = 5;
backgroundColour = new Color(0,0,0);
width = 1856;
height = 1504;
camera.setX(-60);
camera.setY(-40);
camera.setWidth(380);
camera.setHeight(260);
}
public void start() {
System.out.println("starting");
TextBox text = new TextBox();
text.continueAnyway = true;
text.addTextField("In the vast, deep forest of Hyrule...");
text.addTextField("Long have I served as the guardian spirit... I am known as the Deku Tree...");
// GO TO LINKS HOUSE (its dark)
text.addTextField("The children of the forest, the Kokiri, live here with me.");
text.addTextField("Each Kokiri has his or her own guardian fairy.");
text.addTextField("However there is one boy who does not have a fairy...");
waitObjectexists(text);
// Link shuffles and makes upset sound
// GO TO HYRULE CASTLE, GATE COMES DOWN (its night, raining) (Link has a fairy)
// Zelda and impa rush through on a white horse
// Then Gannondorf stops next to Link on his black horse.
// He raises his hand, the screen goes white.
text = new TextBox();
text.continueAnyway = false;
text.addTextField("Navi... Navi, where art thou? Come hither...");
// Show Navi in front of Deku Tree
text = new TextBox();
text.continueAnyway = false;
text.addTextField("Oh, Navi the fairy... Listen to my words, the words of the Deku tree...");
text.addTextField("Dost thou sense it? The climate of evil descending upon this realm...");
text.addTextField("Malevolent forces even now are mustering to attack our land of Hyrule...");
text.addTextField("For so long, the Kokiri Forest, the source of life, has stood as a barrier, deterring outsiders and maintaining the order of the world...");
text.addTextField("But...before this tremendous evil power, even my power is as nothing...");
text.addTextField("It seems the time has come for the boy without a fary to begin his journey...");
text.addTextField("The youth whose destiny it is to leave Hyruleto the path of justice and truth....");
text.addTextField("Navi...go now! Find our young friend and guide him to me...");
text.addTextField("I do not have much time left.");
text.addTextField("Fly, Navi, fly! the fate of the forest, nay, the world, depends upon thee!");
// Navi flies through the forest and shit.
// SAVED IN SLOT 2
waitObjectexists(text);
}
/**
* Waits until the current object no longer exists
* @param object
*/
public void waitObjectexists(Actor object) {
while (object != null) {
// Sleep so that things are not stupidly fast.
try{ Thread.sleep(5); }
catch( InterruptedException e ) { }
}
}
}