function
Shape(ax,ay)
{
var x = 0 ;
var y = 0 ;
this .gx = 0 ;
this .gy = 0 ;
var init = function ()
{
x = ax; // 访问私有属性,直接写变量名即可
y = ay;
this .gx = ax; // 访问公有属性,需要在变量名前加上this.
this .gy = ay;
};
init();
}
{
var x = 0 ;
var y = 0 ;
this .gx = 0 ;
this .gy = 0 ;
var init = function ()
{
x = ax; // 访问私有属性,直接写变量名即可
y = ay;
this .gx = ax; // 访问公有属性,需要在变量名前加上this.
this .gy = ay;
};
init();
}