Foros del Web » Creando para Internet » Flash y Actionscript »

[AS Battle]

Estas en el tema de [AS Battle] en el foro de Flash y Actionscript en Foros del Web. Bien comenzamos. Este es un post de prueba para ver si es bien aceptada esta propuesta. Por ello Cualquiera puede participar Reglas. 1.- Solo ActionScript ...
  #1 (permalink)  
Antiguo 11/10/2005, 20:57
Avatar de TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
[AS Battle]

Bien comenzamos. Este es un post de prueba para ver si es bien aceptada esta propuesta. Por ello Cualquiera puede participar

Reglas.

1.- Solo ActionScript
2.- Sin simbolos en libreria
3.- Mantener al menos 50% del codigo del tiro anterior
4.- Publicar entre etiquetas [ CODE ] [ /CODE ]

Comentarios AQUI mantengamos este post con puro codigo.

Todos los temas de conversacion sobre este post seran movidos a http://forosdelweb.com/showthread.php?t=340644

Última edición por TMeister; 13/10/2005 a las 21:47
  #2 (permalink)  
Antiguo 11/10/2005, 20:59
Avatar de TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
Primer tiro

AS2 [Flash 7 ó Flash 8]
Frames por segundo 100
Copy&Paste

Código:
var cont:MovieClip = this.createEmptyMovieClip("c", 10);
var x:Number = 0;
var y:Number = 0;
var a:Number = 0;
cont._x = 150;
cont._y = 150;
this.onEnterFrame = function() {
	if (a++<150) {
		x = 80*Math.sin(a*3.5);
		y = 80*Math.cos(a*3.5);
		if (a<2) {
			cont.moveTo(x, y);
		}
		cont.lineStyle(1, 0x0066cc, 50); 
		cont.lineTo(x, y);
	} else {
		delete this.onEnterFrame;
	}
};
  #3 (permalink)  
Antiguo 12/10/2005, 08:44
Avatar de bernethe  
Fecha de Ingreso: abril-2004
Ubicación: San José, Costa Rica
Mensajes: 384
Antigüedad: 20 años
Puntos: 2
cambio simple pero me apunto

VA CONTRAATAQUE:

Código:
var cont:MovieClip = this.createEmptyMovieClip("c", 10);
var x:Number = 0;
var y:Number = 0;
var a:Number = 0;
cont._x = 150;
cont._y = 150;
var bol:Boolean = true;
this.onEnterFrame = function() {
	if (a++<150) {
		x = 80*Math.sin(a*3.5);
		y = 80*Math.cos(a*3.5);
		if (a<2) {
			cont.moveTo(x, y);
		}
		if (bol) {
			cont.lineStyle(1, 0x0066cc, 50);
			bol = false;
		} else {
			cont.lineStyle(1, 0xFF9900, 50);
			bol = true;
		}
		cont.lineTo(x, y);
	} else {
		delete this.onEnterFrame;
	}
};
__________________
..::BERNETHE::..
  #4 (permalink)  
Antiguo 12/10/2005, 12:15
Avatar de buhomorado  
Fecha de Ingreso: enero-2005
Mensajes: 324
Antigüedad: 19 años, 3 meses
Puntos: 1
hahahahahahaha sabia ke TMeister tenia buena estrella... pero Bernethe se sale kon la suya...

hahahahahahahahhahah
  #5 (permalink)  
Antiguo 12/10/2005, 12:49
Avatar de ostrasjo  
Fecha de Ingreso: diciembre-2004
Mensajes: 165
Antigüedad: 19 años, 4 meses
Puntos: 0
Se que es un poco el copia y pega pero weno

Código:
var cont:MovieClip = this.createEmptyMovieClip("c", 10);
var x:Number = 0;
var y:Number = 0;
var a:Number = 0;
cont._x = 150;
cont._y = 150;
var bol:Boolean = true;
this.onEnterFrame = function() {
	if (a++<149) {
		x = 80*Math.sin(a*3.5);
		y = 80*Math.cos(a*3.5);
		if (a<2) {
			cont.moveTo(x, y);
		}
		if (bol) {
			cont.lineStyle(1, 0x0066cc, 50);
			bol = false;
		} else {
			cont.lineStyle(1, 0xFF9900, 50);
			bol = true;
		}
		cont.lineTo(x, y);
	} else {
		if (a++<500) {
			x = 150*Math.sin(a*1);
			y = 150*Math.cos(a*1);
		if (a<2) {
			cont.moveTo(x, y);
		}
		if (bol) {
			cont.lineStyle(1, 0x0066cc, 25);
			bol = false;
		} else {
			cont.lineStyle(1, 0xFF9900, 25);
			bol = true;
		}
			cont.lineTo(x, y);
		} else {
			delete this.onEnterFrame;
		}
	}
};
  #6 (permalink)  
Antiguo 12/10/2005, 14:52
Avatar de bernethe  
Fecha de Ingreso: abril-2004
Ubicación: San José, Costa Rica
Mensajes: 384
Antigüedad: 20 años
Puntos: 2
A La Cargaaaaa!!!

Apunten, FUEGOOOO....

Código:
var cont:MovieClip = this.createEmptyMovieClip("c", 10);
var x:Number = 0;
var y:Number = 0;
var a:Number = 0;
cont._x = Stage.width/2;
cont._y = Stage.height/2;
var bol:Boolean = true;
this.onEnterFrame = function() {
	if (a++<149) {
		x = 80*Math.sin(a*3.5);
		y = 80*Math.cos(a*3.5);
		if (a<2) {
			cont.moveTo(x, y);
		}
		if (bol) {
			cont.lineStyle(1, 0x0066cc, 50);
			bol = false;
		} else {
			cont.lineStyle(1, 0xFF9900, 50);
			bol = true;
		}
		cont.lineTo(x, y);
	} else {
		if (a++<750) {
			x = 150*Math.sin(a*1);
			y = 150*Math.cos(a*1);
			if (a<2) {
				cont.moveTo(x, y);
			}
			if (bol) {
				cont.lineStyle(1, 0x0066cc, 25);
				cont.curveTo(x*-0.1, y*-0.2, x*-0.1, y*-0.2);
				bol = false;
			} else {
				cont.lineStyle(1, 0xFF9900, 25);
				cont.curveTo(x*-0.1, y*-0.2, x*-0.1, y*-0.2);
				bol = true;
			}
			cont.lineTo(x, y);
		} else {
			delete this.onEnterFrame;
		}
	}
};
__________________
..::BERNETHE::..
  #7 (permalink)  
Antiguo 12/10/2005, 18:46
Avatar de TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
Frames por segundo 100

Código:
var cont:MovieClip = this.createEmptyMovieClip("c", 10);
var x:Number = 0;
var y:Number = 0;
var a:Number = 0;
cont._x = Stage.width/2;
cont._y = Stage.height/2;
var bol:Boolean = true;
cont.onEnterFrame = function() {
	this._rotation += 15;
	if (a++<149) {
		x = 40*Math.sin(a*3.5);
		y = 40*Math.cos(a*3.5);
		if (a<2) {
			cont.moveTo(x, y);
		}
		cont.lineStyle(1, 0x0066cc, 20);
		cont.lineTo(x, y);
	} else {
		if (a++<300) {
			x = 60*Math.sin(a*1);
			y = 60*Math.cos(a*1);
			if (a<2) {
				cont.moveTo(x, y);
			}
			cont.lineStyle(1, 0x0066cc, 15);
			cont.curveTo(x*-0.1, y*-0.2, x*-0.1, y*-0.2);
			cont.lineTo(x, y);
		} else {
			var color:Color = new Color(cont);
			color.setRGB(random(0xfff));
		}
	}
};
  #8 (permalink)  
Antiguo 12/10/2005, 23:52
Avatar de stock  
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 10 meses
Puntos: 53
Bueno, aqui va mi tiro (Para distraerme un poco de los examenes)

100 fps
Código PHP:

comenzar
(1);

function 
comenzar(n:Number):Void{
    var 
cont:MovieClip this.createEmptyMovieClip("c"n);
    var 
x:Number 0;
    var 
y:Number 0;
    var 
a:Number 0;
    
cont._x Stage.width/2;
    
cont._y Stage.height/2;

    
cont.onEnterFrame = function() {
        
this._rotation += 15;
        if (
a<80) {
            
a+=1.5;
            
40*Math.sin(a*3.5);
            
40*Math.cos(a*3.5);
            if (
a<2) {
                
cont.moveTo(xy);
            }
            
cont.lineStyle(10x0066cc20);
            
cont.lineTo(xy);
        }else{
            if(
a<151){
                
a++;
                
60*Math.sin(a*2.5);
                
60*Math.cos(a*2.5);
                if(
a%2==0)
                    
cont.lineStyle(30xFDCA0220);
                else
                    
cont.lineStyle(30xFF00FF20);
                
cont.lineTo(xy);
            }else{
                
this._xscale +=10;
                
this._yscale +=10;
                
this._alpha--;
                if(
this._alpha<10){
                    
n++;
                    
delete this.onEnterFrame;
                    
this.removeMovieClip();
                    
comenzar(n);
                }
            }
        }
    }

  #9 (permalink)  
Antiguo 14/10/2005, 06:15
 
Fecha de Ingreso: julio-2004
Mensajes: 71
Antigüedad: 19 años, 9 meses
Puntos: 0
muevete para aya....

NO!, va para el otro lado...


presiona, presiona!!!!!


Código:
comenzar(1);
function comenzar(n:Number):Void {
	var contText:MovieClip = this.createEmptyMovieClip("contText", this.getNextHighestDepth());
	var contText:TextField = contText.createTextField("contText", 0, 0, 0, 360, 20);
	var cont:MovieClip = this.createEmptyMovieClip("c", n);
	var x:Number = 0;
	var y:Number = 0;
	var a:Number = 0;
	//cont._alpha = 0;
	cont._x = Stage.width/2;
	cont._y = Stage.height/2;
	contText._x = (Stage.width/2)-(contText._width/2);
	contText._y = (Stage.height/2)+100;
	cont.onEnterFrame = function() {
		this._rotation += 15;
		if (a<80) {
			a += 1.5;
			x = 40*Math.sin(a*3.5);
			y = 40*Math.cos(a*3.5);
			if (a<2) {
				cont.moveTo(x, y);
			}
			cont.lineStyle(1, 0x0066cc, 20);
			cont.lineTo(x, y);
		} else {
			if (a<151) {
				a++;
				x = 60*Math.sin(a*2.5);
				y = 60*Math.cos(a*2.5);
				if (a%2 == 0) {
					cont.lineStyle(3, 0xFDCA02, 20);
				} else {
					cont.lineStyle(3, 0xFF00FF, 20);
				}
				cont.lineTo(x, y);
			} else {
				this._alpha -= 10;
				if (this._xscale<150) {
					this._xscale += 10;
					this._yscale += 10;
				} else {
					contText.text = "muevete presionando LEFT o DOWN (con SPACE te detienes / centras)";
					if (pos == 0) {
						if (this._x<(Stage.width-30)) {
							this._x += 30;
						} else if (this._x>(Stage.width-30)) {
							this._x = -Stage.width;
						}
					}
					if (pos == 1) {
						if (this._y<(Stage.height-30)) {
							this._y += 30;
						} else if (this._y>(Stage.height-30)) {
							this._y = -Stage.height;
						}
					}
					if (pos == 2) {
						this._x = Stage.width/2;
						this._y = Stage.height/2;
					}
				}
				if (this._alpha<2) {
					this._alpha = 100;
				}
			}
		}
	};
}
var presionaTecla:Object = new Object();
presionaTecla.onKeyDown = function() {
	if (Key.isDown(Key.DOWN)) {
		pos = 1;
		contText._visible = false;
	}
	if (Key.isDown(Key.RIGHT)) {
		pos = 0;
		contText._visible = false;
	}
	if (Key.isDown(Key.SPACE)) {
		pos = 2;
		contText._visible = true;
	}
};
Key.addListener(presionaTecla);

Última edición por plotz!; 14/10/2005 a las 06:22
  #10 (permalink)  
Antiguo 14/10/2005, 08:56
Avatar de ostrasjo  
Fecha de Ingreso: diciembre-2004
Mensajes: 165
Antigüedad: 19 años, 4 meses
Puntos: 0
A mi me da error este último código...
  #11 (permalink)  
Antiguo 15/10/2005, 11:40
 
Fecha de Ingreso: julio-2004
Mensajes: 71
Antigüedad: 19 años, 9 meses
Puntos: 0
disculpen... no me fije.. k en fp 7 esto no funciona ¬¬''...


aki esta el codigo pa fp7....


Código:
comenzar(1);
function comenzar(n:Number):Void {
	var contText:MovieClip = this.createEmptyMovieClip("contText", this.getNextHighestDepth());
	contText.createTextField("contText", 0, 0, 0, 360, 20);
	var cont:MovieClip = this.createEmptyMovieClip("c", n);
	var x:Number = 0;
	var y:Number = 0;
	var a:Number = 0;
	//cont._alpha = 0;
	cont._x = Stage.width/2;
	cont._y = Stage.height/2;
	contText._x = (Stage.width/2)-(contText._width/2);
	contText._y = (Stage.height/2)+100;
	cont.onEnterFrame = function() {
		this._rotation += 15;
		if (a<80) {
			a += 1.5;
			x = 40*Math.sin(a*3.5);
			y = 40*Math.cos(a*3.5);
			if (a<2) {
				cont.moveTo(x, y);
			}
			cont.lineStyle(1, 0x0066cc, 20);
			cont.lineTo(x, y);
		} else {
			if (a<151) {
				a++;
				x = 60*Math.sin(a*2.5);
				y = 60*Math.cos(a*2.5);
				if (a%2 == 0) {
					cont.lineStyle(3, 0xFDCA02, 20);
				} else {
					cont.lineStyle(3, 0xFF00FF, 20);
				}
				cont.lineTo(x, y);
			} else {
				this._alpha -= 10;
				if (this._xscale<150) {
					this._xscale += 10;
					this._yscale += 10;
				} else {
					contText.contText.text = "muevete presionando LEFT o DOWN (con SPACE te detienes / centras)";
					if (pos == 0) {
						if (this._x<(Stage.width-30)) {
							this._x += 30;
						} else if (this._x>(Stage.width-30)) {
							this._x = -Stage.width;
						}
					}
					if (pos == 1) {
						if (this._y<(Stage.height-30)) {
							this._y += 30;
						} else if (this._y>(Stage.height-30)) {
							this._y = -Stage.height;
						}
					}
					if (pos == 2) {
						this._x = Stage.width/2;
						this._y = Stage.height/2;
					}
				}
				if (this._alpha<2) {
					this._alpha = 100;
				}
			}
		}
	};
}
var presionaTecla:Object = new Object();
presionaTecla.onKeyDown = function() {
	if (Key.isDown(Key.DOWN)) {
		pos = 1;
		contText._visible = false;
	}
	if (Key.isDown(Key.RIGHT)) {
		pos = 0;
		contText._visible = false;
	}
	if (Key.isDown(Key.SPACE)) {
		pos = 2;
		contText._visible = true;
	}
};
Key.addListener(presionaTecla);
  #12 (permalink)  
Antiguo 15/10/2005, 15:51
Avatar de julio archila  
Fecha de Ingreso: marzo-2005
Ubicación: Quetzaltenango, Guatemala
Mensajes: 272
Antigüedad: 19 años, 1 mes
Puntos: 0
yo tambien quiero participar

aqui va mi respuesta al tiro, no se si sea permitido esto, pero ahi va:

Código:
 
var cont:MovieClip = this.createEmptyMovieClip("c", 10);
var x:Number = 0;
var y:Number = 0;
var a:Number = 2;
var alfa:Number = 1;
var vel:Number = 5;
var bol:Boolean = true;
this.createTextField("texto", 1, Stage.width/2-80, Stage.height/2+80, 300, 100);
var form:TextFormat = new TextFormat();
form.font = "arial";
form.size = 10;
form.color = 0x666666;
texto.text = "Presione sobre la imagen dibujada.";
texto.setTextFormat(form);
cont._x = Stage.width/2-80;
cont._y = Stage.height/2;
cont.onEnterFrame = function() {
this._rotation -= vel;
if (a++<74) {
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++<180) {
x = 40*Math.sin(a*-10);
y = 40*Math.cos(a*-10);
if (a<2) {
cont.moveTo(x, y);
}
if (bol) {
cont.lineStyle(1, 0x999999, 40);
bol = false;
} else {
cont.lineStyle(1, 0x999999, 40);
bol = true;
}
cont.curveTo(x*0.5, y*0.5, x*0, y*0);
cont.lineTo(x, y);
}
}
};
cont.onRelease = function() {
this.duplicateMovieClip("cont2", "");
var color:Color = new Color(cont2);
color.setRGB(0x006699);
cont2._alpha = 0;
cont2._x = Stage.width/2+75;
cont2._y = Stage.height/2;
cont2.onEnterFrame = function() {
cont2._rotation += vel;
cont2._alpha += alfa;
};
};

saludos
__________________
Julio Archila

Última edición por julio archila; 15/10/2005 a las 15:59
  #13 (permalink)  
Antiguo 17/10/2005, 23:20
Avatar de stock  
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 10 meses
Puntos: 53
Mis segundo disparo!! espero les agrade!!

es importante poner 100 fotogramas por segundo

Código PHP:
var cont:MovieClip this.createEmptyMovieClip("c"0);
var 
x:Number 0;
var 
y:Number 0;
var 
a:Number 2;
var 
n:Number 5;
var 
bol:Boolean true;
var 
listener:Object = new Object();
Mouse.addListener(listener);

this.createTextField("texto"1Stage.width/2-80Stage.height/2+80300100);
var 
form:TextFormat = new TextFormat();
form.font "arial";
form.size 10;
form.color 0x666666;
texto.text "Formando imagen, espera...";
texto.setTextFormat(form);
cont._x Stage.width/2;
cont._y Stage.height/2;

cont.onEnterFrame = function():Void {
    
this._rotation -= 5;
    
    if (
a<74) {
        
a++;
        
80*Math.sin(a*42);
        
80*Math.cos(a*42);
        if (
a<20) {
            
cont.moveTo(xy);
        }
        
cont.lineStyle(0.50x99999960);
        
cont.lineTo(xy);
    }else{
        if (
a++<200) {
            
a++;
            
40*Math.sin(a*-15);
            
40*Math.cos(a*-15);
            if (
bol) {
                
cont.lineStyle(10x99999940);
                
bol false;
            } else {
                
cont.lineStyle(10x99999940);
                
bol true;
            }
            
cont.curveTo(x*0.5y*0.500);
            
cont.lineTo(xy);
        }else if(
350){
            
texto.text "Imagen Completa...";
            
texto.setTextFormat(form);
        }
    }
    if(
a>=350){
        if(
this._xscale>30){
            
Mouse.hide();
            
texto.text "Click donde quieras!!";
            
texto.setTextFormat(form);
            
this._xscale this._xscale-2;
            
this._yscale this._xscale;
        }
    }
}

listener.onMouseMove = function():Void{
    if(
a>400){
        
cont._x _xmouse;
        
cont._y _ymouse;
    }
}

listener.onMouseDown = function():Void{
    if(
a>400){
        
disparar(cont.duplicateMovieClip("disparo"+n,n));
        
n++;
    }
}

function 
disparar(mc:MovieClip):Void{
    var 
d:Number 0.5;
    var 
asig:Boolean false;
    var 
dir:Number;
    
dir Math.floor(Math.random()*4) + 1;
    
mc.onEnterFrame = function():Void{
        
this._rotation += 5;
        
this._xscale-=5;
        
d*1.2;
        switch(
dir){
            case 
:  this._x += d;
                      
this._y += d;
                      break;
            case 
:  this._x -= d;
                      
this._y -= d;
                      break;
            case 
:  this._x -= d;
                      
this._y += d;
                      
asig true;
                      break;
            case 
:  this._x += d;
                      
this._y -= d;
                      
asig true;
                      break;
        }
        
        if(
this._x Stage.width || this._y Stage.height || this._y || this._x 0){
            
this.removeMovieClip();
        }
    }    

have funnnnnnn

Última edición por stock; 28/10/2005 a las 13:02
  #14 (permalink)  
Antiguo 23/10/2005, 12:51
Avatar de julio archila  
Fecha de Ingreso: marzo-2005
Ubicación: Quetzaltenango, Guatemala
Mensajes: 272
Antigüedad: 19 años, 1 mes
Puntos: 0
Aqui va el contraataque !!! jejeje

100 fotogramas por segundo :


Código:
var cont:MovieClip = this.createEmptyMovieClip("c", 0);
var dirx:Number = 1;
var diry:Number = 1;
var x:Number = 0;
var y:Number = 0;
var a:Number = 2;
var n:Number = 5;
this.createTextField("texto", 1, Stage.width/2-80, Stage.height/2+80, 300, 100);
var form:TextFormat = new TextFormat();
form.font = "arial";
form.size = 10;
form.color = 0x006699;
texto.text = "Formando imagen, espera...";
texto.setTextFormat(form);
cont._x = Stage.width/2;
cont._y = Stage.height/2;
cont.onEnterFrame = function():Void  {
 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) {
  Mouse.hide();
  texto.text = "???.....!!!";
  texto.setTextFormat(form);
  this._xscale -= 1;
  this._yscale = this._xscale;
  if (this._xscale<=30) {
   cont.onEnterFrame = function() {
    cont._rotation -= 5;
    if (dirx == 1) {
     cont._x += 5;
    } else {
     cont._x -= 15;
    }
    if (diry == 1) {
     cont._y += 10;
    } else {
     cont._y -= 10;
    }
    if (cont._x>=Stage.width-25) {
     disparar(cont.duplicateMovieClip("disparo"+n, n));
     n++;
     dirx = 0;
    }
    if (cont._y>=Stage.height-25) {
     disparar(cont.duplicateMovieClip("disparo"+n, n));
     n++;
     diry = 0;
    }
    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._rotation -= 5;
  this._xscale += 20;
  this._yscale = this._xscale;
  this._alpha -= 10;
  color.setRGB(random(0xfff63));
  if (this._alpha<0) {
   this.removeMovieClip();
  }
 };
}
saludos
__________________
Julio Archila

Última edición por julio archila; 27/10/2005 a las 10:12
  #15 (permalink)  
Antiguo 29/10/2005, 21:53
Avatar de stock  
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 10 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;
    
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++;
            
80*Math.sin(a*42);
            
80*Math.cos(a*42);
            if (
a<20) {
                
cont.moveTo(xy);
            }
            
cont.lineStyle(0.50x99999960);
            
cont.lineTo(xy);
        } else {
            if (
a++<200) {
                
a++;
                
40*Math.sin(a*-15);
                
40*Math.cos(a*-15);
                if (
bol) {
                    
cont.lineStyle(10x99999940);
                } else {
                    
cont.lineStyle(10x99999940);
                }
                
cont.curveTo(x*0.5y*0.500);
                
cont.lineTo(xy);
            } 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 += 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 -= +Math.floor(Math.random()*5);
                    }
                    if (
cont._x>=Stage.width-25) {
                        
disparar(cont.duplicateMovieClip("disparo"+nn));
                        
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"+nn));
                        
n++;
                        
dirx 1;
                    }
                    if (
cont._y<=25) {
                        
disparar(cont.duplicateMovieClip("disparo"+nn));
                        
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(0x918EAC100);
    
barra.moveTo(-500);
    
barra.lineTo(500);
    
barra.lineTo(5020);
    
barra.lineTo(-5020);
    
barra.lineTo(-500);
    
barra.endFill();
    
barra._x x;
    
barra._y y
}

function 
crearMsgs():Void{
    
this.createTextField("texto"2Stage.width/2-80Stage.height/2+80300100);
    
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/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
  #16 (permalink)  
Antiguo 02/11/2005, 20:06
Avatar de julio archila  
Fecha de Ingreso: marzo-2005
Ubicación: Quetzaltenango, Guatemala
Mensajes: 272
Antigüedad: 19 años, 1 mes
Puntos: 0
otro contraataque!!!!

100 fotogramas por segundo:

muy buena la idea del juego asi que aca estan unos arreglitos jejeje
intenta superar el nivel 10 jejeje...

suerte !!!

Código:
 
var cont:MovieClip;
var barra:MovieClip;
var form:TextFormat;
var velocidad:Number = 5;
var n:Number = 5;
var puntaje:Number = 0;
var nivel:Number = 0;
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);
   puntos.text = "Puntos ::>> "+puntaje;
   puntos.setTextFormat(form_pnt);
   level.text = "NIVEL "+nivel;
   level.setTextFormat(level_pnt);
   puntaje = 0;
   nivel = 1;
   this._xscale -= 1;
   this._yscale = this._xscale;
   if (this._xscale<=30) {
    texto.text = "JUGANDO!!";
    texto.setTextFormat(form);
    cont.onEnterFrame = function() {
     this._xscale = (2000/this._y);
     this._yscale = this._xscale;
     if (puntaje<=11 && puntaje>1) {
      nivel = 1;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=11 && puntaje<21) {
      nivel = 2;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=21 && puntaje<31) {
      nivel = 3;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=31 && puntaje<41) {
      nivel = 4;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=41 && puntaje<51) {
      nivel = 5;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=61 && puntaje<71) {
      nivel = 6;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=71 && puntaje<81) {
      nivel = 7;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=81 && puntaje<91) {
      nivel = 8;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=91 && puntaje<101) {
      nivel = 9;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     if (puntaje>=101 && puntaje>101) {
      nivel = 10;
      level.text = "NIVEL "+nivel;
      level.setTextFormat(level_pnt);
     }
     barra._x = _root._xmouse;
     if (dirx == 1) {
      cont._x += velocidad+Math.floor(puntaje/5);
     } else {
      cont._x -= velocidad+Math.floor(puntaje/10);
     }
     if (diry == 1) {
      cont._y += velocidad+Math.floor(puntaje/5);
     } else {
      cont._y -= velocidad+Math.floor(puntaje/10);
     }
     if (cont._x>=Stage.width-25) {
      disparar(cont.duplicateMovieClip("disparo"+n, n));
      n++;
      dirx = 0;
     }
     if (cont._y>=Stage.height-50) {
      if (cont._x>=barra._x-25 && cont._x<=barra._x-25+(barra._width) && cont._y>=barra._y-8) {
       var cont_color:Color = new Color(cont);
       cont_color.setRGB(random(0x666666));
       puntos.text = "Puntos ::>> "+puntaje;
       puntos.setTextFormat(form_pnt);
       puntaje += 1;
       diry = 0;
      } else if (cont._y>Stage.height+30) {
       texto.text = "Has perdido, Presiona La Barra Espaciadora para jugar de nuevo";
       texto.setTextFormat(form);
       puntos.text = "Puntaje Total ::>> "+puntaje;
       puntos.setTextFormat(form_pnt);
       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(0x006699, 100);
 barra.curveTo(-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, 10, 10, 10, 10);
 form = new TextFormat();
 form.font = "verdana";
 form.bold = true;
 form.size = 14;
 form.color = 0xffffff;
 form.align = "center";
 with (texto) {
  text = "Formando imagen, espera...";
  setTextFormat(form);
  selectable = false;
  autoSize = true;
  background = true;
  backgroundColor = "0x003366";
 }
 this.createTextField("puntos", 3, 10, texto._y+20, 10, 10);
 puntos.autoSize = true;
 puntos.background = true;
 puntos.backgroundColor = "0x003366";
 puntos.selectable = false;
 form_pnt = new TextFormat();
 form_pnt.font = "verdana";
 form_pnt.size = 18;
 form_pnt.bold = true;
 form_pnt.color = 0xffffff;
 form_pnt.align = "left";
 this.createTextField("level", 4, 10, puntos._y+25, 10, 10);
 level.autoSize = true;
 level.background = true;
 level.backgroundColor = "0x003366";
 level.selectable = false;
 level_pnt = new TextFormat();
 level_pnt.font = "verdana";
 level_pnt.size = 16;
 level_pnt.bold = true;
 level_pnt.color = 0xffffff;
 level_pnt.align = "left";
}
var myListener:Object = new Object();
Key.addListener(myListener);
myListener.onKeyUp = function() {
 if (Key.getAscii() == Key.SPACE) {
  iniciar();
 }
};
saludos ...
__________________
Julio Archila
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:39.