home *** CD-ROM | disk | FTP | other *** search
- class AmmoBox extends Position
- {
- var target_clip;
- var onEnterFrame;
- var range = 80;
- function AmmoBox()
- {
- super();
- this.target_clip = this._parent.player;
- this.onEnterFrame = function()
- {
- if(!_global.game_paused)
- {
- if(this.render_z < -200)
- {
- this.removeMovieClip();
- }
- if(this.checkTarget() && this._currentframe == 1)
- {
- this._parent.player.increaseAmmo();
- this.gotoAndStop(2);
- }
- }
- };
- }
- function checkTarget()
- {
- return this.distance3D(this.target_clip) < this.range;
- }
- }
-