home *** CD-ROM | disk | FTP | other *** search
- class Obstacle extends Position
- {
- var target_clip;
- var onEnterFrame;
- var range = 70;
- var speed_z = -10;
- function Obstacle()
- {
- super();
- this.target_clip = this._parent.player;
- this.onEnterFrame = function()
- {
- if(!_global.game_paused)
- {
- this.moveZ();
- if(this.render_z < -200)
- {
- this.removeMovieClip();
- }
- if(this.checkTarget())
- {
- this._parent.player.getObstacled();
- }
- }
- };
- }
- function checkTarget()
- {
- return this.distance3D(this.target_clip) < this.range;
- }
- function moveZ()
- {
- this.pos_z += this.speed_z;
- }
- }
-