Hola estoy creando unos objetos:
Código Javascript
:
Ver originalvar pj=function(name,type,arm...){
this.name=name;
this.width=width||20;
...
}
pj.prototype.draw=function(x,y,width,height,rotate){
width=width||this.width;
height=height||this.height;
rotate=rotate||this.rotate;
c.save();
c.setTransform(1,0,0,1,0,0);
c.translate(x+.5*width,y+.5*height);
c.rotate(rotate*Math.PI/180);
...
}
//Parte importante
pj.prototype.animation={
made:function(animation){
console.log(animation.x);
animation.eyesUp={
change:'y',
llegar:function(){
//console.log(animation);
}
}
}
};
En el objeto animation de pj quiero acceder desde made hasta pj. Osea desde el objeto made de animation de pj hasta pj, el padre supongo ...
He probado con hacer una function auto ejecutable para pasar le como argumento el this pero no funciona. Alguna idea?
Saludo