Tema: [AS Battle]
Ver Mensaje Individual
  #15 (permalink)  
Antiguo 29/10/2005, 21:53
Avatar de stock
stock
 
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 22 años, 3 meses
Puntos: 53
Va mi contragolpe!!

100 Fotogramas por Segundo

Código PHP:
/* By Crysfel Villa
 * Octubre 28, 2005
 */

var cont:MovieClip;
var 
barra:MovieClip;
var 
form:TextFormat;
var 
n:Number = 5;
    
dibujarBarra(Stage.width/2,Stage.height-25);
crearMsgs();
iniciar();

function 
iniciar():Void{
    
Mouse.hide();
    var 
dirx:Number = Math.floor(Math.random()*2);
    var 
diry:Number = 0;
    var 
x:Number = 0;
    var 
y:Number = 0;
    var 
a:Number = 2;
    
n = 5;
    
cont = undefined;
    
cont = this.createEmptyMovieClip("c", 0);
    
cont._x = Stage.width/2;
    
cont._y = Stage.height/2;

    
cont.onEnterFrame = function():Void  {
        
barra._x = _root._xmouse;
        
this._rotation -= 5;
        if (
a<74) {
            
a++;
            
x = 80*Math.sin(a*42);
            
y = 80*Math.cos(a*42);
            if (
a<20) {
                
cont.moveTo(x, y);
            }
            
cont.lineStyle(0.5, 0x999999, 60);
            
cont.lineTo(x, y);
        } else {
            if (
a++<200) {
                
a++;
                
x = 40*Math.sin(a*-15);
                
y = 40*Math.cos(a*-15);
                if (
bol) {
                    
cont.lineStyle(1, 0x999999, 40);
                } else {
                    
cont.lineStyle(1, 0x999999, 40);
                }
                
cont.curveTo(x*0.5, y*0.5, 0, 0);
                
cont.lineTo(x, y);
            } else if (
a<275) {
                
texto.text = "Imagen Completa...";
                
texto.setTextFormat(form);
            }
        }
        if (
a>=275) {
            
texto.text = "Listo para jugar!!";
            
texto.setTextFormat(form);
            
this._xscale -= 1;
            
this._yscale = this._xscale;
            if (
this._xscale<=30) {
                
cont.onEnterFrame = function() {
                    
barra._x = _root._xmouse;
                    if (
dirx == 1) {
                        
cont._x += 5 + Math.floor(Math.random()*5);
                    } else {
                        
cont._x -= 10 + Math.floor(Math.random()*5);
                    }
                    if (
diry == 1) {
                        
cont._y += 5+Math.floor(Math.random()*5);
                    } else {
                        
cont._y -= 5 +Math.floor(Math.random()*5);
                    }
                    if (
cont._x>=Stage.width-25) {
                        
disparar(cont.duplicateMovieClip("disparo"+n, n));
                        
n++;
                        
dirx = 0;
                    }
                    if (
cont._y>=Stage.height-45) {
                        if(
cont._x > barra._x && cont._x < barra._x+barra._width){
                            
diry = 0;
                        }else if(
cont._y > Stage.height+30){
                            
texto.text = "Sorry, has perdido, Presiona Barra Espaciadora";
                            
texto.setTextFormat(form);
                            
delete this.onEnterFrame;
                        }
                        
                    }
                    if (
cont._x<=25) {
                        
disparar(cont.duplicateMovieClip("disparo"+n, n));
                        
n++;
                        
dirx = 1;
                    }
                    if (
cont._y<=25) {
                        
disparar(cont.duplicateMovieClip("disparo"+n, n));
                        
n++;
                        
diry = 1;
                    }
                }
            }
        }
    }
}
function 
disparar(mc:MovieClip):Void {
    var 
color:Color = new Color("disparo"+n);
    
mc.onEnterFrame = function():Void  {
        
this._xscale += 10;
        
this._yscale = this._xscale;
        
this._alpha -= 10;
        
color.setRGB(random(0xfff63));
        if (
this._alpha<40) {
            
this.removeMovieClip();
        }
    }
}
function 
dibujarBarra(x:Number,y:Number):Void {
    
barra = this.createEmptyMovieClip("c", 1);
    
barra.beginFill(0x918EAC, 100);
    
barra.moveTo(-50, 0);
    
barra.lineTo(50, 0);
    
barra.lineTo(50, 20);
    
barra.lineTo(-50, 20);
    
barra.lineTo(-50, 0);
    
barra.endFill();
    
barra._x = x;
    
barra._y = y
}

function 
crearMsgs():Void{
    
this.createTextField("texto", 2, Stage.width/2-80, Stage.height/2+80, 300, 100);
    
form = new TextFormat();
    
form.font = "arial";
    
form.size = 10;
    
form.color = 0x006699;
    
form.align = "center";
    
texto.text = "Formando imagen, espera...";
    
texto.setTextFormat(form);
    
texto._x = Stage.width/2 - texto._width/2;
    
texto._y = 20;
}

var 
myListener:Object = new Object();
Key.addListener(myListener);

myListener.onKeyUp = function () {
    if(
Key.getAscii()==Key.SPACE){
        
iniciar();
    }
} 
porcierto Julio, estubo muy bueno tu ultimo tiro, realmente me costo trabajo pensar como contratacar

Felicidades!! ya quiero ver el proximo contrataque

have funnnnnnnnnnn