home *** CD-ROM | disk | FTP | other *** search
- class Person extends Position
- {
- var p;
- var description;
- var onRelease;
- var environment;
- var speech;
- var photo_name;
- var onRollOver;
- var onRollOut;
- var nx;
- var z;
- var offscreen;
- var ny;
- var zs;
- function Person()
- {
- super();
- this.p.cacheAsBitmap = true;
- this.description = "";
- this.onRelease = function()
- {
- if(this.distanceTo(this.environment.pos_x,this.environment.pos_y) < 40)
- {
- this.unDescribe();
- this.speech(this.environment,this.photo_name);
- }
- };
- this.onRollOver = function()
- {
- this.describe();
- };
- this.onRollOut = function()
- {
- this.unDescribe();
- };
- }
- function setSpeech(p_speech)
- {
- this.speech = p_speech;
- }
- function describe()
- {
- var _loc3_ = this.description;
- if(this.distanceTo(this.environment.pos_x,this.environment.pos_y) < 40)
- {
- _loc3_ = "Talk to " + _loc3_;
- }
- _root.hud.setText(_loc3_);
- }
- function unDescribe()
- {
- _root.hud.setText("");
- }
- function render(p_env)
- {
- this.posit(p_env);
- if(this.nx < 650 && this.nx > -100 && this.z > -400)
- {
- this.offscreen = false;
- this._x = this.nx;
- this._y = this.ny;
- this._xscale = this._yscale = 40 * this.zs;
- this.depth();
- this.blur(this.ny);
- this.fade();
- }
- else if(this.offscreen == false)
- {
- this.offscreen = true;
- this._x = -200;
- this._y = -200;
- }
- }
- }
-