Combined Code
movieClip 3 {
}
movieClip 7 {
frame 1 {
tempspriteo = _parent.spriteo;
gotoAndPlay(tempspriteo);
}
frame 13 {
tempspriteo = _parent.spriteo;
gotoAndPlay(tempspriteo);
}
frame 25 {
tempspriteo = _parent.spriteo;
gotoAndPlay(tempspriteo);
}
frame 37 {
tempspriteo = _parent.spriteo;
gotoAndPlay(tempspriteo);
}
frame 49 {
tempspriteo = _parent.spriteo;
gotoAndPlay(tempspriteo);
}
}
movieClip 9 {
frame 1 {
stop();
}
}
movieClip 10 cust {
frame 1 {
function checkdesire() {
--desire;
if (desire <= 0) {
buying = 1;
clearInterval(interval1);
}
}
function checksecond() {
trace('one second has passed');
}
function movetostore() {
if (this.shadow.hitTest(_root.store)) {
_x = _x + 0;
_y = _y + 0;
if (doneorder == 0) {
interval2 = setTimeout(buyingitems, 5000);
doneorder = 1;
} else {}
} else {
diffx = _root.store._x - this._x;
diffy = _root.store._y - this._y;
_x = _x + diffx / 20;
_y = _y + diffy / 20;
if (diffx < diffy) {
if (diffy > 0) {
spriteo = 'down';
} else {
spriteo = 'top';
}
} else {
if (diffx > diffy) {
if (diffx > 0) {
spriteo = 'right';
} else {
spriteo = 'left';
}
}
}
}
}
function movetoexit() {
if (orient == 'hori') {
if (exitdestination._x - this._x > 0) {
_x = _x + speed;
spriteo = 'right';
} else {
_x = _x - speed;
spriteo = 'left';
}
diffy = exitdestination._y - this._y;
_y = _y + diffy / 100;
} else {
if (orient == 'vert') {
if (exitdestination._y - this._y > 0) {
_y = _y + speed;
spriteo = 'down';
} else {
_y = _y - speed;
spriteo = 'top';
}
diffx = exitdestination._x - this._x;
_x = _x + diffx / 100;
}
}
if (this.shadow.hitTest(exitdestination)) {
if (doneorder == 1) {
++_root.customers;
_root.sales += 2.5;
} else {
_root.missedsales += 2.5;
}
clearInterval(interval2);
clearInterval(interval1);
delete this.onEnterFrame;
this.removeMovieClip();
}
}
function buyingitems() {
buying = 0;
}
function rand(min, max) {
return Math.floor(Math.random() * max + min);
}
function checkorient() {}
this.custnum = _root.custnum;
this.buying = 0;
this.doneorder = 0;
this.done = 0;
this.orient = orient;
this.spriteo = rspriteo;
this.desire = desire;
this.exitdestination = exitdestination;
speed = speed;
interval1 = setInterval(checkdesire, 2000);
this.onEnterFrame = function () {
if (this.buying == 1 && this.done == 0) {
movetostore();
}
if (this.buying == 0) {
movetoexit();
}
};
}
}
frame 1 {
function rand(min, max) {
return Math.floor(Math.random() * max + min);
}
function generatecustomer() {
seed = rand(1, 3);
if (seed == 1) {
++_root.custnum;
randx = _root.spawn1._x;
randy = 267 + rand(-10, 30);
rspeed = rand(1, 3);
rdesire = rand(1, 10);
attachMovie('cust', 'cust_' + _root.custnum, _root.getNextHighestDepth(), {'exitdestination': _root.exit1, 'orient': 'hori', 'rspriteo': 'left', 'desire': rdesire, 'speed': rspeed, '_y': randy, '_x': randx});
} else {
if (seed == 2) {
++_root.custnum;
randx = _root.spawn2._x;
randy = 267 + rand(-10, 30);
rspeed = rand(1, 3);
rdesire = rand(1, 10);
attachMovie('cust', 'cust_' + _root.custnum, _root.getNextHighestDepth(), {'exitdestination': _root.exit2, 'orient': 'hori', 'rspriteo': 'right', 'desire': rdesire, 'speed': rspeed, '_y': randy, '_x': randx});
} else {
++_root.custnum;
randx = 368 + rand(-10, 30);
randy = _root.spawn3._y;
rspeed = rand(1, 3);
rdesire = rand(2, 5);
attachMovie('cust', 'cust_' + _root.custnum, _root.getNextHighestDepth(), {'exitdestination': _root.exit3, 'orient': 'vert', 'rspriteo': 'top', 'desire': rdesire, 'speed': rspeed, '_y': randy, '_x': randx});
}
}
}
custnum = 0;
customers = 0;
sales = 0;
missedsales = 0;
setInterval(generatecustomer, 2000);
onEnterFrame = function () {
this.infobox.text = 'cust_generated: ' + custnum + '\ncustomers : ' + customers + '\nsales : $' + sales + '\nmissed sales : $' + missedsales;
};
}
movieClip 13 {
}
movieClip 15 {
}
movieClip 17 {
}
movieClip 19 {
}
button 22 {
on (release) {
++_root.custnum;
trace('adding');
randx = _root.spawn1._x;
randy = 267 + rand(-10, 30);
rspeed = rand(1, 3);
rdesire = rand(1, 10);
trace('randy ' + randy);
attachMovie('cust', 'cust_' + _root.custnum, _root.getNextHighestDepth(), {'exitdestination': _root.exit1, 'orient': 'hori', 'desire': rdesire, 'speed': rspeed, '_y': randy, '_x': randx});
}
}
button 23 {
on (release) {
++_root.custnum;
trace('adding');
randx = _root.spawn2._x;
randy = 267 + rand(-10, 30);
rspeed = rand(1, 3);
rdesire = rand(1, 10);
trace('randy ' + randy);
attachMovie('cust', 'cust_' + _root.custnum, _root.getNextHighestDepth(), {'exitdestination': _root.exit2, 'orient': 'hori', 'desire': rdesire, 'speed': rspeed, '_y': randy, '_x': randx});
}
}
button 24 {
on (release) {
++_root.custnum;
trace('adding');
randx = 368 + rand(-10, 30);
randy = _root.spawn3._y;
rspeed = rand(1, 3);
rdesire = rand(2, 5);
trace('randy ' + randy);
attachMovie('cust', 'cust_' + _root.custnum, _root.getNextHighestDepth(), {'exitdestination': _root.exit3, 'orient': 'vert', 'desire': rdesire, 'speed': rspeed, '_y': randy, '_x': randx});
}
}
// unknown tag 88 length 63
movieClip 31 {
}