home *** CD-ROM | disk | FTP | other *** search
- GeoCitizen = function(type, game_x, game_y, isFlipped)
- {
- if(game_x instanceof MovieClip)
- {
- this.mc = game_x;
- var _loc4_ = GAME.mapScreenToGame(this.mc._x,this.mc._y);
- game_x = _loc4_.game_x;
- game_y = _loc4_.game_y;
- }
- else
- {
- GAME.mc.attachMovie("gc_" + type,"gc" + GAME.drawIndex,GAME.drawIndex);
- this.mc = GAME.mc["gc" + GAME.drawIndex];
- this.id = "gc" + GAME.drawIndex;
- }
- if(game_x == undefined || isNaN(game_x))
- {
- return false;
- }
- this.id = "gc" + GAME.drawIndex;
- this.type = type;
- this.isFlipped = isFlipped;
- this.isPermanent = type == "kiteflyer" || type == "picknicker";
- this.mc.obj = this;
- GAME.drawIndex = GAME.drawIndex + 1;
- this.lastTime = getTimer();
- if(game_x == undefined)
- {
- var _loc5_ = this["getPlacement_" + type];
- }
- this.game_x = Number(game_x);
- this.game_y = Number(game_y);
- GAME.drawOnScreen(this,true);
- if(this.isFlipped)
- {
- this.mc._xscale = - this.mc._xscale;
- }
- GAME.addListener(this);
- };
- t = GeoCitizen.prototype;
- t.mc = false;
- t.id = "";
- t.type = "";
- t.markedForDeath = false;
- t.isFlipped = false;
- t.age = 0;
- t.lastTime = 0;
- t.game_x = 0;
- t.game_y = 0;
- t.min_game_x = 0;
- t.max_game_x = 0;
- t.enabled = true;
- t.maxLifeTime = 10000;
- t.hitByWindGust = function(windGust)
- {
- if(!this.enabled)
- {
- return true;
- }
- this.mc.gotoAndPlay("hit");
- GAME.adjustScore("hitGeoCitizen_" + this.type,this);
- };
- t.rePosition = function()
- {
- GAME.curGrid.placeInGrid(this,this.game_x,this.game_y);
- GAME.drawOnScreen(this,true);
- if(this.isFlipped)
- {
- this.mc._xscale = - this.mc._xscale;
- }
- this.reBound();
- };
- t.reBound = function()
- {
- var _loc2_ = this.mc.hit_area.getBounds(WM_GAME.mc);
- this.min_game_x = _loc2_.xMin;
- this.max_game_x = _loc2_.xMax;
- };
- t.onTimeUp = function()
- {
- this.hide();
- };
- t.hide = function()
- {
- GAME.removeHitObject(this);
- delete this.mc.onEnterFrame;
- if(this.mc.hide == undefined)
- {
- this.mc.gotoAndPlay("no_hit_hide");
- }
- else
- {
- this.mc.hide();
- }
- };
- t.remove = function()
- {
- this.markedForDeath = true;
- GAME.removeObject(this);
- };
- t.getPlacement_picknicker = function()
- {
- };
- t.onLevelComplete = function()
- {
- };
- t.onLevelIncomplete = function()
- {
- };
- t.onLevelEnter = function()
- {
- if(!this.isPermanent)
- {
- this.hide();
- }
- };
- t.onNextLevel = function()
- {
- this.hide();
- };
- t.toString = function()
- {
- return "[GeoCitizen " + this.type + "]";
- };
-