home *** CD-ROM | disk | FTP | other *** search
- movieclip.prototype.cekbots = function()
- {
- var len = bot.length;
- var i = 0;
- while(i < len)
- {
- if(r[bot[i]].energy <= 0)
- {
- this.bot.removevalue(bot[i]);
- this.botran = this.bot.copy();
- if(this.bot.length == 1)
- {
- r[bot[0]].melastbot = 1;
- r[bot[0]].energy += 5;
- }
- }
- i++;
- }
- };
- d = 30;
- shotdelay = 12;
- sd = shotdelay;
- cekbots();
- if(!botran.length)
- {
- botran = bot.copy();
- botran.randomize();
- }
- oldran = ran;
- ran = botran.pop();
- if(oldran == ran and bot.length > 1)
- {
- if(bot.length > 1)
- {
- oldran = ran;
- ran = botran.pop();
- }
- }
- r[ran].rx.gotoAndStop("in");
- onenterframe = function()
- {
- cekbots();
- if(r[ran].energy <= 0)
- {
- d = -50;
- }
- d--;
- if(d == 0)
- {
- r.attachmovie("xbul","eb" + r.ed,r.ed);
- r["eb" + r.ed]._x = r[ran]._x - 20;
- r["eb" + r.ed]._y = r[ran]._y - 60;
- r["eb" + r.ed].dep = r.ed;
- r.ebul.push("eb" + r.ed);
- r.ed = r.ed + 1;
- }
- else if(d == 10)
- {
- r[ran].rx.gotoAndStop("attack");
- }
- else if(d == -10)
- {
- r[ran].rx.gotoAndStop("stand");
- }
- else if(d < -30)
- {
- if(bot.length > 1)
- {
- r[ran].rx.gotoAndStop("out");
- delete onenterframe;
- play();
- }
- else if(bot.length == 1)
- {
- if(ran == bot[0])
- {
- d = 20;
- }
- else
- {
- r[ran].rx.gotoAndStop("out");
- delete onenterframe;
- play();
- }
- }
- else
- {
- r.score += 50 * r.point;
- delete onenterframe;
- stop();
- }
- }
- sd--;
- if(!sd)
- {
- sd = shotdelay;
- r[bot[random(5)]].shoot = 1;
- }
- };
- stop();
-