建议场景大小550*400,背景色0x000000
init();
function init() {
setups();
initColors();
createAll();
activeMove();
}
function createAll() {
createEye();
createScreen();
createObjects();
createLogo();
}
function createEye() {
this.createEmptyMovieClip("eye", 300);
}
function setups() {
fscommand("showmenu", false);
fscommand("allowscale", false);
fscommand("trapallkeys", true);
}
function initColors() {
tf = new TextFormat();
tf.font = "Arial";
tf.align = "center";
small = 50;
lightFlag = true;
wallColor = "0x666666";
menuColor = "0x000000";
screenColor = "0x290201";
shadowColor = "0x000000";
widowColor = "0x999999";
glassColor = "0x000099";
ceilColor = "0x633101";
lineColor = "0x000000";
lineAlpha = 30;
glassAlpha = 10;
fillAlpha = 100;
shadowAlpha = 30;
curtainAlpha = 95;
}
function shutLight(flag) {
if (flag) {
lineColor = "0x000000";
glassAlpha = 10;
fillAlpha = 100;
shadowAlpha = 30;
curtainAlpha = 95;
} else {
lineColor = "0x00ff00";
glassAlpha = 0;
fillAlpha = 0;
shadowAlpha = 0;
curtainAlpha = 0;
}
}
function createLogo() {
this.createEmptyMovieClip("logo", 200);
this.logo._x = 505;
this.logo._y = 380;
this.logo.createTextField("txt", 0, 0, 0, 45, 20);
var textFormat = new TextFormat();
textFormat.font = "Arial";
textFormat.color = "0xcccccc";
this.logo.txt.selectable = false;
this.logo.txt.text = "James";
this.logo.txt.setTextFormat(textFormat);
}
function createScreen() {
this.createEmptyMovieClip("screen", 100);
with (this.screen) {
moveTo(0, 0);
lineStyle(0, lineColor, lineAlpha);
lineTo(550, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 0);
moveTo(-500, -500);
beginFill(menuColor, 100);
lineTo(1050, -500);
lineTo(1050, 0);
lineStyle(0, menuColor, 0);
lineTo(550, 0);
lineStyle(0, menuColor, lineAlpha);
lineTo(0, 0);
lineStyle(0, menuColor, 0);
lineTo(-500, 0);
lineStyle(0, menuColor, lineAlpha);
lineTo(-500, 400);
lineStyle(0, menuColor, 0);
lineTo(0, 400);
lineStyle(0, menuColor, lineAlpha);
lineTo(0, 0);
lineStyle(0, menuColor, 0);
lineTo(-500, 0);
lineStyle(0, menuColor, lineAlpha);
moveTo(1050, 900);
lineTo(-500, 900);
lineTo(-500, 400);
lineStyle(0, menuColor, 0);
lineTo(0, 400);
lineStyle(0, lineColor, lineAlpha);
lineTo(550, 400);
lineStyle(0, menuColor, 0);
lineTo(1050, 400);
lineStyle(0, menuColor, lineAlpha);
lineTo(1050, 0);
lineStyle(0, menuColor, 0);
lineTo(550, 0);
lineStyle(0, lineColor, lineAlpha);
lineTo(550, 400);
lineStyle(0, menuColor, 0);
lineTo(1050, 400);
lineStyle(0, menuColor, lineAlpha);
lineTo(1050, 900);
endFill();
}
}
function createObjects() {
this.createEmptyMovieClip("line", 0);
this.createEmptyMovieClip("wall", 1);
this.createEmptyMovieClip("bed", 2);
this.createEmptyMovieClip("desk", 3);
this.createEmptyMovieClip("chair", 4);
this.createEmptyMovieClip("light", 5);
this.createEmptyMovieClip("table", 6);
this.desk.createEmptyMovieClip("computer", 0);
this.table.createEmptyMovieClip("box", 0);
this.table.createEmptyMovieClip("body", 1);
}
function joinBtn(btn, msg) {
btn.onRollOver = function() {
_root.createTextField("tt", 150, 0, 0, 20, 20);
_root.tt.border = true;
_root.tt.selectable = false;
_root.tt.background = true;
_root.tt.backgroundColor = "0xffffff";
_root.tt.text = msg;
_root.tt.setTextFormat(tf);
_root.tt._width = _root.tt.textWidth+10;
_root.tt._visible = false;
};
btn.onRollOut = function() {
_root.tt.removeTextField();
};
}
function updateTT() {
if (_root.tt != undefined) {
_root.tt._visible = true;
_root.tt._x = _xmouse+20;
_root.tt._y = _ymouse+20;
}
}
function activeMove() {
joinBtn(this.light, "Structure");
joinBtn(this.bed, "Normal");
joinBtn(this.table.box, "Mysterious");
joinBtn(this.desk.computer, "Mail to me");
this.light.onRelease = function() {
lightFlag = !lightFlag;
shutLight(lightFlag);
updateAll();
};
this.table.box.onRelease = function() {
//small -= 2;
//small = Math.max(2, small);
small = 2;
updateAll();
};
this.bed.onRelease = function() {
//small += 2;
//small = Math.min(50, small);
small = 50;
updateAll();
};
this.desk.computer.onRelease = function() {
getURL("mailto:[email protected]");
};
this.onMouseMove = function() {
updateAfterEvent();
updateAll();
};
}
function updateAll() {
updateAfterEvent();
updateEye();
updateWall();
updateLines();
updateBed();
updateDesk();
updateChair();
updateLight();
updateTable();
updateTT();
}
function updateTable() {
var x1 = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 8/7, 5);
var y1 = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 8/7, 5);
var x2 = get1(this.wall.xrd+this.wall._x, this.eye.xrd+this.eye._x, 5);
var y2 = get1(this.wall.yrd+this.wall._y, this.eye.yrd+this.eye._y, 5);
var x3 = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 8/7, 3);
var y3 = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 8/7, 3);
var x4 = get1(this.wall.xrd+this.wall._x, this.eye.xrd+this.eye._x, 3);
var y4 = get1(this.wall.yrd+this.wall._y, this.eye.yrd+this.eye._y, 3);
var x1a = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 8/7, 2, 5);
var y1a = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 8/7, 2, 5);
var x2a = get2(this.wall.xrd+this.wall._x, this.eye.xrd+this.eye._x, this.wall.xru+this.wall._x, this.eye.xru+this.eye._x, 5, 2);
var y2a = get2(this.wall.yrd+this.wall._y, this.eye.yrd+this.eye._y, this.wall.yru+this.wall._y, this.eye.yru+this.eye._y, 5, 2);
var x3a = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 8/7, 2, 3);
var y3a = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 8/7, 2, 3);
var x4a = get2(this.wall.xrd+this.wall._x, this.eye.xrd+this.eye._x, this.wall.xru+this.wall._x, this.eye.xru+this.eye._x, 3, 2);
var y4a = get2(this.wall.yrd+this.wall._y, this.eye.yrd+this.eye._y, this.wall.yru+this.wall._y, this.eye.yru+this.eye._y, 3, 2);
with (this.table.box) {
clear();
//音箱
lineStyle(0, lineColor, lineAlpha);
moveTo(get2(x1, x2, x3, x4, 10, -10), get2(y1, y2, y3, y4, 10, -10));
beginFill("0x333333", fillAlpha);
lineTo(get2(x1, x2, x3, x4, 10, -2), get2(y1, y2, y3, y4, 10, -2));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -2, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -2, 2));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -10, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -10, 2));
lineTo(get2(x1, x2, x3, x4, 10, -10), get2(y1, y2, y3, y4, 10, -10));
endFill();
moveTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -10, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -10, 2));
beginFill("0x101010", fillAlpha);
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -2, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -2, 2));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10/9, -2, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10/9, -2, 2));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10/9, -10, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10/9, -10, 2));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -10, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -10, 2));
endFill();
moveTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -10, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -10, 2));
beginFill("0x000000", fillAlpha);
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10/9, -10, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10/9, -10, 2));
lineTo(get2(x1, x2, x3, x4, 10/9, -10), get2(y1, y2, y3, y4, 10/9, -10));
lineTo(get2(x1, x2, x3, x4, 10, -10), get2(y1, y2, y3, y4, 10, -10));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -10, 2), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -10, 2));
endFill();
//音箱内侧
moveTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -20/3, 40), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -20/3, 40));
beginFill("0x020202", fillAlpha);
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -20/3, 40/19), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -20/3, 40/19));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -20/9, 40/19), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -20/9, 40/19));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -20/9, 40), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -20/9, 40));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, -20/3, 40), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, -20/3, 40));
endFill();
}
with (this.table.body) {
clear();
//投影
moveTo(x1, y1);
beginFill(shadowColor, shadowAlpha);
lineTo(x2, y2);
lineTo(x4, y4);
lineTo(x3, y3);
lineTo(x1, y1);
endFill();
//桌腿儿
lineStyle(0, lineColor, 100);
moveTo(x1, y1);
lineTo(get1(x1a, x1, 3), get1(y1a, y1, 3));
moveTo(x2, y2);
lineTo(get1(x2a, x2, 3), get1(y2a, y2, 3));
moveTo(x4, y4);
lineTo(get1(x4a, x4, 3), get1(y4a, y4, 3));
lineStyle(0, lineColor, 100);
moveTo(get1(x1a, x1, 1.5), get1(y1a, y1, 1.5));
beginFill("0x552b00", fillAlpha);
lineTo(get1(x2a, x2, 1.5), get1(y2a, y2, 1.5));
lineTo(get1(x4a, x4, 1.5), get1(y4a, y4, 1.5));
lineTo(get1(x3a, x3, 1.5), get1(y3a, y3, 1.5));
lineTo(get1(x1a, x1, 1.5), get1(y1a, y1, 1.5));
endFill();
//音响机器
lineStyle(0, lineColor, lineAlpha);
moveTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10, 3), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10, 3));
beginFill("0x999999", fillAlpha);
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10, 2.7));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10/9, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10/9, 2.7));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10/9, 3), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10/9, 3));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10, 3), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10, 3));
endFill();
moveTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10, 2.7));
beginFill("0x777777", fillAlpha);
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10/9, 10, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10/9, 10, 2.7));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10/9, 10/9, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10/9, 10/9, 2.7));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10/9, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10/9, 2.7));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10, 2.7));
endFill();
moveTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10/9, 3), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10/9, 3));
beginFill("0x555555", fillAlpha);
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10/9, 10/9, 3), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10/9, 10/9, 3));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10/9, 10/9, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10/9, 10/9, 2.7));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10/9, 2.7), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10/9, 2.7));
lineTo(get3(x1, x2, x3, x4, x1a, x2a, x3a, x4a, 10, 10/9, 3), get3(y1, y2, y3, y4, y1a, y2a, y3a, y4a, 10, 10/9, 3));
endFill();
lineStyle(0, lineColor, 100);
moveTo(get1(x1a, x1, 3), get1(y1a, y1, 3));
beginFill("0x552b00", fillAlpha);
lineTo(get1(x2a, x2, 3), get1(y2a, y2, 3));
lineTo(get1(x4a, x4, 3), get1(y4a, y4, 3));
lineTo(get1(x3a, x3, 3), get1(y3a, y3, 3));
lineTo(get1(x1a, x1, 3), get1(y1a, y1, 3));
endFill();
lineStyle(0, lineColor, 100);
moveTo(x3, y3);
lineTo(get1(x3a, x3, 3), get1(y3a, y3, 3));
}
}
function updateLight() {
this.light.xlf = get2(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, 7/3, 7/2);
this.light.ylf = get2(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, 7/3, 7/2);
this.light.xrf = get2(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, 7/4, 7/2);
this.light.yrf = get2(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, 7/4, 7/2);
this.light.xln = get2(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, 7/3, 7/3);
this.light.yln = get2(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, 7/3, 7/3);
this.light.xrn = get2(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, 7/4, 7/3);
this.light.yrn = get2(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, 7/4, 7/3);
this.light.xlf2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 7/3, 7/2, 40);
this.light.ylf2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 7/3, 7/2, 40);
this.light.xrf2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 7/4, 7/2, 40);
this.light.yrf2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 7/4, 7/2, 40);
this.light.xln2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 7/3, 7/3, 40);
this.light.yln2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 7/3, 7/3, 40);
this.light.xrn2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 7/4, 7/3, 40);
this.light.yrn2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 7/4, 7/3, 40);
with (this.light) {
clear();
//投影
lineStyle(0, lineColor, lineAlpha);
moveTo(this.light.xlf, this.light.ylf);
beginFill(shadowColor, shadowAlpha);
lineTo(this.light.xrf, this.light.yrf);
lineTo(this.light.xrn, this.light.yrn);
lineTo(this.light.xln, this.light.yln);
lineTo(this.light.xlf, this.light.ylf);
endFill();
//灯
lineStyle(0, lineColor, 0);
moveTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5/4));
beginFill("0xcccccc", fillAlpha);
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5));
lineTo(get2(this.light.xlf, this.light.xrf, this.light.xln, this.light.xrn, 2, 2), get2(this.light.ylf, this.light.yrf, this.light.yln, this.light.yrn, 2, 2));
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5/4));
endFill();
moveTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5));
beginFill("0xffffff", fillAlpha);
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5, 5));
lineTo(get2(this.light.xlf, this.light.xrf, this.light.xln, this.light.xrn, 2, 2), get2(this.light.ylf, this.light.yrf, this.light.yln, this.light.yrn, 2, 2));
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5));
endFill();
moveTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5, 5));
beginFill("0xcccccc", fillAlpha);
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5, 5/4));
lineTo(get2(this.light.xlf, this.light.xrf, this.light.xln, this.light.xrn, 2, 2), get2(this.light.ylf, this.light.yrf, this.light.yln, this.light.yrn, 2, 2));
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5, 5));
endFill();
moveTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5/4));
beginFill("0x999999", fillAlpha);
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5, 5/4));
lineTo(get2(this.light.xlf, this.light.xrf, this.light.xln, this.light.xrn, 2, 2), get2(this.light.ylf, this.light.yrf, this.light.yln, this.light.yrn, 2, 2));
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5/4));
endFill();
//边框
moveTo(this.light.xlf, this.light.ylf);
beginFill("0x2B1500", fillAlpha);
lineTo(this.light.xlf2, this.light.ylf2);
lineTo(this.light.xrf2, this.light.yrf2);
lineTo(this.light.xrf, this.light.yrf);
lineTo(this.light.xlf, this.light.ylf);
endFill();
moveTo(this.light.xlf, this.light.ylf);
beginFill("0x2B1500", fillAlpha);
lineTo(this.light.xlf2, this.light.ylf2);
lineTo(this.light.xln2, this.light.yln2);
lineTo(this.light.xln, this.light.yln);
lineTo(this.light.xlf, this.light.ylf);
endFill();
moveTo(this.light.xrf, this.light.yrf);
beginFill("0x2B1500", fillAlpha);
lineTo(this.light.xrf2, this.light.yrf2);
lineTo(this.light.xrn2, this.light.yrn2);
lineTo(this.light.xrn, this.light.yrn);
lineTo(this.light.xrf, this.light.yrf);
endFill();
moveTo(this.light.xln, this.light.yln);
beginFill("0x0F0700", fillAlpha);
lineTo(this.light.xln2, this.light.yln2);
lineTo(this.light.xrn2, this.light.yrn2);
lineTo(this.light.xrn, this.light.yrn);
lineTo(this.light.xln, this.light.yln);
endFill();
//下盖
lineStyle(0, lineColor, lineAlpha);
moveTo(this.light.xlf2, this.light.ylf2);
beginFill("0x663300", fillAlpha);
lineTo(this.light.xln2, this.light.yln2);
lineTo(this.light.xrn2, this.light.yrn2);
lineStyle(0, lineColor, 0);
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5/4));
lineStyle(0, lineColor, lineAlpha);
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5, 5/4));
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5, 5));
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5));
lineTo(get2(this.light.xlf2, this.light.xrf2, this.light.xln2, this.light.xrn2, 5/4, 5/4), get2(this.light.ylf2, this.light.yrf2, this.light.yln2, this.light.yrn2, 5/4, 5/4));
lineStyle(0, lineColor, 0);
lineTo(this.light.xrn2, this.light.yrn2);
lineStyle(0, lineColor, lineAlpha);
lineTo(this.light.xrf2, this.light.yrf2);
lineTo(this.light.xlf2, this.light.ylf2);
endFill();
}
}
function updateChair() {
this.chair.xlf = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 4, 3);
this.chair.ylf = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 4, 3);
this.chair.xrf = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 2.2, 3);
this.chair.yrf = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 2.2, 3);
this.chair.xln = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 4, 2);
this.chair.yln = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 4, 2);
this.chair.xrn = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 2.2, 2);
this.chair.yrn = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 2.2, 2);
this.chair.xlf2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 4, 3/2, 3);
this.chair.ylf2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 4, 3/2, 3);
this.chair.xrf2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 2.2, 3/2, 3);
this.chair.yrf2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 2.2, 3/2, 3);
this.chair.xln2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 4, 3/2, 2);
this.chair.yln2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 4, 3/2, 2);
this.chair.xrn2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 2.2, 3/2, 2);
this.chair.yrn2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 2.2, 3/2, 2);
var xa = get1(this.chair.xlf, this.chair.xlf2, 3);
var ya = get1(this.chair.ylf, this.chair.ylf2, 3);
var xb = get1(this.chair.xrf, this.chair.xrf2, 3);
var yb = get1(this.chair.yrf, this.chair.yrf2, 3);
var xc = get1(this.chair.xln, this.chair.xln2, 3);
var yc = get1(this.chair.yln, this.chair.yln2, 3);
var xd = get1(this.chair.xrn, this.chair.xrn2, 3);
var yd = get1(this.chair.yrn, this.chair.yrn2, 3);
var x1 = get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 9/4, 9/4);
var y1 = get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 9/4, 9/4);
var x2 = get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 9/5, 9/4);
var y2 = get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 9/5, 9/4);
var x3 = get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 9/5, 9/5);
var y3 = get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 9/5, 9/5);
var x4 = get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 9/4, 9/5);
var y4 = get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 9/4, 9/5);
var x1a = get2(xa, xb, xc, xd, 9/4, 9/4);
var y1a = get2(ya, yb, yc, yd, 9/4, 9/4);
var x2a = get2(xa, xb, xc, xd, 9/5, 9/4);
var y2a = get2(ya, yb, yc, yd, 9/5, 9/4);
var x3a = get2(xa, xb, xc, xd, 9/5, 9/5);
var y3a = get2(ya, yb, yc, yd, 9/5, 9/5);
var x4a = get2(xa, xb, xc, xd, 9/4, 9/5);
var y4a = get2(ya, yb, yc, yd, 9/4, 9/5);
with (this.chair) {
//投影
clear();
lineStyle(0, lineColor, lineAlpha);
moveTo(get1(this.chair.xlf, this.chair.xrf, 2), get1(this.chair.ylf, this.chair.yrf, 2));
beginFill(shadowColor, shadowAlpha);
curveTo(this.chair.xrf, this.chair.yrf, get1(this.chair.xrf, this.chair.xrn, 2), get1(this.chair.yrf, this.chair.yrn, 2));
curveTo(this.chair.xrn, this.chair.yrn, get1(this.chair.xrn, this.chair.xln, 2), get1(this.chair.yrn, this.chair.yln, 2));
curveTo(this.chair.xln, this.chair.yln, get1(this.chair.xln, this.chair.xlf, 2), get1(this.chair.yln, this.chair.ylf, 2));
curveTo(this.chair.xlf, this.chair.ylf, get1(this.chair.xlf, this.chair.xrf, 2), get1(this.chair.ylf, this.chair.yrf, 2));
endFill();
//底座
moveTo(get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 2, 4), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 2, 4));
beginFill("0x222222", fillAlpha);
curveTo(get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 4/3, 4), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 4/3, 4), get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 4/3, 2), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 4/3, 2));
curveTo(get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 4/3, 4/3), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 4/3, 4/3), get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 2, 4/3), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 2, 4/3));
curveTo(get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 4, 4/3), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 4, 4/3), get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 4, 2), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 4, 2));
curveTo(get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 4, 4), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 4, 4), get2(this.chair.xlf, this.chair.xrf, this.chair.xln, this.chair.xrn, 2, 4), get2(this.chair.ylf, this.chair.yrf, this.chair.yln, this.chair.yrn, 2, 4));
endFill();
//插杆儿
moveTo(x2a, y2a);
beginFill("0x101010", fillAlpha);
lineTo(x3a, y3a);
lineTo(x3, y3);
lineTo(x2, y2);
lineTo(x2a, y2a);
endFill();
moveTo(x1a, y1a);
beginFill("0x101010", fillAlpha);
lineTo(x4a, y4a);
lineTo(x4, y4);
lineTo(x1, y1);
lineTo(x1a, y1a);
endFill();
moveTo(x3a, y3a);
beginFill("0x050505", fillAlpha);
lineTo(x4a, y4a);
lineTo(x4, y4);
lineTo(x3, y3);
lineTo(x3a, y3a);
endFill();
//背杆
moveTo(get2(this.chair.xlf2, this.chair.xrf2, xa, xb, 9/4, 4), get2(this.chair.ylf2, this.chair.yrf2, ya, yb, 9/4, 4));
beginFill("0x101010", fillAlpha);
lineTo(get2(this.chair.xlf2, this.chair.xrf2, xa, xb, 9/5, 4), get2(this.chair.ylf2, this.chair.yrf2, ya, yb, 9/5, 4));
curveTo(get2(xa, xb, xc, xd, 9/5, -4), get2(ya, yb, yc, yd, 9/5, -4), get2(xa, xb, xc, xd, 9/5, 4), get2(ya, yb, yc, yd, 9/5, 4));
lineTo(get2(xa, xb, xc, xd, 9/4, 4), get2(ya, yb, yc, yd, 9/4, 4));
curveTo(get2(xa, xb, xc, xd, 9/4, -4), get2(ya, yb, yc, yd, 9/4, -4), get2(this.chair.xlf2, this.chair.xrf2, xa, xb, 9/4, 4), get2(this.chair.ylf2, this.chair.yrf2, ya, yb, 9/4, 4));
//椅座
moveTo(get1(xa, xb, 2), get1(ya, yb, 2));
beginFill("0x666666", fillAlpha);
curveTo(xb, yb, get1(xb, xd, 2), get1(yb, yd, 2));
curveTo(xd, yd, get1(xd, xc, 2), get1(yd, yc, 2));
curveTo(xc, yc, get1(xc, xa, 2), get1(yc, ya, 2));
curveTo(xa, ya, get1(xa, xb, 2), get1(ya, yb, 2));
endFill();
//椅背
moveTo(get1(this.chair.xlf2, this.chair.xrf2, 2), get1(this.chair.ylf2, this.chair.yrf2, 2));
beginFill("0x444444", fillAlpha);
curveTo(this.chair.xlf2, this.chair.ylf2, get1(this.chair.xlf2, xa, 4), get1(this.chair.ylf2, ya, 4));
curveTo(get1(this.chair.xlf2, xa, 2), get1(this.chair.ylf2, ya, 2), get2(this.chair.xlf2, this.chair.xrf2, xa, xb, 2, 2), get2(this.chair.ylf2, this.chair.yrf2, ya, yb, 2, 2));
curveTo(get1(this.chair.xrf2, xb, 2), get1(this.chair.yrf2, yb, 2), get1(this.chair.xrf2, xb, 4), get1(this.chair.yrf2, yb, 4));
curveTo(this.chair.xrf2, this.chair.yrf2, get1(this.chair.xlf2, this.chair.xrf2, 2), get1(this.chair.ylf2, this.chair.yrf2, 2));
endFill();
}
delete this.chair.xlf;
delete this.chair.ylf;
delete this.chair.xrf;
delete this.chair.yrf;
delete this.chair.xln;
delete this.chair.yln;
delete this.chair.xrn;
delete this.chair.yrn;
delete this.chair.xlf2;
delete this.chair.ylf2;
delete this.chair.xrf2;
delete this.chair.yrf2;
delete this.chair.xln2;
delete this.chair.yln2;
delete this.chair.xrn2;
delete this.chair.yrn2;
delete xa;
delete ya;
delete xb;
delete yb;
delete xc;
delete yc;
delete xd;
delete yd;
delete x1;
delete y1;
delete x2;
delete y2;
delete x3;
delete y3;
delete x4;
delete y4;
delete x1a;
delete y1a;
delete x2a;
delete y2a;
delete x3a;
delete y3a;
delete x4a;
delete y4a;
}
function updateDesk() {
this.desk.xlf = get1(this.wall.xld+this.wall._x, this.eye.xld+this.eye._x, 3);
this.desk.ylf = get1(this.wall.yld+this.wall._y, this.eye.yld+this.eye._y, 3);
this.desk.xln = get1(this.wall.xld+this.wall._x, this.eye.xld+this.eye._x, 3/2);
this.desk.yln = get1(this.wall.yld+this.wall._y, this.eye.yld+this.eye._y, 3/2);
this.desk.xrf = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 5, 3);
this.desk.yrf = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 5, 3);
this.desk.xrn = get2(this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 5, 3/2);
this.desk.yrn = get2(this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 5, 3/2);
this.desk.xlf2 = get2(this.wall.xld+this.wall._x, this.wall.xlu+this.wall._x, this.eye.xld+this.eye._x, this.eye._xlu+this.eye._x, 4, 3);
this.desk.ylf2 = get2(this.wall.yld+this.wall._y, this.wall.ylu+this.wall._y, this.eye.yld+this.eye._y, this.eye._ylu+this.eye._y, 4, 3);
this.desk.xln2 = get2(this.wall.xld+this.wall._x, this.wall.xlu+this.wall._x, this.eye.xld+this.eye._x, this.eye._xlu+this.eye._x, 4, 3/2);
this.desk.yln2 = get2(this.wall.yld+this.wall._y, this.wall.ylu+this.wall._y, this.eye.yld+this.eye._y, this.eye._ylu+this.eye._y, 4, 3/2);
this.desk.xrf2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 5, 4/3, 3);
this.desk.yrf2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 5, 4/3, 3);
this.desk.xrn2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 5, 4/3, 3/2);
this.desk.yrn2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 5, 4/3, 3/2);
var x1 = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 20, 3, -20);
var y1 = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 20, 3, -20);
var x2 = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 1.5, 4, -15);
var y2 = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 1.5, 4, -15);
var x3 = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 1.5, 4/3, -15);
var y3 = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 1.5, 4/3, -15);
var x4 = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 20, 1.5, -20);
var y4 = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 20, 1.5, -20);
var x1a = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 30, 3, -2);
var y1a = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 30, 3, -2);
var x2a = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 1.8, 4, -5/4);
var y2a = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 1.8, 4, -5/4);
var x3a = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 1.8, 4/3, -5/4);
var y3a = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 1.8, 4/3, -5/4);
var x4a = get3(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, this.desk.xlf, this.desk.xrf, this.desk.xln, this.desk.xrn, 30, 1.5, -2);
var y4a = get3(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, this.desk.ylf, this.desk.yrf, this.desk.yln, this.desk.yrn, 30, 1.5, -2);
var xkey1 = get2(this.desk.xrf2, this.desk.xrf, this.desk.xrn2, this.desk.xrn, 4, 20);
var ykey1 = get2(this.desk.yrf2, this.desk.yrf, this.desk.yrn2, this.desk.yrn, 4, 20);
var xkey2 = get2(this.desk.xrf2, this.desk.xrf, this.desk.xrn2, this.desk.xrn, 4, 2);
var ykey2 = get2(this.desk.yrf2, this.desk.yrf, this.desk.yrn2, this.desk.yrn, 4, 2);
var xkey3 = get3(this.desk.xrf2, this.desk.xrf, this.desk.xrn2, this.desk.xrn, this.desk.xlf2, this.desk.xlf, this.desk.xln2, this.desk.xln, 4, 2, 4);
var ykey3 = get3(this.desk.yrf2, this.desk.yrf, this.desk.yrn2, this.desk.yrn, this.desk.ylf2, this.desk.ylf, this.desk.yln2, this.desk.yln, 4, 2, 4);
var xkey4 = get3(this.desk.xrf2, this.desk.xrf, this.desk.xrn2, this.desk.xrn, this.desk.xlf2, this.desk.xlf, this.desk.xln2, this.desk.xln, 4, 20, 4);
var ykey4 = get3(this.desk.yrf2, this.desk.yrf, this.desk.yrn2, this.desk.yrn, this.desk.ylf2, this.desk.ylf, this.desk.yln2, this.desk.yln, 4, 20, 4);
with (this.desk) {
clear();
//投影
lineStyle(0, lineColor, lineAlpha);
moveTo(this.desk.xlf, this.desk.ylf);
beginFill(shadowColor, shadowAlpha);
lineTo(this.desk.xrf, this.desk.yrf);
lineTo(this.desk.xrn, this.desk.yrn);
lineTo(this.desk.xln, this.desk.yln);
lineTo(this.desk.xlf, this.desk.ylf);
endFill();
//桌子
moveTo(this.desk.xlf, this.desk.ylf);
beginFill("0x0F0700", fillAlpha);
lineTo(this.desk.xlf2, this.desk.ylf2);
lineTo(this.desk.xrf2, this.desk.yrf2);
lineTo(this.desk.xrf, this.desk.yrf);
lineTo(this.desk.xlf, this.desk.ylf);
endFill();
moveTo(get1(this.desk.xrf2, this.desk.xrf, 4), get1(this.desk.yrf2, this.desk.yrf, 4));
beginFill("0x150B00", fillAlpha);
lineTo(get1(this.desk.xlf2, this.desk.xlf, 4), get1(this.desk.ylf2, this.desk.ylf, 4));
lineTo(get2(this.desk.xlf2, this.desk.xlf, this.desk.xln2, this.desk.xln, 4, 3/2), get2(this.desk.ylf2, this.desk.ylf, this.desk.yln2, this.desk.yln, 4, 3/2));
lineTo(get2(this.desk.xrf2, this.desk.xrf, this.desk.xrn2, this.desk.xrn, 4, 3/2), get2(this.desk.yrf2, this.desk.yrf, this.desk.yrn2, this.desk.yrn, 4, 3/2));
lineTo(get1(this.desk.xrf2, this.desk.xrf, 4), get1(this.desk.yrf2, this.desk.yrf, 4));
endFill();
//键盘
moveTo(xkey1, ykey1);
beginFill("0x555555", fillAlpha);
lineTo(xkey2, ykey2);
lineTo(xkey3, ykey3);
lineTo(xkey4, ykey4);
lineTo(xkey1, ykey1);
endFill();
moveTo(get1(xkey1, xkey4, 10), get1(ykey1, ykey4, 10));
lineTo(get1(xkey2, xkey3, 10), get1(ykey2, ykey3, 10));
moveTo(get1(xkey4, xkey1, 10), get1(ykey4, ykey1, 10));
lineTo(get1(xkey3, xkey2, 10), get1(ykey3, ykey2, 10));
moveTo(get1(this.desk.xln2, this.desk.xlf2, 3), get1(this.desk.yln2, this.desk.ylf2, 3));
beginFill("0x201000", fillAlpha);
lineTo(get1(this.desk.xrn2, this.desk.xrf2, 3), get1(this.desk.yrn2, this.desk.yrf2, 3));
lineTo(get1(this.desk.xrn, this.desk.xrf, 3), get1(this.desk.yrn, this.desk.yrf, 3));
lineTo(get1(this.desk.xln, this.desk.xlf, 3), get1(this.desk.yln, this.desk.ylf, 3));
lineTo(get1(this.desk.xln2, this.desk.xlf2, 3), get1(this.desk.yln2, this.desk.ylf2, 3));
endFill();
//机箱
moveTo(get1(this.desk.xln, this.desk.xlf, 11), get1(this.desk.yln, this.desk.ylf, 11));
beginFill("0x222222", fillAlpha);
lineTo(get1(this.desk.xrn, this.desk.xrf, 11), get1(this.desk.yrn, this.desk.yrf, 11));
lineTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 4, 11), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 4, 11));
lineTo(get2(this.desk.xln2, this.desk.xln, this.desk.xlf2, this.desk.xlf, 4, 11), get2(this.desk.yln2, this.desk.yln, this.desk.ylf2, this.desk.ylf, 4, 11));
lineTo(get1(this.desk.xln, this.desk.xlf, 11), get1(this.desk.yln, this.desk.ylf, 11));
endFill();
moveTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 4, 11), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 4, 11));
beginFill("0x444444", fillAlpha);
lineTo(get2(this.desk.xln2, this.desk.xln, this.desk.xlf2, this.desk.xlf, 4, 11), get2(this.desk.yln2, this.desk.yln, this.desk.ylf2, this.desk.ylf, 4, 11));
lineTo(get2(this.desk.xln2, this.desk.xln, this.desk.xlf2, this.desk.xlf, 4, 3.5), get2(this.desk.yln2, this.desk.yln, this.desk.ylf2, this.desk.ylf, 4, 3.5));
lineTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 4, 3.5), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 4, 3.5));
lineTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 4, 11), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 4, 11));
endFill();
moveTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 4, 11), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 4, 11));
beginFill("0x666666", fillAlpha);
lineTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 4, 3.5), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 4, 3.5));
lineTo(get1(this.desk.xrn, this.desk.xrf, 3.5), get1(this.desk.yrn, this.desk.yrf, 3.5));
lineTo(get1(this.desk.xrn, this.desk.xrf, 11), get1(this.desk.yrn, this.desk.yrf, 11));
lineTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 4, 11), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 4, 11));
endFill();
moveTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 3, 11), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 3, 11));
lineTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 3, 3.5), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 3, 3.5));
moveTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 2, 11), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 2, 11));
lineTo(get2(this.desk.xrn2, this.desk.xrn, this.desk.xrf2, this.desk.xrf, 2, 3.5), get2(this.desk.yrn2, this.desk.yrn, this.desk.yrf2, this.desk.yrf, 2, 3.5));
moveTo(this.desk.xlf2, this.desk.ylf2);
beginFill("0x663300", fillAlpha);
lineTo(this.desk.xrf2, this.desk.yrf2);
lineTo(this.desk.xrn2, this.desk.yrn2);
lineTo(this.desk.xln2, this.desk.yln2);
lineTo(this.desk.xlf2, this.desk.ylf2);
endFill();
moveTo(this.desk.xln2, this.desk.yln2);
beginFill("0x2B1500", fillAlpha);
lineTo(this.desk.xrn2, this.desk.yrn2);
lineTo(this.desk.xrn, this.desk.yrn);
lineTo(this.desk.xln, this.desk.yln);
lineTo(this.desk.xln2, this.desk.yln2);
endFill();
}
with (this.desk.computer) {
clear();
//显示器
lineStyle(0, lineColor, lineAlpha);
moveTo(get2(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, 20, 3), get2(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, 20, 3));
beginFill(shadowColor, shadowAlpha);
lineTo(get2(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, 1.5, 4), get2(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, 1.5, 4));
lineTo(get2(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, 1.5, 4/3), get2(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, 1.5, 4/3));
lineTo(get2(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, 20, 1.5), get2(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, 20, 1.5));
lineTo(get2(this.desk.xlf2, this.desk.xrf2, this.desk.xln2, this.desk.xrn2, 20, 3), get2(this.desk.ylf2, this.desk.yrf2, this.desk.yln2, this.desk.yrn2, 20, 3));
endFill();
moveTo(x1, y1);
beginFill("0x101010", fillAlpha);
curveTo(get1(x1, x2a, 4), get1(y1, y2a, 4), x2, y2);
lineTo(x3, y3);
curveTo(get1(x3, x4a, 4), get1(y3, y4a, 4), x4, y4);
lineTo(x1, y1);
endFill();
moveTo(x1a, y1a);
beginFill("0x101010", fillAlpha);
curveTo(get1(x1a, x2, 4), get1(y1a, y2, 4), x2a, y2a);
lineTo(x2, y2);
curveTo(get1(x1, x2a, 4), get1(y1, y2a, 4), x1, y1);
lineTo(x1a, y1a);
endFill();
moveTo(x1a, y1a);
beginFill("0x999999", fillAlpha);
curveTo(get1(x1a, x2, 4), get1(y1a, y2, 4), x2a, y2a);
lineTo(x3a, y3a);
curveTo(get1(x3a, x4, 4), get1(y3a, y4, 4), x4a, y4a);
lineTo(x1a, y1a);
endFill();
moveTo(x4a, y4a);
beginFill("0x777777", fillAlpha);
curveTo(get1(x3a, x4, 4), get1(y3a, y4, 4), x3a, y3a);
lineTo(x3, y3);
curveTo(get1(x3, x4a, 4), get1(y3, y4a, 4), x4, y4);
lineTo(x4a, y4a);
endFill();
moveTo(x2a, y2a);
beginFill("0x888888", fillAlpha);
lineTo(x2, y2);
lineTo(x3, y3);
lineTo(x3a, y3a);
endFill();
moveTo(get2(x2a, x2, x3a, x3, 10, 10), get2(y2a, y2, y3a, y3, 10, 10));
beginFill("0x101010", fillAlpha);
lineTo(get2(x2, x2a, x3, x3a, 10, 10), get2(y2, y2a, y3, y3a, 10, 10));
lineTo(get2(x3, x3a, x2, x2a, 10, 10), get2(y3, y3a, y2, y2a, 10, 10));
lineTo(get2(x3a, x3, x2a, x2, 10, 10), get2(y3a, y3, y2a, y2, 10, 10));
lineTo(get2(x2a, x2, x3a, x3, 10, 10), get2(y2a, y2, y3a, y3, 10, 10));
endFill();
}
delete this.desk.xlf;
delete this.desk.ylf;
delete this.desk.xln;
delete this.desk.yln;
delete this.desk.xrf;
delete this.desk.yrf;
delete this.desk.xrn;
delete this.desk.yrn;
delete this.desk.xlf2;
delete this.desk.ylf2;
delete this.desk.xln2;
delete this.desk.yln2;
delete this.desk.xrf2;
delete this.desk.yrf2;
delete this.desk.xrn2;
delete this.desk.yrn2;
delete x1;
delete y1;
delete x2;
delete y2;
delete x3;
delete y3;
delete x4;
delete y4;
delete x1a;
delete y1a;
delete x2a;
delete y2a;
delete x3a;
delete y3a;
delete x4a;
delete y4a;
delete xkey1;
delete ykey1;
delete xkey2;
delete ykey2;
delete xkey3;
delete ykey3;
delete xkey4;
delete ykey4;
}
function updateBed() {
this.bed.xlf = get1(this.wall.xld+this.wall._x, this.eye.xld+this.eye._x, 20);
this.bed.ylf = get1(this.wall.yld+this.wall._y, this.eye.yld+this.eye._y, 20);
this.bed.xrf = get2(this.wall.xrd+this.wall._x, this.wall.xld+this.wall._x, this.eye.xrd+this.eye._x, this.eye.xld+this.eye._x, 4, 20);
this.bed.yrf = get2(this.wall.yrd+this.wall._y, this.wall.yld+this.wall._y, this.eye.yrd+this.eye._y, this.eye.yld+this.eye._y, 4, 20);
this.bed.xln = get1(this.wall.xld+this.wall._x, this.eye.xld+this.eye._x, 4);
this.bed.yln = get1(this.wall.yld+this.wall._y, this.eye.yld+this.eye._y, 4);
this.bed.xrn = get2(this.bed.xlf, this.wall.xrd+this.wall._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 4/3, 4);
this.bed.yrn = get2(this.bed.ylf, this.wall.yrd+this.wall._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 4/3, 4);
this.bed.xlf2 = get2(this.wall.xld+this.wall._x, this.wall.xlu+this.wall._x, this.eye.xld+this.eye._x, this.eye.xlu+this.eye._x, 3, 20);
this.bed.ylf2 = get2(this.wall.yld+this.wall._y, this.wall.ylu+this.wall._y, this.eye.yld+this.eye._y, this.eye.ylu+this.eye._y, 3, 20);
this.bed.xrf2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 4/3, 3/2, 20);
this.bed.yrf2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 4/3, 3/2, 20);
this.bed.xln2 = get2(this.wall.xld+this.wall._x, this.wall.xlu+this.wall._x, this.eye.xld+this.eye._x, this.eye.xlu+this.eye._x, 3, 4);
this.bed.yln2 = get2(this.wall.yld+this.wall._y, this.wall.ylu+this.wall._y, this.eye.yld+this.eye._y, this.eye.ylu+this.eye._y, 3, 4);
this.bed.xrn2 = get3(this.wall.xlu+this.wall._x, this.wall.xru+this.wall._x, this.wall.xld+this.wall._x, this.wall.xrd+this.wall._x, this.eye.xlu+this.eye._x, this.eye.xru+this.eye._x, this.eye.xld+this.eye._x, this.eye.xrd+this.eye._x, 4/3, 3/2, 4);
this.bed.yrn2 = get3(this.wall.ylu+this.wall._y, this.wall.yru+this.wall._y, this.wall.yld+this.wall._y, this.wall.yrd+this.wall._y, this.eye.ylu+this.eye._y, this.eye.yru+this.eye._y, this.eye.yld+this.eye._y, this.eye.yrd+this.eye._y, 4/3, 3/2, 4);
var x1 = get1(this.bed.xlf2, this.bed.xrf2, 10);
var y1 = get1(this.bed.ylf2, this.bed.yrf2, 10);
var x2 = get2(this.bed.xlf2, this.bed.xrf2, this.bed.xlf, this.bed.xrf, 10, 2);
var y2 = get2(this.bed.ylf2, this.bed.yrf2, this.bed.ylf, this.bed.yrf, 10, 2);
var x3 = get1(this.bed.xrf2, this.bed.xrf, 2);
var y3 = get1(this.bed.yrf2, this.bed.yrf, 2);
var x1a = get1(this.bed.xln2, this.bed.xrn2, 10);
var y1a = get1(this.bed.yln2, this.bed.yrn2, 10);
var x2a = get2(this.bed.xln2, this.bed.xrn2, this.bed.xln, this.bed.xrn, 10, 2);
var y2a = get2(this.bed.yln2, this.bed.yrn2, this.bed.yln, this.bed.yrn, 10, 2);
var x3a = get1(this.bed.xrn2, this.bed.xrn, 2);
var y3a = get1(this.bed.yrn2, this.bed.yrn, 2);
with (this.bed) {
clear();
//床体
lineStyle(0, lineColor, lineAlpha);
moveTo(this.bed.xlf, this.bed.ylf);
//beginFill(shadowColor, shadowAlpha);
lineTo(this.bed.xrf, this.bed.yrf);
lineTo(this.bed.xrn, this.bed.yrn);
lineTo(this.bed.xln, this.bed.yln);
lineTo(this.bed.xlf, this.bed.ylf);
//endFill();
moveTo(this.bed.xlf2, this.bed.ylf2);
lineTo(x1, y1);
lineTo(x2, y2);
lineTo(x3, y3);
lineTo(this.bed.xrf, this.bed.yrf);
lineTo(this.bed.xlf, this.bed.ylf);
lineTo(this.bed.xlf2, this.bed.ylf2);
moveTo(this.bed.xlf2, this.bed.ylf2);
beginFill("0x663300", fillAlpha);
lineTo(x1, y1);
lineTo(x1a, y1a);
lineTo(this.bed.xln2, this.bed.yln2);
lineTo(this.bed.xlf2, this.bed.ylf2);
endFill();
moveTo(x1, y1);
beginFill("0x442200", fillAlpha);
lineTo(x1a, y1a);
lineTo(x2a, y2a);
lineTo(x2, y2);
lineTo(x1, y1);
endFill();
moveTo(x3, y3);
beginFill("0x442200", fillAlpha);
lineTo(x3a, y3a);
lineTo(this.bed.xrn, this.bed.yrn);
lineTo(this.bed.xrf, this.bed.yrf);
lineTo(x3, y3);
endFill();
moveTo(x2, y2);
//beginFill("0x663300", fillAlpha);
lineTo(x2a, y2a);
lineTo(x3a, y3a);
lineTo(x3, y3);
lineTo(x2, y2);
//endFill();
moveTo(this.bed.xln2, this.bed.yln2);
beginFill("0x2B1500", fillAlpha);
lineTo(x1a, y1a);
lineTo(x2a, y2a);
lineTo(x3a, y3a);
lineTo(this.bed.xrn, this.bed.yrn);
lineTo(this.bed.xln, this.bed.yln);
lineTo(this.bed.xln2, this.bed.yln2);
endFill();
//床单
var num = 4;
for (var i = 0; i<num; i++) {
if (i%2 == 0) {
beginFill("0x003366", fillAlpha);
} else {
beginFill("0x999900", fillAlpha);
}
moveTo(get1(x2, x3, num/i), get1(y2, y3, num/i));
lineTo(get1(x2a, x3a, num/i), get1(y2a, y3a, num/i));
lineTo(get1(x2a, x3a, num/(i+1)), get1(y2a, y3a, num/(i+1)));
lineTo(get1(x2, x3, num/(i+1)), get1(y2, y3, num/(i+1)));
lineTo(get1(x2, x3, num/i), get1(y2, y3, num/i));
endFill();
}
for (var i = 0; i<num; i++) {
if (i%2 == 0) {
beginFill("0x002B55", fillAlpha);
} else {
beginFill("0x787801", fillAlpha);
}
moveTo(get1(x2a, x3a, num/i), get1(y2a, y3a, num/i));
lineTo(get2(x2a, x3a, x1a, this.bed.xrn2, num/i, -3), get2(y2a, y3a, y1a, this.bed.yrn2, num/i, -3));
lineTo(get2(x2a, x3a, x1a, this.bed.xrn2, num/(i+1), -3), get2(y2a, y3a, y1a, this.bed.yrn2, num/(i+1), -3));
lineTo(get1(x2a, x3a, num/(i+1)), get1(y2a, y3a, num/(i+1)));
lineTo(get1(x2a, x3a, num/i), get1(y2a, y3a, num/i));
endFill();
}
//花纹
var num = 5;
for (var i = 1; i<num; i++) {
moveTo(get2(x1, x2, x1a, x2a, 5, num/i), get2(y1, y2, y1a, y2a, 5, num/i));
lineStyle(0, lineColor, lineAlpha);
lineTo(get1(x2, x2a, num/i), get1(y2, y2a, num/i));
}
moveTo(get2(x1, x2, x1a, x2a, 5, num), get2(y1, y2, y1a, y2a, 5, num));
lineTo(get2(x1, x2, x1a, x2a, 5, num/(num-1)), get2(y1, y2, y1a, y2a, 5, num/(num-1)));
moveTo(get1(this.bed.xln2, this.bed.xln, 3/2), get1(this.bed.yln2, this.bed.yln, 3/2));
lineTo(get1(this.bed.xrn2, this.bed.xrn, 3/2), get1(this.bed.yrn2, this.bed.yrn, 3/2));
//枕头
}
delete this.bed.xlf;
delete this.bed.ylf;
delete this.bed.xrf;
delete this.bed.yrf;
delete this.bed.xln;
delete this.bed.yln;
delete this.bed.xrn;
delete this.bed.yrn;
delete this.bed.xlf2;
delete this.bed.ylf2;
delete this.bed.xrf2;
delete this.bed.yrf2;
delete this.bed.xln2;
delete this.bed.yln2;
delete this.bed.xrn2;
delete this.bed.yrn2;
delete x1;
delete y1;
delete x2;
delete y2;
delete x3;
delete y3;
delete x1a;
delete y1a;
delete x2a;
delete y2a;
delete x3a;
delete y3a;
delete num;
}
function updateEye() {
var big = 1;
this.eye.xlu = 3*Math.pow(this.wall.xlu, big);
this.eye.ylu = 3*Math.pow(this.wall.ylu, big);
this.eye.xru = 3*Math.pow(this.wall.xru, big);
this.eye.yru = 3*Math.pow(this.wall.yru, big);
this.eye.xrd = 3*Math.pow(this.wall.xrd, big);
this.eye.yrd = 3*Math.pow(this.wall.yrd, big);
this.eye.xld = 3*Math.pow(this.wall.xld, big);
this.eye.yld = 3*Math.pow(this.wall.yld, big);
this.eye.clear();
this.eye.moveTo(this.eye.xlu, this.eye.ylu);
this.eye.lineStyle(0, menuColor, lineAlpha);
this.eye.lineTo(this.eye.xru, this.eye.yru);
this.eye.lineTo(this.eye.xrd, this.eye.yrd);
this.eye.lineTo(this.eye.xld, this.eye.yld);
this.eye.lineTo(this.eye.xlu, this.eye.ylu);
this.eye._x = -137.5;
this.eye._y = -100;
}
function updateWall() {
this.wall._x = Math.min(275, Math.max(137.5-(_xmouse-275), 0));
this.wall._y = Math.min(200, Math.max(100-(_ymouse-200), 0));
this.wall.xlu = (this.wall._y-100)/small;
this.wall.ylu = (this.wall._x-137.5)/small;
this.wall.xru = 275-(this.wall._y-100)/small;
this.wall.yru = -(this.wall._x-137.5)/small;
this.wall.xrd = +275+(this.wall._y-100)/small;
this.wall.yrd = +200+(this.wall._x-137.5)/small;
this.wall.xld = -(this.wall._y-100)/small;
this.wall.yld = +200-(this.wall._x-137.5)/small;
var x01 = get2(this.wall.xlu, this.wall.xld, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, 3/2, -10);
var y01 = get2(this.wall.ylu, this.wall.yld, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, 3/2, -10);
var x02 = get2(this.wall.xru, this.wall.xrd, this.eye.xru+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 3/2, -10);
var y02 = get2(this.wall.yru, this.wall.yrd, this.eye.yru+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 3/2, -10);
var x03 = get1(this.wall.xld, this.eye.xld+this.eye._x-this.wall._x, -10);
var y03 = get1(this.wall.yld, this.eye.yld+this.eye._y-this.wall._y, -10);
var x04 = get1(this.wall.xrd, this.eye.xrd+this.eye._x-this.wall._x, -10);
var y04 = get1(this.wall.yrd, this.eye.yrd+this.eye._y-this.wall._y, -10);
var x1 = get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, 5, 10);
var y1 = get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, 5, 10);
var x2 = get2(this.wall.xru, this.wall.xlu, this.wall.xrd, this.wall.xld, 20, 10);
var y2 = get2(this.wall.yru, this.wall.ylu, this.wall.yrd, this.wall.yld, 20, 10);
var x3 = get1(this.wall.xrd, this.wall.xld, 20);
var y3 = get1(this.wall.yrd, this.wall.yld, 20);
var x4 = get1(this.wall.xrd, this.wall.xld, 20/7);
var y4 = get1(this.wall.yrd, this.wall.yld, 20/7);
var x5 = get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, 20/13, 1.5);
var y5 = get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, 20/13, 1.5);
var x6 = get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, 5, 1.5);
var y6 = get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, 5, 1.5);
var x7 = get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, 20/13, 10);
var y7 = get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, 20/13, 10);
var x8 = get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, 20/13, 60/43);
var y8 = get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, 20/13, 60/43);
var x9 = get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, 5, 60/43);
var y9 = get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, 5, 60/43);
var x6a = get3(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xru+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 5, 1.5, 20);
var y6a = get3(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yru+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 5, 1.5, 20);
var x5a = get3(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xru+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 20/13, 1.5, 20);
var y5a = get3(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yru+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 20/13, 1.5, 20);
var x8a = get3(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xru+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 20/13, 60/43, 20);
var y8a = get3(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yru+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 20/13, 60/43, 20);
var x9a = get3(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xru+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 5, 60/43, 20);
var y9a = get3(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yru+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 5, 60/43, 20);
var x1b = this.wall.xlu;
var y1b = this.wall.ylu;
var x2b = this.wall.xru;
var y2b = this.wall.yru;
var x3b = get1(this.wall.xru, this.wall.xrd, 10);
var y3b = get1(this.wall.yru, this.wall.yrd, 10);
var x4b = get1(this.wall.xlu, this.wall.xld, 10);
var y4b = get1(this.wall.ylu, this.wall.yld, 10);
var x1ba = get1(this.wall.xlu, this.eye.xlu+this.eye._x-this.wall._x, 30);
var y1ba = get1(this.wall.ylu, this.eye.ylu+this.eye._y-this.wall._y, 30);
var x2ba = get1(this.wall.xru, this.eye.xru+this.eye._x-this.wall._x, 30);
var y2ba = get1(this.wall.yru, this.eye.yru+this.eye._y-this.wall._y, 30);
var x3ba = get2(this.wall.xru, this.wall.xrd, this.eye.xru+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 10, 30);
var y3ba = get2(this.wall.yru, this.wall.yrd, this.eye.yru+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 10, 30);
var x4ba = get2(this.wall.xlu, this.wall.xld, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, 10, 30);
var y4ba = get2(this.wall.ylu, this.wall.yld, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, 10, 30);
with (this.wall) {
clear();
//阳台
lineStyle(0, lineColor, lineAlpha);
moveTo(x01, y01);
beginFill("0x333333", fillAlpha);
lineTo(x02, y02);
lineTo(x04, y04);
lineTo(x03, y03);
lineTo(x01, y01);
endFill();
moveTo(x01, y01);
beginFill("0x555555", fillAlpha);
lineTo(get1(this.wall.xlu, this.wall.xld, 3/2), get1(this.wall.ylu, this.wall.yld, 3/2));
lineTo(this.wall.xld, this.wall.yld);
lineTo(x03, y03);
lineTo(x01, y01);
endFill();
moveTo(x02, y02);
beginFill("0x555555", fillAlpha);
lineTo(get1(this.wall.xru, this.wall.xrd, 3/2), get1(this.wall.yru, this.wall.yrd, 3/2));
lineTo(this.wall.xrd, this.wall.yrd);
lineTo(x04, y04);
lineTo(x02, y02);
endFill();
moveTo(x03, y03);
beginFill("0x777777", fillAlpha);
lineTo(x04, y04);
lineTo(this.wall.xrd, this.wall.yrd);
lineTo(this.wall.xld, this.wall.yld);
lineTo(x03, y03);
endFill();
//墙体
moveTo(this.wall.xlu, this.wall.ylu);
beginFill(screenColor, fillAlpha);
lineTo(x1, y1);
lineTo(x2, y2);
lineTo(this.wall.xru, this.wall.yru);
lineTo(this.wall.xlu, this.wall.ylu);
endFill();
moveTo(this.wall.xru, this.wall.yru);
beginFill(screenColor, fillAlpha);
lineTo(x2, y2);
lineTo(x3, y3);
lineTo(this.wall.xrd, this.wall.yrd);
lineTo(this.wall.xru, this.wall.yru);
endFill();
moveTo(this.wall.xlu, this.wall.ylu);
beginFill(screenColor, fillAlpha);
lineTo(x1, y1);
lineTo(x6, y6);
lineTo(this.wall.xld, this.wall.yld);
lineTo(this.wall.xlu, this.wall.ylu);
endFill();
moveTo(this.wall.xld, this.wall.yld);
beginFill(screenColor, fillAlpha);
lineTo(x6, y6);
lineTo(x5, y5);
lineTo(x4, y4);
lineTo(this.wall.xld, this.wall.yld);
endFill();
//窗体
moveTo(x1, y1);
beginFill(glassColor, glassAlpha);
lineTo(x2, y2);
lineTo(x3, y3);
lineTo(x4, y4);
lineTo(x5, y5);
lineTo(x6, y6);
lineTo(x1, y1);
endFill();
moveTo(x1, y1);
beginFill(widowColor, fillAlpha);
lineTo(x7, y7);
lineTo(get1(x7, x5, 30), get1(y7, y5, 30));
lineTo(get1(x1, x6, 30), get1(y1, y6, 30));
lineTo(x1, x1);
endFill();
moveTo(x1, y1);
beginFill(widowColor, fillAlpha);
lineTo(x6, y6);
lineTo(get1(x6, x5, 30), get1(y6, y5, 30));
lineTo(get1(x1, x7, 30), get1(y1, y7, 30));
lineTo(x1, y1);
endFill();
moveTo(x7, y7);
beginFill(widowColor, fillAlpha);
lineTo(x5, y5);
lineTo(get1(x5, x6, 30), get1(y5, y5, 30));
lineTo(get1(x7, x1, 30), get1(y7, y1, 30));
lineTo(x7, y7);
endFill();
moveTo(x6, y6);
beginFill(widowColor, fillAlpha);
lineTo(x5, y5);
lineTo(get1(x5, x7, 30), get1(y5, y7, 30));
lineTo(get1(x6, x1, 30), get1(y6, y1, 30));
lineTo(x6, y6);
endFill();
moveTo(get1(x1, x7, 3), get1(y1, y7, 3));
beginFill(widowColor, fillAlpha);
lineTo(get1(x1, x7, 30/11), get1(y1, y7, 30/11));
lineTo(get1(x6, x5, 30/11), get1(y6, y5, 30/11));
lineTo(get1(x6, x5, 3), get1(y6, y5, 3));
lineTo(get1(x1, x7, 3), get1(y1, y7, 3));
endFill();
//门
moveTo(x7, y7);
beginFill(widowColor, fillAlpha);
lineTo(x2, y2);
lineTo(get1(x2, x3, 40), get1(y2, y3, 40));
lineTo(get1(x7, x4, 40), get1(y7, y4, 40));
lineTo(x7, y7);
endFill();
moveTo(x2, y2);
beginFill(widowColor, fillAlpha);
lineTo(x3, y3);
lineTo(get1(x3, x4, 15), get1(y3, y4, 15));
lineTo(get1(x2, x7, 15), get1(y2, y7, 15));
lineTo(x2, y2);
endFill();
moveTo(x3, y3);
beginFill(widowColor, fillAlpha);
lineTo(x4, y4);
lineTo(get1(x4, x7, 40), get1(y4, y7, 40));
lineTo(get1(x3, x2, 40), get1(y3, y2, 40));
lineTo(x3, y3);
endFill();
moveTo(x4, y4);
beginFill(widowColor, fillAlpha);
lineTo(x7, y7);
lineTo(get1(x7, x2, 15), get1(y7, y2, 15));
lineTo(get1(x4, x3, 15), get1(y4, y3, 15));
lineTo(x4, y4);
endFill();
moveTo(x5, y5);
lineStyle(0, lineColor, lineAlpha);
lineTo(x6, y6);
lineTo(x1, y1);
lineTo(x7, y7);
lineTo(x4, y4);
lineTo(x3, y3);
lineTo(x2, y2);
lineTo(x7, y7);
//窗台
moveTo(x8, y8);
beginFill(shadowColor, shadowAlpha);
lineTo(x8a, y8a);
lineTo(x9a, y9a);
lineTo(x9, y9);
lineTo(x8, y8);
endFill();
moveTo(x9, y9);
beginFill("0x333333", fillAlpha);
lineTo(x9a, y9a);
lineTo(x6a, y6a);
lineTo(x6, y6);
lineTo(x9, y9);
endFill();
moveTo(x8, y8);
beginFill("0x333333", fillAlpha);
lineTo(x8a, y8a);
lineTo(x5a, y5a);
lineTo(x5, y5);
lineTo(x8, y8);
endFill();
moveTo(x6, y6);
beginFill("0x666666", fillAlpha);
lineTo(x6a, y6a);
lineTo(x5a, y5a);
lineTo(x5, y5);
lineTo(x6, y6);
endFill();
moveTo(x5a, y5a);
beginFill("0x333333", fillAlpha);
lineTo(x8a, y8a);
lineTo(x9a, y9a);
lineTo(x6a, y6a);
lineTo(x5a, y5a);
endFill();
//窗帘
moveTo(x1b, y1b);
beginFill(shadowColor, shadowAlpha);
lineTo(x2b, y2b);
lineTo(x3b, y3b);
lineTo(x4b, y4b);
lineTo(x1b, y1b);
endFill();
moveTo(x1b, y1b);
beginFill("0x2B1500", fillAlpha);
lineTo(x4b, y4b);
lineTo(x4ba, y4ba);
lineTo(x1ba, y1ba);
lineTo(x1b, y1b);
endFill();
moveTo(x2b, y2b);
beginFill("0x2B1500", fillAlpha);
lineTo(x3b, y3b);
lineTo(x3ba, y3ba);
lineTo(x2ba, y2ba);
lineTo(x2b, y2b);
endFill();
//窗帘
var num = 30;
for (var i = 0; i<10; i++) {
moveTo(get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, num/i, 20), get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, num/i, 20));
if (i%2 == 0) {
lineStyle(0, lineColor, 0);
beginFill("0x290201", curtainAlpha);
} else {
beginFill("0x340301", curtainAlpha);
}
lineTo(get1(this.wall.xld, this.wall.xrd, num/i), get1(this.wall.yld, this.wall.yrd, num/i));
lineTo(get1(this.wall.xld, this.wall.xrd, num/(i+1)), get1(this.wall.yld, this.wall.yrd, num/(i+1)));
lineTo(get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, num/(i+1), 20), get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, num/(i+1), 20));
lineTo(get2(this.wall.xlu, this.wall.xru, this.wall.xld, this.wall.xrd, num/i, 20), get2(this.wall.ylu, this.wall.yru, this.wall.yld, this.wall.yrd, num/i, 20));
endFill();
}
//窗帘盒盖
lineStyle(0, lineColor, lineAlpha);
moveTo(x1ba, y1ba);
beginFill("0x442200", fillAlpha);
lineTo(x2ba, y2ba);
lineTo(x3ba, y3ba);
lineTo(x4ba, y4ba);
lineTo(x1ba, y1ba);
endFill();
//墙盒
moveTo(get1(x1ba, x2ba, 20), get1(y1ba, y2ba, 20));
beginFill("0x402000", fillAlpha);
lineTo(get1(x4ba, x3ba, 20), get1(y4ba, y3ba, 20));
lineTo(get2(this.eye.xlu+this.eye._x-this.wall._x, this.eye.xru+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 20, 10), get2(this.eye.ylu+this.eye._y-this.wall._y, this.eye.yru+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 20, 10));
lineTo(get1(this.eye.xlu+this.eye._x-this.wall._x, this.eye.xru+this.eye._x-this.wall._x, 20), get1(this.eye.ylu+this.eye._y-this.wall._y, this.eye.yru+this.eye._y-this.wall._y, 20));
lineTo(get1(x1ba, x2ba, 20), get1(y1ba, y2ba, 20));
endFill();
moveTo(get1(x2ba, x1ba, 20), get1(y2ba, y1ba, 20));
beginFill("0x402000", fillAlpha);
lineTo(get1(x3ba, x4ba, 20), get1(y3ba, y4ba, 20));
lineTo(get2(this.eye.xru+this.eye._x-this.wall._x, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, 20, 10), get2(this.eye.yru+this.eye._y-this.wall._y, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, 20, 10));
lineTo(get1(this.eye.xru+this.eye._x-this.wall._x, this.eye.xlu+this.eye._x-this.wall._x, 20), get1(this.eye.yru+this.eye._y-this.wall._y, this.eye.ylu+this.eye._y-this.wall._y, 20));
lineTo(get1(x2ba, x1ba, 20), get1(y2ba, y1ba, 20));
endFill();
moveTo(x4ba, y4ba);
beginFill("0x150B00", fillAlpha);
lineTo(get1(x4ba, x3ba, 20), get1(y4ba, y3ba, 20));
lineTo(get2(this.eye.xlu+this.eye._x-this.wall._x, this.eye.xru+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 20, 10), get2(this.eye.ylu+this.eye._y-this.wall._y, this.eye.yru+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 20, 10));
lineTo(get1(this.eye.xlu+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, 10), get1(this.eye.ylu+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, 10));
lineTo(x4ba, y4ba);
endFill();
moveTo(x3ba, y3ba);
beginFill("0x150B00", fillAlpha);
lineTo(get1(x3ba, x4ba, 20), get1(y3ba, y4ba, 20));
lineTo(get2(this.eye.xru+this.eye._x-this.wall._x, this.eye.xlu+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, this.eye.xld+this.eye._x-this.wall._x, 20, 10), get2(this.eye.yru+this.eye._y-this.wall._y, this.eye.ylu+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, this.eye.yld+this.eye._y-this.wall._y, 20, 10));
lineTo(get1(this.eye.xru+this.eye._x-this.wall._x, this.eye.xrd+this.eye._x-this.wall._x, 10), get1(this.eye.yru+this.eye._y-this.wall._y, this.eye.yrd+this.eye._y-this.wall._y, 10));
lineTo(x3ba, y3ba);
endFill();
}
delete x01;
delete y01;
delete x02;
delete y02;
delete x03;
delete y03;
delete x04;
delete y04;
delete x1;
delete y1;
delete x2;
delete y2;
delete x3;
delete y3;
delete x4;
delete y4;
delete x5;
delete y5;
delete x6;
delete y6;
delete x7;
delete y7;
delete x8;
delete y8;
delete x9;
delete y9;
delete x6a;
delete y6a;
delete x7a;
delete y7a;
delete x8a;
delete y8a;
delete x9a;
delete y9a;
delete x1b;
delete y1b;
delete x2b;
delete y2b;
delete x3b;
delete y3b;
delete x4b;
delete y4b;
delete x1ba;
delete y1ba;
delete x2ba;
delete y2ba;
delete x3ba;
delete y3ba;
delete x4ba;
delete y4ba;
delete num;
}
function updateLines() {
with (this.line) {
clear();
lineStyle(0, lineColor, lineAlpha);
beginFill("0x390000", fillAlpha);
moveTo(this.eye.xlu+this.eye._x, this.eye.ylu+this.eye._y);
lineTo(this.wall.xlu+this.wall._x, this.wall.ylu+this.wall._y);
lineTo(this.wall.xld+this.wall._x, this.wall.yld+this.wall._y);
lineTo(this.eye.xld+this.eye._x, this.eye.yld+this.eye._y);
lineTo(this.eye.xlu+this.eye._x, this.eye.ylu+this.eye._y);
endFill();
beginFill("0x2b1500", fillAlpha);
moveTo(this.eye.xlu+this.eye._x, this.eye.ylu+this.eye._y);
lineTo(this.eye.xru+this.eye._x, this.eye.yru+this.eye._y);
lineTo(this.wall.xru+this.wall._x, this.wall.yru+this.wall._y);
lineTo(this.wall.xlu+this.wall._x, this.wall.ylu+this.wall._y);
lineTo(this.eye.xlu+this.eye._x, this.eye.ylu+this.eye._y);
endFill();
beginFill("0x390000", fillAlpha);
moveTo(this.eye.xru+this.eye._x, this.eye.yru+this.eye._y);
lineTo(this.wall.xru+this.wall._x, this.wall.yru+this.wall._y);
lineTo(this.wall.xrd+this.wall._x, this.wall.yrd+this.wall._y);
lineTo(this.eye.xrd+this.eye._x, this.eye.yrd+this.eye._y);
lineTo(this.eye.xru+this.eye._x, this.eye.yru+this.eye._y);
endFill();
beginFill("0x001000", fillAlpha);
moveTo(this.eye.xld+this.eye._x, this.eye.yld+this.eye._y);
lineTo(this.wall.xld+this.wall._x, this.wall.yld+this.wall._y);
lineTo(this.wall.xrd+this.wall._x, this.wall.yrd+this.wall._y);
lineTo(this.eye.xrd+this.eye._x, this.eye.yrd+this.eye._y);
lineTo(this.eye.xld+this.eye._x, this.eye.yld+this.eye._y);
endFill();
}
}
function get1(x1, x2, rate) {
return x1+(x2-x1)/rate;
}
function get2(xlu, xru, xld, xrd, rate1, rate2) {
return get1(get1(xlu, xru, rate1), get1(xld, xrd, rate1), rate2);
}
function get3(xlu, xru, xld, xrd, xlun, xrun, xldn, xrdn, rate1, rate2, rate3) {
return get1(get2(xlu, xru, xld, xrd, rate1, rate2), get2(xlun, xrun, xldn, xrdn, rate1, rate2), rate3);
}