Saludos:
Oigan, no entiendo muy bien todavia como funciona este tenis, en diseño se se como esta el rollo, pero bueno, diganme si esto que puse se considera un tiro, si es asi, para seguirle dando.(esta muy sencillo pero que sirve de ejemplo).
Código:
//Teclas de Accion:
//Mouse y click
var shot:MovieClip;
var sizeShot:Number = 10;
var lis:Object = {};
var count:Number;
function init() {
Stage.scaleMode = "noScale";
count = 5;
shot = drawTri(sizeShot, 0x990000);
shot._y = Stage.height-sizeShot;
var mouse:Object = new Object();
mouse.onMouseDown=function(){doBullet();};
Mouse.addListener(mouse);
}
_root.onEnterFrame=function(){
shot._x=_root._xmouse;
}
function doBullet() {
var tiro = this.createEmptyMovieClip("a"+count++, count++, {_x:shot._x, _y:shot._y});
tiro.moveTo(shot._x, shot._y);
tiro.lineStyle(0);
tiro.lineTo(shot._x, shot._y);
tiro.lineTo(shot._x, (shot._y-10));
tiro.onEnterFrame = moveShot;
}
function moveShot() {
if (this._alpha > 0) {
this._y -= 10;
this._alpha -= 1
} else {
this.removeMovieClip();
}
}
function drawTri(size:Number, color:Number) {
var shot:MovieClip = this.createEmptyMovieClip("shot", 2);
shot.lineStyle(1, color);
shot.beginFill(color);
shot.moveTo(0, size);
shot.lineTo(0, size);
shot.lineTo(size, size);
shot.lineTo((size/2), 0);
shot.lineTo(0, size);
return shot;
}
init();
espero y este en lo correcto, hasta luego...