Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Revel Immortal - The Continued Story of Morning's Wrath
- //Copyright 2001-2013 Ethereal Darkness Interactive
- //All Rights Reserved Worldwide
- function Intro(game)
- {
- this.game=game;
- this.tween=new Tween();
- this.listings=[
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"Five years had passed since the assault on castle Iridine."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"Morning's power had diminished, and with it her wroth and want of revenge."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"A drink from the great mana well had given her the strength to defend her people;"},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"And though those before her were struck with madness, or death;\nshe showed no ill effect... save one."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"It was found from that day forward no longer did Morning want for food, or drink; or sleep."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"...it seemed no device of man would harm her."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"...Princess Morning had become Immortal."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"Though as the eastern lands of the Leowyn people were rocked\nby the reawakening of magic within the halls of Iridine;"},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"...still most of the world slept unchanged."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"...but not in the land of Ashidia."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"Undaunted by their defeat on summerfound, the lords of Ashidia grew only more desperate."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"They enslaved the free peoples of their realm to bolster the ranks of their armies."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"But worse still, countless men, women and children were sent underground;\nto delve for that the Ashidian lords craved most."},
- {fadeInDuration: 3 , fadeOutDuration: 5 , text:"A mana wellspring of their own."},
- {fadeInDuration: 3 , fadeOutDuration: 10 , text:"...but in the dark, they came upon a far greater evil."}
- //{fadeInDuration: 3 , fadeOutDuration: 5 , text:"It corrupted those trapped within the mines; turning them into crazed warlike creatures."},
- //{fadeInDuration: 3 , fadeOutDuration: 5 , text:"But the lords of Ashidia were pleased; the loss of innocent lives meant little to them;\nwould that these creatures devour their enemies."},
- //{fadeInDuration: 3 , fadeOutDuration: 5 , text:"War was coming for the Leowyn people once again; and Morning would again answer the challenge."}
- ];
- this.alpha=0;
- }
- Intro.prototype=Object.create(Object.prototype);
- Intro.prototype.constructor=Intro;
- Intro.prototype.getPlaylist=function(){
- return "intro";
- }
- Intro.prototype.loaded=function()
- {
- var localThis=this;
- this.advanceSlide();
- }
- Intro.prototype.mouse=function(x, y, type)
- {
- var localThis=this;
- if(type==0)
- {
- this.game.endView();
- }
- }
- Intro.prototype.update=function(t)
- {
- this.tween.update(t);
- }
- Intro.prototype.advanceSlide=function()
- {
- var localThis=this;
- if(this.listings.length>0)
- {
- localThis.tween.to(localThis, localThis.listings[0].fadeInDuration, {alpha:1}, Ease.inOutExpo, function(){
- localThis.tween.to(localThis, localThis.listings[0].fadeOutDuration, {alpha:0}, Ease.inOutExpo, function(){
- localThis.listings.shift();
- localThis.advanceSlide();
- });
- });
- }
- else
- {
- this.game.endView();
- }
- }
- Intro.prototype.render=function(ctx)
- {
- ctx.clearRect(0,0,Game.width,Game.height);
- if(this.listings.length>0)
- {
- ctx.font="24px garamond";
- ctx.textAlign="center";
- ctx.fillStyle="#fff";
- ctx.globalAlpha=this.alpha;
- var lines=this.listings[0].text.split("\n");
- for(var i=0;i<lines.length;++i)
- {
- ctx.fillText(lines[i],Game.width/2,(Game.height/4)+i*40);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement