Hola

Páginas: 3 (671 palabras) Publicado: 7 de junio de 2012
el codigo para la camara que sigue al jugador :

---Codigo dentro del MovieClip ( rectangulo sin relleno)

onClipEvent (enterFrame) {
_y += (_root.jugador._y-_y)/4;
_x +=(_root.jugador._x-_x)/4;
}

--Codigo en el fotograma ( entrar en el MovieClip (rectangulo sin relleno) y en el primer fotograma de la primer capa pegar el codigo ) :

/**
* VCam AS2 v1.0
*
* VCam basedon original code by Sham Bhangal and Dave Dixon
*
* Dynamic Registration AS2 work by Darron Schall (www.darronschall.com)
* and AS1 work by Robert Penner (www.robertpenner.com)
*
*Special Thanks to Josh Steele and Jeff Brenner
*
* @author Bryan Heisey
* @version 1.0
* @created 1-April-2008
*
* Requirements: Flash 8+ & Actionscript 2
*/

importflash.display.BitmapData;

addProperty("_x2",get_x2,set_x2);
addProperty("_y2",get_y2,set_y2);
addProperty("_xscale2",get_xscale2,set_xscale2);
addProperty("_yscale2",get_yscale2,set_yscale2);addProperty("_rotation2",get_rotation2,set_rotation2);

////////////////////////////////////////////////////////////////////////////
// Get stage width and height//////////////////////////////////////////////

var oldScaleMode:String = stage.scaleMode;
stage.scaleMode = "exactFit";

var sW:Number = Stage.width;
var sH:Number = Stage.height;

stage.scaleMode = oldScaleMode;////////////////////////////////////////////////////////////////////////////
// Get Vcam width and height ///////////////////////////////////////////////

var bounds_obj:Object =this.getBounds(this);

var camH:Number = Math.abs(bounds_obj.yMax-bounds_obj.yMin);
var camW:Number = Math.abs(bounds_obj.xMax-bounds_obj.xMin);////////////////////////////////////////////////////////////////////////////
// Creat Point for dynamic registration point //////////////////////////////

var rp = {x:this._x, y:this._y};

onEnterFrame = function ():Void {
camControl();
};...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • hola hola hola hola
  • hola hola hola hola hola
  • hola hola hhola hola y hola
  • hola hola hola
  • Hola Hola Hola
  • Hola Hola Hola
  • hola hola hola
  • Hola hola

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS