home *** CD-ROM | disk | FTP | other *** search
- class illusoft.GameTile009 extends illusoft.GameTile
- {
- var lastTime;
- var levelComplete;
- var dmc;
- var character;
- var dynamicsEngine;
- var Enemy;
- function GameTile009(id, dEngine, character, game, gamemc, nextLevel)
- {
- super(id,dEngine,character,game,gamemc,nextLevel);
- this.lastTime = new Date().getTime();
- }
- function Update(x, y)
- {
- super.Update(x);
- if(!this.levelComplete)
- {
- if(x > 1750 && y < 1420)
- {
- _global.sounds.LoopSound("jetstream",60);
- }
- else
- {
- _global.sounds.FadeVolume("jetstream",false,false);
- }
- if(this.character.dmc.hitTest(this.dmc.snowball.sub.sou))
- {
- _global.sounds.LoopSound("stonemove",80);
- }
- else
- {
- _global.sounds.FadeVolume("stonemove",false,false);
- }
- }
- var _loc4_ = new Date().getTime();
- if(this.character.dmc.hitTest(this.dmc.myHitter))
- {
- this.dmc.myHitter._y = -100;
- this.dmc.snowball.play();
- }
- if(this.dmc.snowball._currentframe == 446)
- {
- trace("start to bridge");
- this.Bridge();
- }
- if(this.character.dmc.hitTest(this.dmc.button1) || this.character.dmc.hitTest(this.dmc.button2))
- {
- this.character.MoveUp(22);
- if(_loc4_ - this.lastTime > 500)
- {
- _global.sounds.PlaySound("boing");
- this.lastTime = _loc4_;
- }
- }
- }
- function Bridge()
- {
- var ca = this.character;
- var _loc2_ = new org.cove.flade.surfaces.CircleTile(this.dmc.snowball._x + this.dmc.snowball.ball._x + this.dmc.snowball.ball.ball._width / 2 - 20,this.dmc.snowball._y + this.dmc.snowball.ball._y + this.dmc.snowball.ball.ball._height / 2 - 20,90,this.dmc);
- _loc2_.onContact = function()
- {
- ca.AllowJump(true);
- };
- this.dynamicsEngine.addSurface(_loc2_);
- }
- function Init()
- {
- super.Init();
- this.Enemy = "p1/p2/p3/snowball.sub.hit1/snowball.sub.hit2/snowball.sub.hit3/snowball.sub.hit4";
- this.dmc.myHitter._visible = false;
- _global.sounds.StartMusic("loop4");
- }
- function Close()
- {
- _global.sounds.FadeVolume("jetstream",false,false);
- _global.sounds.FadeVolume("stonemove",false,false);
- super.Close();
- }
- function LevelComplete()
- {
- this.levelComplete = true;
- _global.sounds.FadeVolume("jetstream",false,false);
- _global.sounds.FadeVolume("stonemove",false,false);
- }
- }
-