Frame 1
function Vector2(x, y) {
this.x = x;
this.y = y;
}
Vector2.prototype.ToString = function () {
return(((("(" + this.x) + ",") + this.y) + ")");
};
Vector2.prototype.clone = function () {
var v = new Vector2(this.x, this.y);
return(v);
};
Vector2.prototype.plus = function (v2) {
var v = new Vector2(this.x + v2.x, this.y + v2.y);
return(v);
};
Vector2.prototype.minus = function (v2) {
var v = new Vector2(this.x - v2.x, this.y - v2.y);
return(v);
};
Vector2.prototype.normR = function () {
var v = new Vector2(this.y * -1, this.x);
return(v);
};
Vector2.prototype.dir = function () {
var v = this.clone();
v.normalize();
return(v);
};
Vector2.prototype.proj = function (v2) {
var den = v2.dot(v2);
if (den == 0) {
trace("WARNING! Vector2.proj() was given a zero-length projection vector!");
var v = this.clone();
} else {
var v = v2.clone();
v.mult(this.dot(v2) / den);
}
return(v);
};
Vector2.prototype.projLen = function (v2) {
var den = v2.dot(v2);
if (den == 0) {
trace("WARNING! Vector2.projLen() was given a zero-length projection vector!");
return(0);
}
return(Math.abs(this.dot(v2) / den));
};
Vector2.prototype.dot = function (v2) {
return((this.x * v2.x) + (this.y * v2.y));
};
Vector2.prototype.cross = function (v2) {
return((this.x * v2.y) - (this.y * v2.x));
};
Vector2.prototype.len = function () {
return(Math.sqrt((this.x * this.x) + (this.y * this.y)));
};
Vector2.prototype.copy = function (v2) {
this.x = v2.x;
this.y = v2.y;
};
Vector2.prototype.mult = function (s) {
this.x = this.x * s;
this.y = this.y * s;
};
Vector2.prototype.normalize = function () {
var L = this.len();
if (L != 0) {
this.x = this.x / L;
this.y = this.y / L;
} else {
trace("WARNING! Vector2.normalize() was called on a zero-length vector!");
}
};
Vector2.prototype.pluseq = function (v2) {
this.x = this.x + v2.x;
this.y = this.y + v2.y;
};
Vector2.prototype.minuseq = function (v2) {
this.x = this.x - v2.x;
this.y = this.y - v2.y;
};
function InputManager() {
this.vrend = new VectorRenderer();
this.mPos = new Vector2(this.vrend.buffer._xmouse, this.vrend.buffer._ymouse);
this.mOldpos = new Vector2(this.vrend.buffer._xmouse, this.vrend.buffer._ymouse);
this.mDelta = new Vector2(0, 0);
this.mDownPos = new Vector2(0, 0);
this.mUpPos = new Vector2(0, 0);
this.onMouseDown = this.CaptureMouseDown;
this.onMouseUp = this.CaptureMouseUp;
Mouse.addListener(this);
this.mState = false;
this.mOldState = false;
this.mPressed = false;
this.mReleased = false;
this.kCode = new Array();
this.kState = new Array();
this.kOldState = new Array();
this.tKey = new Array();
this.tState = new Array();
}
InputManager.prototype.RegisterKey = function (knum) {
var n = this.kCode.length;
this.kCode.push(knum);
this.kState[n] = false;
this.kOldState[n] = false;
return(n);
};
InputManager.prototype.RegisterToggle = function (knum) {
var n = this.tKey.length;
this.tKey.push(this.RegisterKey(knum));
this.tState[n] = false;
return(n);
};
InputManager.prototype.Update = function () {
this.mOldpos.copy(this.mPos);
this.mPos.x = this.vrend.buffer._xmouse;
this.mPos.y = this.vrend.buffer._ymouse;
this.mDelta = this.mPos.minus(this.mOldpos);
if (this.mState && (!this.mOldState)) {
this.mPressed = true;
this.mOldState = true;
this.mDownPos.x = this.mPos.x;
this.mDownPos.y = this.mPos.y;
} else {
this.mPressed = false;
}
if ((!this.mState) && (this.mOldState)) {
this.mReleased = true;
this.mOldState = false;
this.mUpPos.x = this.mPos.x;
this.mUpPos.y = this.mPos.y;
} else {
this.mReleased = false;
}
if (this.mState) {
this.mUpPos.x = this.mPos.x;
this.mUpPos.y = this.mPos.y;
}
var i = 0;
while (i < this.kCode.length) {
this.kOldState[i] = Key.isDown(this.kCode[i]);
i++;
}
var temp = this.kOldState;
this.kOldState = this.kState;
this.kState = temp;
var i = 0;
while (i < this.tKey.length) {
if (this.Pressed(this.tKey[i])) {
this.tState[i] = !this.tState[i];
}
i++;
}
};
InputManager.prototype.CaptureMouseDown = function () {
this.mOldState = false;
this.mState = true;
};
InputManager.prototype.CaptureMouseUp = function () {
this.mOldState = true;
this.mState = false;
};
InputManager.prototype.getMousePos = function () {
return(this.mPos.clone());
};
InputManager.prototype.getMouseDelta = function () {
return(this.mDelta.clone());
};
InputManager.prototype.getMouseDragDelta = function () {
return(this.mUpPos.minus(this.mDownPos));
};
InputManager.prototype.getMouseDownPos = function () {
return(this.mDownPos.clone());
};
InputManager.prototype.getMouseUpPos = function () {
return(this.mUpPos.clone());
};
InputManager.prototype.MousePressed = function () {
return(this.mPressed);
};
InputManager.prototype.MouseReleased = function () {
return(this.mReleased);
};
InputManager.prototype.MouseDown = function () {
return(this.mState);
};
InputManager.prototype.Down = function (knum) {
return(this.kState[knum]);
};
InputManager.prototype.Pressed = function (knum) {
return(this.kState[knum] && (!this.kOldState[knum]));
};
InputManager.prototype.Released = function (knum) {
return((!this.kState[knum]) && (this.kOldState[knum]));
};
InputManager.prototype.Toggled = function (tnum) {
return(this.tState[tnum]);
};
function VectorRenderer() {
this.buffer = CreateMC("EMPTY_MC", "rend");
this.buffer._x = 0;
this.buffer._y = 0;
this.thickness = 0;
this.rgb = 0;
this.alpha = 100;
}
VectorRenderer.prototype.Clear = function () {
this.buffer.clear();
this.buffer.lineStyle(this.thickness, this.rgb, this.alpha);
};
VectorRenderer.prototype.SetStyle = function (thick, rgb, alpha) {
this.buffer.lineStyle(thick, rgb, alpha);
};
VectorRenderer.prototype.DrawLine = function (va, vb) {
this.buffer.moveTo(va.x, va.y);
this.buffer.lineTo(vb.x, vb.y);
};
VectorRenderer.prototype.DrawLine_S = function (x0, y0, x1, y1) {
this.buffer.moveTo(x0, y0);
this.buffer.lineTo(x1, y1);
};
VectorRenderer.prototype.DrawArrow_S = function (x0, y0, x1, y1) {
this.buffer.moveTo(x0, y0);
this.buffer.lineTo(x1, y1);
var dx = (x1 - x0);
var dy = (y1 - y0);
var len = Math.sqrt((dx * dx) + (dy * dy));
if (len == 0) {
return(undefined);
}
dx = dx / len;
dy = dy / len;
var nx = (-dy);
var ny = dx;
var rad = 2;
this.buffer.moveTo(x1, y1);
this.buffer.lineTo((x1 - (rad * dx)) - (rad * nx), (y1 - (rad * dy)) - (rad * ny));
this.buffer.moveTo(x1, y1);
this.buffer.lineTo((x1 - (rad * dx)) + (rad * nx), (y1 - (rad * dy)) + (rad * ny));
};
VectorRenderer.prototype.DrawArrow = function (p0, p1) {
var x0 = p0.x;
var y0 = p0.y;
var x1 = p1.x;
var y1 = p1.y;
this.buffer.moveTo(x0, y0);
this.buffer.lineTo(x1, y1);
var dx = (x1 - x0);
var dy = (y1 - y0);
var len = Math.sqrt((dx * dx) + (dy * dy));
if (len == 0) {
return(undefined);
}
dx = dx / len;
dy = dy / len;
var nx = (-dy);
var ny = dx;
var rad = 2;
this.buffer.moveTo(x1, y1);
this.buffer.lineTo((x1 - (rad * dx)) - (rad * nx), (y1 - (rad * dy)) - (rad * ny));
this.buffer.moveTo(x1, y1);
this.buffer.lineTo((x1 - (rad * dx)) + (rad * nx), (y1 - (rad * dy)) + (rad * ny));
};
VectorRenderer.prototype.DrawArrowR = function (p0, p1, r) {
var x0 = p0.x;
var y0 = p0.y;
var x1 = p1.x;
var y1 = p1.y;
this.buffer.moveTo(x0, y0);
this.buffer.lineTo(x1, y1);
var dx = (x1 - x0);
var dy = (y1 - y0);
var len = Math.sqrt((dx * dx) + (dy * dy));
if (len == 0) {
return(undefined);
}
dx = dx / len;
dy = dy / len;
var nx = (-dy);
var ny = dx;
var rad = r;
this.buffer.moveTo(x1, y1);
this.buffer.lineTo((x1 - (rad * dx)) - (rad * nx), (y1 - (rad * dy)) - (rad * ny));
this.buffer.moveTo(x1, y1);
this.buffer.lineTo((x1 - (rad * dx)) + (rad * nx), (y1 - (rad * dy)) + (rad * ny));
};
VectorRenderer.prototype.DrawLinestrip = function (vList) {
this.buffer.moveTo(vList[0].x, vList[0].y);
var i = 0;
while (i < vList.length) {
this.buffer.lineTo(vList[i].x, vList[i].y);
i++;
}
};
VectorRenderer.prototype.DrawTri = function (va, vb, vc) {
this.buffer.moveTo(va.x, va.y);
this.buffer.lineTo(vb.x, vb.y);
this.buffer.lineTo(vc.x, vc.y);
this.buffer.lineTo(va.x, va.y);
};
VectorRenderer.prototype.DrawQuad = function (a, b, c, d) {
this.buffer.moveTo(a.x, a.y);
this.buffer.lineTo(b.x, b.y);
this.buffer.lineTo(c.x, c.y);
this.buffer.lineTo(d.x, d.y);
this.buffer.lineTo(a.x, a.y);
};
VectorRenderer.prototype.DrawPlus = function (v) {
this.buffer.moveTo(v.x - 1, v.y);
this.buffer.lineTo(v.x + 1, v.y);
this.buffer.moveTo(v.x, v.y - 1);
this.buffer.lineTo(v.x, v.y + 1);
};
VectorRenderer.prototype.DrawPlus_S = function (vx, vy) {
this.buffer.moveTo(vx - 1, vy);
this.buffer.lineTo(vx + 1, vy);
this.buffer.moveTo(vx, vy - 1);
this.buffer.lineTo(vx, vy + 1);
};
VectorRenderer.prototype.DrawPlusR = function (v, r) {
this.buffer.moveTo(v.x - r, v.y);
this.buffer.lineTo(v.x + r, v.y);
this.buffer.moveTo(v.x, v.y - r);
this.buffer.lineTo(v.x, v.y + r);
};
VectorRenderer.prototype.DrawCross = function (v) {
this.buffer.moveTo(v.x - 1, v.y - 1);
this.buffer.lineTo(v.x + 1, v.y + 1);
this.buffer.moveTo(v.x + 1, v.y - 1);
this.buffer.lineTo(v.x - 1, v.y + 1);
};
VectorRenderer.prototype.DrawCross_S = function (vx, vy) {
this.buffer.moveTo(vx - 1, vy - 1);
this.buffer.lineTo(vx + 1, vy + 1);
this.buffer.moveTo(vx + 1, vy - 1);
this.buffer.lineTo(vx - 1, vy + 1);
};
VectorRenderer.prototype.DrawCrossR = function (v, r) {
this.buffer.moveTo(v.x - r, v.y - r);
this.buffer.lineTo(v.x + r, v.y + r);
this.buffer.moveTo(v.x + r, v.y - r);
this.buffer.lineTo(v.x - r, v.y + r);
};
VectorRenderer.prototype.DrawCircle = function (v, r) {
var x = v.x;
var y = v.y;
this.buffer.moveTo(x + r, y);
this.buffer.curveTo(r + x, (0.4142 * r) + y, (0.7071 * r) + x, (0.7071 * r) + y);
this.buffer.curveTo((0.4142 * r) + x, r + y, x, r + y);
this.buffer.curveTo((-0.4142 * r) + x, r + y, (-0.7071 * r) + x, (0.7071 * r) + y);
this.buffer.curveTo((-r) + x, (0.4142 * r) + y, (-r) + x, y);
this.buffer.curveTo((-r) + x, (-0.4142 * r) + y, (-0.7071 * r) + x, (-0.7071 * r) + y);
this.buffer.curveTo((-0.4142 * r) + x, (-r) + y, x, (-r) + y);
this.buffer.curveTo((0.4142 * r) + x, (-r) + y, (0.7071 * r) + x, (-0.7071 * r) + y);
this.buffer.curveTo(r + x, (-0.4142 * r) + y, r + x, y);
};
VectorRenderer.prototype.DrawArc = function (p0, p1, c) {
this.buffer.moveTo(p0.x, p0.y);
this.buffer.curveTo(c.x, c.y, p1.x, p1.y);
};
VectorRenderer.prototype.DrawArc_S = function (x0, y0, x1, y1, xc, yc) {
this.buffer.moveTo(x0, y0);
this.buffer.curveTo(xc, yc, x1, y1);
};
VectorRenderer.prototype.DrawAABB = function (p, xw, yw) {
var v0 = new Vector2(p.x + xw, p.y + yw);
var v1 = new Vector2(p.x - xw, p.y + yw);
var v2 = new Vector2(p.x - xw, p.y - yw);
var v3 = new Vector2(p.x + xw, p.y - yw);
this.DrawQuad(v0, v1, v2, v3);
};
VectorRenderer.prototype.DrawAABB_S = function (minx, maxx, miny, maxy) {
var v0 = new Vector2(maxx, maxy);
var v1 = new Vector2(minx, maxy);
var v2 = new Vector2(minx, miny);
var v3 = new Vector2(maxx, miny);
this.DrawQuad(v0, v1, v2, v3);
};
VectorRenderer.prototype.DrawAABB_S2 = function (px, py, xw, yw) {
var v0 = new Vector2(px + xw, py + yw);
var v1 = new Vector2(px - xw, py + yw);
var v2 = new Vector2(px - xw, py - yw);
var v3 = new Vector2(px + xw, py - yw);
this.DrawQuad(v0, v1, v2, v3);
};
VectorRenderer.prototype.DrawConcaveCCWArc_S = function (cx, cy, px, py) {
var p0x = px;
var p0y = py;
var vx = (p0x - cx);
var vy = (p0y - cy);
var r = Math.sqrt((vx * vx) + (vy * vy));
var nx = vy;
var ny = (-vx);
var p1x = ((p0x + nx) - cx);
var p1y = ((p0y + ny) - cy);
var len = Math.sqrt((p1x * p1x) + (p1y * p1y));
p1x = p1x / len;
p1y = p1y / len;
p1x = p1x * r;
p1y = p1y * r;
p1x = p1x + cx;
p1y = p1y + cy;
var c0x = (((p0x + p1x) * 0.5) - cx);
var c0y = (((p0y + p1y) * 0.5) - cy);
var clen = Math.sqrt((c0x * c0x) + (c0y * c0y));
var dlen = (r - clen);
c0x = c0x / clen;
c0y = c0y / clen;
c0x = c0x * (r + dlen);
c0y = c0y * (r + dlen);
c0x = c0x + cx;
c0y = c0y + cy;
this.buffer.moveTo(p0x, p0y);
this.buffer.curveTo(c0x, c0y, p1x, p1y);
var p0x = p1x;
var p0y = p1y;
var vx = (p0x - cx);
var vy = (p0y - cy);
var r = Math.sqrt((vx * vx) + (vy * vy));
var nx = vy;
var ny = (-vx);
var p1x = ((p0x + nx) - cx);
var p1y = ((p0y + ny) - cy);
var len = Math.sqrt((p1x * p1x) + (p1y * p1y));
p1x = p1x / len;
p1y = p1y / len;
p1x = p1x * r;
p1y = p1y * r;
p1x = p1x + cx;
p1y = p1y + cy;
var c0x = (((p0x + p1x) * 0.5) - cx);
var c0y = (((p0y + p1y) * 0.5) - cy);
var clen = Math.sqrt((c0x * c0x) + (c0y * c0y));
var dlen = (r - clen);
c0x = c0x / clen;
c0y = c0y / clen;
c0x = c0x * (r + dlen);
c0y = c0y * (r + dlen);
c0x = c0x + cx;
c0y = c0y + cy;
this.buffer.curveTo(c0x, c0y, p1x, p1y);
};
VectorRenderer.prototype.DrawLinestrip_nrope = function (vList) {
this.buffer.moveTo(vList[0].x, vList[0].y);
var i = 1;
while (i < vList.length) {
this.buffer.lineTo(vList[i].x, vList[i].y);
i++;
}
};
function GraphicsSystem() {
this.front_depth = 1001;
this.back_depth = 1000;
this.stepsize = 10;
}
GraphicsSystem.prototype.GetNextDepth_Front = function () {
this.front_depth = this.front_depth + this.stepsize;
return(this.front_depth);
};
GraphicsSystem.prototype.GetNextDepth_Back = function () {
this.back_depth = this.back_depth - this.stepsize;
return(this.back_depth);
};
function CreateMC(linkName, instanceName) {
var depth = gfx.GetNextDepth_Front();
if (linkName == "EMPTY_MC") {
return(_root.createEmptyMovieClip(instanceName, depth));
}
if (linkName == "TEXT_MC") {
return(_root.createTextField(instanceName, depth, 0, 0, 100, 100));
}
return(_root.attachMovie(linkName, instanceName + depth, depth));
}
DestroyMC = function (mc) {
mc.swapDepths(1048000);
mc.removeMovieClip();
};
function Point(x, y, title, col, isDraggable, dragFunc, xmin, ymin, xmax, ymax) {
this.pos = new Vector2(x, y);
this.title = title;
this.mc = CreateMC("pointMC", "point_" + title);
this.mc.title = this.mc.attachMovie("titleMC", "title_" + title, 1);
this.mc.title.txt = this.title;
this.mc.title._x = 4;
this.mc.title._y = -4;
var temp = new Color(this.mc.gfx);
temp.setRGB(col);
this.mc._x = x;
this.mc._y = y;
if (isDraggable) {
this.mc.hitArea = this.mc.gfx;
this.mc.onPress = function () {
this.startDrag(false, xmin, ymin, xmax, ymax);
this.onEnterFrame = dragFunc;
};
this.mc.onMouseUp = function () {
this.stopDrag();
this.onEnterFrame();
this.onEnterFrame = null;
};
}
}
function AABB(x, y, xw, yw, title, col, isDraggable, dragFunc, xmin, ymin, xmax, ymax) {
this.pos = new Vector2(x, y);
this.xw = xw;
this.yw = yw;
this.title = title;
this.mc = CreateMC("EMPTY_MC", "aabb_" + title);
this.mc.point = this.mc.AttachMovie("pointMC", "aabbcenter_" + title, 2);
this.mc.point._xscale = 100 / this.mc.point._width;
this.mc.point._yscale = 100 / this.mc.point._height;
var temp = new Color(this.mc.point);
temp.setRGB(col);
this.mc.title = this.mc.attachMovie("titleMC", "title_" + title, 3);
this.mc.title.txt = this.title;
this.mc.title._x = xw;
this.mc.title._y = -yw;
this.mc.extents = this.mc.createEmptyMovieClip("aabbextents_" + title, 1);
this.mc.extents.lineStyle(0, col, 100);
this.mc.extents.beginFill(col, 25);
this.mc.extents.moveTo(xw, yw);
this.mc.extents.lineTo(xw, -yw);
this.mc.extents.lineTo(-xw, -yw);
this.mc.extents.lineTo(-xw, yw);
this.mc.extents.lineTo(xw, yw);
this.mc.extents.endFill();
this.mc._x = x;
this.mc._y = y;
if (isDraggable) {
this.mc.hitArea = this.mc.extents;
this.mc.onPress = function () {
this.startDrag(false, xmin + xw, ymin + yw, xmax - xw, ymax - yw);
this.onEnterFrame = dragFunc;
};
this.mc.onRelease = function () {
this.stopDrag();
this.onEnterFrame();
this.onEnterFrame = null;
};
}
}
function Circle(x, y, r, title, col, isDraggable, dragFunc, xmin, ymin, xmax, ymax) {
this.pos = new Vector2(x, y);
this.r = r;
this.title = title;
this.mc = CreateMC("EMPTY_MC", "circle_" + title);
this.mc.point = this.mc.AttachMovie("pointMC", "circlecenter_" + title, 2);
this.mc.point._xscale = 100 / this.mc.point._width;
this.mc.point._yscale = 100 / this.mc.point._height;
var temp = new Color(this.mc.point);
temp.setRGB(col);
this.mc.title = this.mc.attachMovie("titleMC", "title_" + title, 3);
this.mc.title.txt = this.title;
this.mc.title._x = r;
this.mc.title._y = -r;
this.mc.extents = this.mc.createEmptyMovieClip("circleextents_" + title, 1);
this.mc.extents.lineStyle(0, col, 100);
this.mc.extents.beginFill(col, 25);
this.mc.extents.moveTo(r, 0);
this.mc.extents.curveTo(r, 0.4142 * r, 0.7071 * r, 0.7071 * r);
this.mc.extents.curveTo(0.4142 * r, r, 0, r);
this.mc.extents.curveTo(-0.4142 * r, r, -0.7071 * r, 0.7071 * r);
this.mc.extents.curveTo(-r, 0.4142 * r, -r, 0);
this.mc.extents.curveTo(-r, -0.4142 * r, -0.7071 * r, -0.7071 * r);
this.mc.extents.curveTo(-0.4142 * r, -r, 0, -r);
this.mc.extents.curveTo(0.4142 * r, -r, 0.7071 * r, -0.7071 * r);
this.mc.extents.curveTo(r, -0.4142 * r, r, 0);
this.mc.extents.endFill();
this.mc._x = x;
this.mc._y = y;
if (isDraggable) {
this.mc.hitArea = this.mc.extents;
this.mc.onPress = function () {
this.startDrag(false, xmin + r, ymin + r, xmax - r, ymax - r);
this.onEnterFrame = dragFunc;
};
this.mc.onRelease = function () {
this.stopDrag();
this.onEnterFrame();
this.onEnterFrame = null;
};
}
}
function DrawSepAxis(rend, dir, offset, c0, r0, c1, r1) {
var n = dir.normR();
var p1 = new Vector2(c1.x + (n.x * offset), c1.y + (n.y * offset));
var delta = c1.minus(c0);
var temp = delta.proj(dir);
var p0 = new Vector2(p1.x - temp.x, p1.y - temp.y);
rend.SetStyle(0, 2263074, 20);
rend.DrawLine_S((c1.x + (n.x * offset)) - (300 * dir.x), (c1.y + (n.y * offset)) - (300 * dir.y), (c1.x + (n.x * offset)) + (300 * dir.x), (c1.y + (n.y * offset)) + (300 * dir.y));
rend.SetStyle(2, 8921634, 100);
rend.DrawLine_S(p0.x - (r0 * dir.x), p0.y - (r0 * dir.y), p0.x + (r0 * dir.x), p0.y + (r0 * dir.y));
rend.SetStyle(4, 2237064, 30);
rend.DrawLine_S(p1.x - (r1 * dir.x), p1.y - (r1 * dir.y), p1.x + (r1 * dir.x), p1.y + (r1 * dir.y));
var pen = (0 < ((r0 + r1) - delta.len()));
return(pen);
}
gfx = new GraphicsSystem();
input = new InputManager();
rend = new VectorRenderer();
function DrawObjCells() {
rend.Clear();
var px = box0.pos.x;
var py = box0.pos.y;
var dx = (px - 128);
var dy = (py - 128);
if (box0.xw < (CELL_HW - Math.abs(dx))) {
dx = 0;
} else {
dx = dx / Math.abs(dx);
}
if (box0.yw < (CELL_HW - Math.abs(dy))) {
dy = 0;
} else {
dy = dy / Math.abs(dy);
}
var size = CELL_HW;
var x = ((dx * size) * 2);
var y = ((dy * size) * 2);
rend.SetStyle(3, 8921634, 100);
rend.DrawAABB_S2(128, 128, size, size);
rend.DrawAABB_S2(128 + x, 128, size, size);
rend.DrawAABB_S2(128, 128 + y, size, size);
rend.DrawAABB_S2(128 + x, 128 + y, size, size);
}
function BoxDragged() {
box0.pos.x = this._x;
box0.pos.y = this._y;
DrawObjCells();
}
var bw = 28;
var bh = 36;
box0 = new AABB(128, 128, 28, 36, "", 2237064, true, BoxDragged, 88 - bw, 88 - bh, 168 + bw, 168 + bh);
var gridMC = _root.createEmptyMovieClip("gridMC", 999);
gridMC.lineStyle(0, 11184810, 100);
CELL_HW = 40;
var i = 0;
while (i < 4) {
var y = (8 + ((i * CELL_HW) * 2));
gridMC.moveTo(0, y);
gridMC.lineTo(256, y);
i++;
}
var i = 0;
while (i < 4) {
var x = (8 + ((i * CELL_HW) * 2));
gridMC.moveTo(x, 0);
gridMC.lineTo(x, 256);
i++;
}
DrawObjCells();