Frame 3
stop();
Symbol 12 MovieClip [beamright] Frame 1
#initclip 76
Object.registerClass("beamright", Box);
#endinitclip
Symbol 37 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 31
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 52 MovieClip [cylinder] Frame 1
#initclip 33
Object.registerClass("cylinder", Particle);
#endinitclip
Symbol 55 MovieClip [barrel] Frame 1
#initclip 34
Object.registerClass("barrel", Particle);
#endinitclip
Symbol 58 MovieClip [bottom] Frame 1
#initclip 35
Object.registerClass("bottom", Particle);
#endinitclip
Symbol 61 MovieClip [girl] Frame 1
#initclip 36
Object.registerClass("girl", Particle);
#endinitclip
Symbol 64 MovieClip [seat] Frame 1
#initclip 37
Object.registerClass("seat", Particle);
#endinitclip
Symbol 67 MovieClip [wheel] Frame 1
#initclip 38
Object.registerClass("wheel", Particle);
#endinitclip
Symbol 71 MovieClip [gun_id] Frame 1
#initclip 39
Object.registerClass("gun_id", Gun);
#endinitclip
Symbol 76 MovieClip [leftFoot] Frame 1
#initclip 40
Object.registerClass("leftFoot", Particle);
#endinitclip
Symbol 79 MovieClip [rightFoot] Frame 1
#initclip 41
Object.registerClass("rightFoot", Particle);
#endinitclip
Symbol 82 MovieClip [targetRightHand] Frame 1
#initclip 42
Object.registerClass("targetRightHand", Particle);
#endinitclip
Symbol 85 MovieClip [targetBody] Frame 1
#initclip 43
Object.registerClass("targetBody", Particle);
#endinitclip
Symbol 88 MovieClip [targethead] Frame 1
#initclip 44
Object.registerClass("targethead", Particle);
#endinitclip
Symbol 91 MovieClip [targetLeftHand] Frame 1
#initclip 45
Object.registerClass("targetLeftHand", Particle);
#endinitclip
Symbol 97 MovieClip [target_id] Frame 1
#initclip 46
Object.registerClass("target_id", Target);
#endinitclip
Symbol 114 MovieClip [explosion_id] Frame 1
#initclip 47
Object.registerClass("explosion_id", Explosion);
#endinitclip
Symbol 115 MovieClip [block] Frame 1
#initclip 48
Object.registerClass("block", Block);
#endinitclip
Symbol 117 MovieClip [worldbox_id] Frame 1
#initclip 49
Object.registerClass("worldbox_id", Worldbox);
#endinitclip
Symbol 119 MovieClip [playhitzone] Frame 1
#initclip 50
Object.registerClass("playhitzone", PlayGame);
#endinitclip
Symbol 121 MovieClip [smoke_id] Frame 1
#initclip 51
Object.registerClass("smoke_id", Smoke);
#endinitclip
Symbol 126 MovieClip [magnetOn_id] Frame 1
#initclip 52
Object.registerClass("magnetOn_id", Magnet);
#endinitclip
Symbol 127 MovieClip [magnet_id] Frame 1
#initclip 53
Object.registerClass("magnet_id", Mushroom);
#endinitclip
Symbol 130 MovieClip [bigmetal_id] Frame 1
#initclip 54
Object.registerClass("bigmetal_id", Box);
#endinitclip
Symbol 133 MovieClip [heavyframevert_id] Frame 1
#initclip 55
Object.registerClass("heavyframevert_id", Box);
#endinitclip
Symbol 135 MovieClip [heavyframe_id] Frame 1
#initclip 56
Object.registerClass("heavyframe_id", Box);
#endinitclip
Symbol 138 MovieClip [crate_id] Frame 1
#initclip 57
Object.registerClass("crate_id", WeakBox);
#endinitclip
Symbol 141 MovieClip [beamtop] Frame 1
#initclip 58
Object.registerClass("beamtop", Box);
#endinitclip
Symbol 144 MovieClip [openframe_id] Frame 1
#initclip 59
Object.registerClass("openframe_id", Box);
#endinitclip
Symbol 147 MovieClip [movingbox_id] Frame 1
#initclip 60
Object.registerClass("movingbox_id", MovingBox);
#endinitclip
Symbol 149 MovieClip [metalcrate_id] Frame 1
#initclip 61
Object.registerClass("metalcrate_id", Box);
#endinitclip
Symbol 154 MovieClip [switch_id] Frame 1
#initclip 62
Object.registerClass("switch_id", Switch);
#endinitclip
Symbol 166 MovieClip [drone_id] Frame 1
#initclip 63
Object.registerClass("drone_id", MovingTarget);
#endinitclip
Symbol 177 MovieClip [gate_id] Frame 1
#initclip 64
Object.registerClass("gate_id", Gate);
#endinitclip
Symbol 180 MovieClip [smallmetal_id] Frame 1
#initclip 65
Object.registerClass("smallmetal_id", Box);
#endinitclip
Symbol 181 MovieClip [moregamesbtn] Frame 1
#initclip 66
Object.registerClass("moregamesbtn", MoreGames);
#endinitclip
Symbol 185 MovieClip [nextlevel] Frame 1
#initclip 67
Object.registerClass("nextlevel", Game);
#endinitclip
Symbol 186 MovieClip [nextlevelhitzone] Frame 1
#initclip 68
Object.registerClass("nextlevelhitzone", NextLevel);
#endinitclip
Symbol 188 MovieClip [edit] Frame 1
#initclip 69
Object.registerClass("edit", Edit);
#endinitclip
Symbol 190 MovieClip [printlevel] Frame 1
#initclip 70
Object.registerClass("printlevel", PrintLevel);
#endinitclip
Symbol 191 MovieClip [Ballmove] Frame 1
#initclip 71
Object.registerClass("Ballmove", Ball);
#endinitclip
Symbol 196 MovieClip [link_id] Frame 1
#initclip 72
Object.registerClass("link_id", URLLogo);
#endinitclip
Symbol 198 MovieClip [Bumper_mc] Frame 1
#initclip 73
Object.registerClass("Bumper_mc", Pinball);
#endinitclip
Symbol 200 MovieClip [TileFactory_id] Frame 1
#initclip 74
Object.registerClass("TileFactory_id", TileFactory);
#endinitclip
Symbol 206 MovieClip [branding_aligned_right] Frame 1
#initclip 75
Object.registerClass("branding_aligned_right", Branding);
#endinitclip
Instance of Symbol 205 MovieClip in Symbol 206 MovieClip [branding_aligned_right] Frame 1
on (release) {
getURL (_root.localization_url1, "_blank");
}
Symbol 239 MovieClip [__Packages.Particle] Frame 0
class Particle extends MovieClip
{
var startx, _x, starty, _y, ticks, maxticks, _visible, pos, vel, gravity, drag, AnimInt, oldTime, _height, _parent, _width;
function Particle () {
super();
startx = _x;
starty = _y;
ticks = 0;
maxticks = 200;
}
function Start() {
_visible = true;
pos = new Vector(startx, starty);
var _local3 = -20 * Math.random();
var _local4 = -5 + (10 * Math.random());
vel = new Vector(_local4, _local3);
gravity = new Vector(0, 0.8);
drag = 0.99;
clearInterval(AnimInt);
AnimInt = setInterval(Update, 20, this);
_global.Game.addInterval(AnimInt);
oldTime = getTimer();
}
function Stop() {
_visible = false;
clearInterval(AnimInt);
}
function Update(inThis) {
this=inThis;//parameter overwritten
ticks++;
if (ticks > maxticks) {
clearInterval(AnimInt);
}
if (((pos.y + _parent._y) + _height) > 350) {
vel.x = 0.6 * vel.x;
vel.y = -0.6 * vel.y;
pos.y = (350 - _parent._y) - _height;
}
if (((pos.x + _parent._x) + _width) > 500) {
vel.x = -0.6 * vel.x;
vel.y = 0.6 * vel.y;
pos.x = (500 - _parent._x) - _width;
}
if ((pos.x + _parent._x) < 0) {
vel.x = -0.6 * vel.x;
vel.y = 0.6 * vel.y;
pos.x = -_parent._x;
}
vel = vel.Multiply(drag);
vel = vel.Add(gravity);
pos = pos.Add(vel);
_x = pos.x;
_y = pos.y;
}
}
Symbol 240 MovieClip [__Packages.Vector] Frame 0
class Vector
{
var x, y;
function Vector (aX, aY, t) {
if (aX == undefined) {
x = new Number(0);
} else {
x = new Number(aX);
}
if (aY == undefined) {
y = new Number(0);
} else {
y = new Number(aY);
}
}
function DistanceTo(v) {
return(Subtract(v).Length());
}
function Divide(nr) {
var _local2 = new Vector();
_local2.x = x / nr;
_local2.y = y / nr;
return(_local2);
}
function Normalize() {
var _local2 = Length();
if (_local2 > 0) {
return(Divide(_local2));
}
trace("zero length normalize");
var _local3 = new Vector(0, 0);
return(_local3);
}
function Add(v) {
var _local2 = new Vector();
_local2.x = x + v.x;
_local2.y = y + v.y;
return(_local2);
}
function Subtract(v) {
var _local2 = new Vector();
_local2.x = x - v.x;
_local2.y = y - v.y;
return(_local2);
}
function Dot(v) {
var _local2;
_local2 = (x * v.x) + (y * v.y);
return(_local2);
}
function Multiply(nr) {
var _local2 = new Vector();
_local2.x = x * nr;
_local2.y = y * nr;
return(_local2);
}
function Length() {
return(Math.sqrt((x * x) + (y * y)));
}
function Reflect(n) {
var _local3 = new Vector();
var _local2;
n = n.Normalize();
_local2 = 2 * Dot(n);
_local2 = n.Multiply(_local2);
_local3 = Subtract(_local2);
return(_local3);
}
function Equals(v) {
var _local3 = new Vector();
if ((x == v.x) and (y == v.y)) {
return(true);
}
return(false);
}
function Duplicate() {
var _local2 = new Vector();
_local2.x = x;
_local2.y = y;
return(_local2);
}
function Print(label) {
trace((((((label + " ") + x) + ",") + y) + " length=") + Length());
}
}
Symbol 241 MovieClip [__Packages.Gun] Frame 0
class Gun extends MovieClip
{
var pinball, swapDepths, Nozzle, top, pieces, girl, cylinder, wheel, barrel, seat, bottom, flash, origWidth, _width, origHeight, _height, exploding, oldTime, explosion_snd, gun_snd, AnimatingVictory, wholebody, operator, _x, _y, x, y, ang, oldang;
function Gun () {
super();
pinball = _root.pinball;
_global.gun = this;
Key.addListener(this);
swapDepths(2000);
Nozzle = top.nozzle;
Nozzle.gotoAndStop(0);
top.guncharge_mc._alpha = 0;
pieces = new Array(girl, cylinder, wheel, barrel, seat, bottom);
flash._visible = false;
var _local5 = 0;
while (_local5 < pieces.length) {
pieces[_local5]._visible = false;
_local5++;
}
origWidth = _width;
origHeight = _height;
Mouse.addListener(this);
exploding = false;
oldTime = getTimer();
explosion_snd = new Sound(this);
explosion_snd.attachSound("explosionsound_id");
gun_snd = new Sound(this);
gun_snd.attachSound("gunsound_id");
_global.myEvents.Subscribe(this, "onEvent");
AnimatingVictory = false;
_global.editmachine.Subscribe(this);
}
function onEvent(ev) {
if (ev.type == "enemykilled") {
playVictoryAnim();
} else if (ev.type == "zeroballs") {
onEnterFrame = null;
}
}
function ExplodeIntoPieces() {
if (exploding) {
return(undefined);
}
exploding = true;
explosion_snd.start(0, 1);
wholebody._visible = false;
operator._visible = false;
top._visible = false;
var _local2 = 0;
while (_local2 < pieces.length) {
pieces[_local2].Start();
_local2++;
}
new Explosion(_x + (_width / 2), _y + (_height / 2), true);
}
function ReleaseBomb() {
gun_snd.start(0, 1);
pinball.myBall.Arm();
Nozzle.gotoAndPlay(1);
top.gotoAndPlay(2);
var _local2 = top._rotation + 90;
pinball.pos.x = top._x + _x;
pinball.pos.y = top._y + _y;
var _local3 = 0.1 + (Power / 250);
pinball.vel.x = _local3 * Math.sin((_local2 * Math.PI) / 180);
pinball.vel.y = (-_local3) * Math.cos((_local2 * Math.PI) / 180);
pinball.pos = pinball.pos.Add(pinball.vel.Normalize().Multiply(100));
pinball.oldtime = getTimer();
pinball.readyForFrameLoop = true;
MouseIsDown = false;
}
function onMouseDown() {
Power = 100;
if (((!_global.edit) && (!_global.gamePaused)) && (!pinball.myBall.Armed)) {
ReleaseBomb();
}
}
function onEnterFrame() {
if (_global.edit) {
return(undefined);
}
x = _root._xmouse - (_x + (origWidth / 2));
y = _root._ymouse - (_y + (origHeight / 2));
ang = Math.atan2(y, x);
top._rotation = (180 * ang) / Math.PI;
if (!AnimatingVictory) {
operator.gotoAndStop(5 + Math.round(top._rotation / 36));
}
oldang = ang;
_root.fps_txt.text = Math.round(1000 / (getTimer() - oldTime));
oldTime = getTimer();
}
function playVictoryAnim() {
AnimatingVictory = true;
operator.gotoAndPlay(5);
}
var MouseIsDown = false;
var Power = 0;
}
Symbol 242 MovieClip [__Packages.Explosion] Frame 0
class Explosion extends MovieClip
{
var removeMovieClip, _totalframes, _currentframe;
function Explosion (x, y, firsttime) {
super();
if (firsttime) {
var _local5 = _root.attachMovie("explosion_id", "explosion" + Math.random(), _root.getNextHighestDepth());
_local5._x = x;
_local5._y = y;
var _local4 = 0;
while (_local4 < 10) {
_local4++;
}
} else {
removeMovieClip();
}
}
function onEnterFrame() {
if (_currentframe == _totalframes) {
removeMovieClip();
}
}
}
Symbol 243 MovieClip [__Packages.Target] Frame 0
class Target extends MovieClip
{
var pinball, pos, _x, _y, NotHit, col, pieces, _name, BeamTime, maxBeamTime, wholebody, lookatplayer, explosion_snd, beam_snd, removeMovieClip, lightning_int;
function Target () {
super();
pinball = _root.pinball;
pos = new Vector(_x, _y);
NotHit = true;
col._visible = false;
var _local6;
pieces = new Array();
for (_local6 in this) {
if (_local6.substring(0, 5) == "piece") {
pieces.push(this[_local6]);
}
}
var _local5 = 0;
while (_local5 < pieces.length) {
pieces[_local5]._visible = false;
_local5++;
}
if (_global.canvas == undefined) {
_global.canvas = _root.createEmptyMovieClip("lightningcanvas-" + _name, _root.getNextHighestDepth());
}
BeamTime = 0;
maxBeamTime = 50;
wholebody.stop();
lookatplayer = false;
var _local7 = setInterval(turnHead, 5000, this);
_global.Game.addInterval(_local7);
_global.Game.addTarget(this);
_global.myEvents.Subscribe(this, "onEvent");
_global.editmachine.Subscribe(this);
explosion_snd = new Sound(this);
explosion_snd.attachSound("explosionsound_id");
beam_snd = new Sound(this);
beam_snd.attachSound("beam_id");
}
function onEvent(ev) {
if (ev.type == "zeroballs") {
startBeam();
}
}
function turnHead(inThis) {
this=inThis;//parameter overwritten
if (lookatplayer) {
lookLeft();
lookatplayer = false;
} else {
lookAhead();
lookatplayer = true;
}
}
function lookLeft() {
wholebody.gotoAndStop(2);
}
function lookAhead() {
wholebody.gotoAndStop(1);
}
function Delete() {
_global.Game.removeTarget(this);
removeMovieClip();
}
function upDatePosition() {
pos.x = _x;
pos.y = _y;
lookAhead();
}
function ExplodeIntoPieces() {
explosion_snd.start(0, 1);
wholebody._visible = false;
onEvent = undefined;
var _local2 = 0;
while (_local2 < pieces.length) {
pieces[_local2].Start();
_local2++;
}
}
function onEnterFrame() {
if (NotHit and col.hitTest(pinball.pos.x, pinball.pos.y, false)) {
new Explosion(_x, _y, true);
ExplodeIntoPieces();
NotHit = false;
pinball.myBall.Destroy();
_global.Game.removeTarget(this);
}
}
function startBeam() {
lightning_int = setInterval(animateBeam, 20, this);
_global.Game.addInterval(lightning_int);
beam_snd.start(0, 10);
_global.canvas.swapDepths(_root.getNextHighestDepth());
}
function animateBeam(inThis) {
this=inThis;//parameter overwritten
BeamTime++;
_global.canvas.swapDepths(_root.getNextHighestDepth());
if (BeamTime > maxBeamTime) {
clearInterval(lightning_int);
beam_snd.stop();
BeamTime = 0;
_global.gun.ExplodeIntoPieces();
_global.canvas.clear();
_global.gun.flash._visible = false;
_global.myEvents.Fire({type:"beamready"});
} else {
_global.canvas.clear();
_global.canvas.lineStyle(3 * Math.random(), 2883371, 100);
_global.canvas.moveTo(_x, _y);
_global.canvas.lineTo(_global.gun._x + _global.gun.beamtarget._x, _global.gun._y + _global.gun.beamtarget._y);
var _local4 = _global.gun.operator._totalframes;
_global.gun.operator.gotoAndStop(Math.round(_local4 * Math.random()));
_global.gun.top._visible = false;
_global.gun.flash._visible = true;
}
}
}
Symbol 244 MovieClip [__Packages.Block] Frame 0
class Block extends MovieClip
{
var pinball, normal, mag, outcome, left_mc, top_mc, right_mc, bottom_mc, startDrag, stopDrag;
function Block () {
super();
pinball = _root.pinball;
normal = new Vector();
mag = 0.002;
pinball.addCollisionSet(this);
outcome = new Object();
}
function detectCol(body) {
var _local2 = body.pos;
if (left_mc.hitTest(_local2.x, _local2.y, true)) {
outcome.colliding = true;
normal.x = -1;
normal.y = 0;
} else if (top_mc.hitTest(_local2.x, _local2.y, true)) {
outcome.colliding = true;
normal.x = 0;
normal.y = -1;
} else if (right_mc.hitTest(_local2.x, _local2.y, true)) {
outcome.colliding = true;
normal.x = 1;
normal.y = 0;
} else if (bottom_mc.hitTest(_local2.x, _local2.y, true)) {
outcome.colliding = true;
normal.x = 0;
normal.y = 1;
} else {
outcome.colliding = false;
}
outcome.normal = normal;
outcome.safepos = _local2.Add(normal.Multiply(0.1));
return(outcome);
}
function onPress() {
startDrag(false);
}
function onRelease() {
stopDrag();
}
}
Symbol 245 MovieClip [__Packages.Worldbox] Frame 0
class Worldbox extends MovieClip
{
var pinball, normal, mag, outcome, _x, _width, _height, _y;
function Worldbox () {
super();
pinball = _root.pinball;
normal = new Vector();
mag = 0.002;
pinball.addCollisionSet(this);
outcome = new Object();
}
function detectCol(body) {
var _local2 = body.pos;
normal.x = 0;
normal.y = 0;
outcome.normal = normal;
outcome.safepos = _local2;
if (_local2.x < _x) {
outcome.colliding = true;
outcome.normal.x = 1;
outcome.safepos.x = _x;
} else if (_local2.x > (_x + _width)) {
outcome.colliding = true;
outcome.normal.x = -1;
outcome.safepos.x = _x + _width;
} else if (_local2.y > (_y + _height)) {
outcome.colliding = true;
outcome.normal.y = 1;
outcome.safepos.y = _y + _height;
} else if (_local2.y < _y) {
outcome.colliding = true;
outcome.normal.y = 1;
outcome.safepos.y = _y;
} else {
outcome.colliding = false;
}
return(outcome);
}
}
Symbol 246 MovieClip [__Packages.PlayGame] Frame 0
class PlayGame extends MovieClip
{
var _alpha, _parent;
function PlayGame () {
super();
trace("playgame");
_alpha = 0;
_parent.stop();
_root.stop();
}
function onRollOver() {
_parent.gotoAndStop(2);
}
function onRollOut() {
_parent.gotoAndStop(1);
}
function onPress() {
_parent.gotoAndStop(3);
}
function onRelease() {
_root.play();
}
function onReleaseOutside() {
_parent.gotoAndStop(1);
}
}
Symbol 247 MovieClip [__Packages.Smoke] Frame 0
class Smoke extends MovieClip
{
var _alpha, _y, _xscale, _yscale, speed, counter, liveInt, removeMovieClip;
function Smoke (inThis) {
super();
_alpha = 90;
var _local3 = setInterval(step, 50 * Math.random(), this);
_y = (_y - 10) + (20 * Math.random());
_xscale = 500 * Math.random();
_yscale = _xscale;
speed = 4 * Math.random();
counter = 0;
}
function step(inThis) {
this=inThis;//parameter overwritten
counter++;
_y = _y - speed;
_alpha--;
_xscale--;
_yscale--;
if (counter > 100) {
clearInterval(liveInt);
removeMovieClip();
}
}
}
Symbol 248 MovieClip [__Packages.Mushroom] Frame 0
class Mushroom extends MovieClip
{
var pinball, pos, _x, _y, normal, mag, outcome, _width;
function Mushroom () {
super();
pinball = _root.pinball;
pos = new Vector(_x, _y);
normal = new Vector();
mag = 0.002;
pinball.addCollisionSet(this);
_global.editmachine.Subscribe(this);
outcome = new Object();
}
function detectCol(body) {
pos.x = _x;
pos.y = _y;
var _local2 = body.pos.Subtract(pos);
if (_local2.Length() < (_width / 2)) {
normal = _local2.Normalize();
outcome.colliding = true;
outcome.normal = normal;
outcome.safepos = pos.Add(_local2.Multiply(1.01));
return(outcome);
}
outcome.colliding = false;
return(outcome);
}
}
Symbol 249 MovieClip [__Packages.Magnet] Frame 0
class Magnet extends Mushroom
{
var stop, switchedOn, magnet_snd, play, gotoAndStop, pinball, radius, pos;
function Magnet () {
super();
stop();
switchedOn = false;
_global.myEvents.Subscribe(this, "onSwitch");
magnet_snd = new Sound(this);
magnet_snd.attachSound("magnetsound_id");
}
function onSwitch(ev) {
if (ev.type == "switchon") {
play();
switchedOn = true;
magnet_snd.start(0, 10);
} else if (ev.type == "switchoff") {
gotoAndStop(1);
switchedOn = false;
magnet_snd.stop();
}
}
function detectCol(body) {
if (pinball.myBall.Armed && (switchedOn)) {
radius = body.pos.Subtract(pos);
pinball.addImpulse(radius.Normalize().Multiply(-0.025));
}
return(super.detectCol(body));
}
}
Symbol 250 MovieClip [__Packages.Box] Frame 0
class Box extends MovieClip
{
var pinball, normal, mag, outcome, left, _x, right, _width, top, _y, bottom, _height, hitTest, dist, side;
function Box (a, b) {
super();
pinball = _root.pinball;
normal = new Vector();
mag = 0.002;
pinball.addCollisionSet(this);
_global.editmachine.Subscribe(this);
outcome = new Object();
left = _x;
right = _x + _width;
top = _y;
bottom = _y + _height;
}
function detectCol(body) {
var _local2 = body.pos;
if (hitTest(_local2.x, _local2.y, false)) {
dist = Math.abs(_local2.y - top);
normal.x = 0;
normal.y = -1;
side = "top";
if (Math.abs(_local2.x - left) < dist) {
dist = Math.abs(_local2.x - left);
normal.x = -1;
normal.y = 0;
side = "left";
}
if (Math.abs(right - _local2.x) < dist) {
dist = Math.abs(right - _local2.x);
normal.x = 1;
normal.y = 0;
side = "right";
}
if (Math.abs(bottom - _local2.y) < dist) {
dist = Math.abs(bottom - _local2.y);
normal.x = 0;
normal.y = 1;
side = "bottom";
}
outcome.colliding = true;
outcome.safepos = _local2;
if (side == "top") {
outcome.safepos.y = top;
} else if (side == "bottom") {
outcome.safepos.y = bottom;
} else if (side == "left") {
outcome.safepos.x = left;
} else if (side == "right") {
outcome.safepos.x = right;
}
} else {
outcome.colliding = false;
}
outcome.normal = normal;
return(outcome);
}
function upDatePosition() {
left = _x;
right = _x + _width;
top = _y;
bottom = _y + _height;
}
}
Symbol 251 MovieClip [__Packages.WeakBox] Frame 0
class WeakBox extends Box
{
var _x, _y, removeInt, _alpha;
function WeakBox () {
super();
}
function detectCol(body) {
var _local4 = super.detectCol(body);
if (_local4.colliding) {
new Explosion(_x, _y, true);
removeInt = setInterval(removeMe, 20, this);
_global.Game.addInterval(removeInt);
super.upDatePosition();
}
return(super.detectCol(body));
}
function removeMe(inThis) {
this=inThis;//parameter overwritten
_alpha = _alpha - 4;
if (_alpha < 0) {
_x = 1000;
clearInterval(removeInt);
}
}
}
Symbol 252 MovieClip [__Packages.MovingBox] Frame 0
class MovingBox extends Box
{
var counter, amp, phase, turns, moving, oldPos, _x, _y, moveInt, angle;
function MovingBox () {
super();
counter = 0;
amp = 50;
phase = 0.05;
turns = 4;
moving = false;
_global.myEvents.Subscribe(this, "onHandleEvent");
}
function onHandleEvent(ev) {
if ((!moving) && (ev.type == "switchon")) {
oldPos = new Vector(_x, _y);
moving = true;
moveInt = setInterval(moveMe, 30, this);
_global.Game.addInterval(moveInt);
super.upDatePosition();
} else if (ev.type == "switchoff") {
_x = oldPos.x;
_y = oldPos.y;
moving = false;
clearInterval(moveInt);
counter = 0;
}
}
function moveMe(inThis) {
this=inThis;//parameter overwritten
counter++;
angle = phase * counter;
_y = oldPos.y + (amp * Math.sin(angle));
super.upDatePosition();
}
}
Symbol 253 MovieClip [__Packages.Switch] Frame 0
class Switch extends Box
{
var stop, isOff, switch_snd, switch_int, gotoAndStop;
function Switch () {
super();
stop();
isOff = true;
switch_snd = new Sound(this);
switch_snd.attachSound("switchsound_id");
}
function detectCol(body) {
var _local4 = super.detectCol(body);
if (_local4.colliding and isOff) {
switchOn();
switch_int = setInterval(switchOff, 8000, this);
_global.Game.addInterval(switch_int);
}
return(super.detectCol(body));
}
function switchOn() {
isOff = false;
_global.myEvents.Fire({type:"switchon"});
gotoAndStop(2);
super.upDatePosition();
switch_snd.start(0, 1);
}
function switchOff(inThis) {
this=inThis;//parameter overwritten
isOff = true;
clearInterval(switch_int);
_global.myEvents.Fire({type:"switchoff"});
gotoAndStop(1);
super.upDatePosition();
}
}
Symbol 254 MovieClip [__Packages.MovingTarget] Frame 0
class MovingTarget extends Target
{
var impulsInt, pos, vel, impulse, drag, _width, _height, _x, _y;
function MovingTarget () {
super();
impulsInt = setInterval(addImpulse, 2000, this);
_global.Game.addInterval(impulsInt);
pos = new Vector(250, 175);
vel = new Vector(0, 0);
impulse = new Vector();
drag = 0.95;
}
function addImpulse(inThis) {
this=inThis;//parameter overwritten
var _local2 = new Vector(-10 + (20 * Math.random()), -10 + (20 * Math.random()));
impulse = _local2.Normalize().Multiply(10);
vel = vel.Add(impulse);
}
function onEnterFrame() {
super.onEnterFrame();
if ((pos.x + vel.x) > (500 - _width)) {
vel.x = -vel.x;
} else if ((pos.x + vel.x) < 0) {
vel.x = -vel.x;
}
if ((pos.y + vel.y) > (350 - _height)) {
vel.y = -vel.y;
} else if ((pos.y + vel.y) < 0) {
vel.y = -vel.y;
}
vel = vel.Multiply(drag);
pos = pos.Add(vel);
_x = pos.x;
_y = pos.y;
}
}
Symbol 255 MovieClip [__Packages.Gate] Frame 0
class Gate extends Box
{
var closed, wait_int, oldX, _x;
function Gate () {
super();
closed = true;
_global.myEvents.Subscribe(this, "onEvent");
wait_int = setInterval(Hide, 20, this);
_global.Game.addInterval(wait_int);
}
function Hide(inThis) {
this=inThis;//parameter overwritten
oldX = _x;
_x = -100;
clearInterval(wait_int);
}
function onEvent(ev) {
if (_global.edit) {
return(undefined);
}
if (closed && (ev.type == "switchon")) {
closed = false;
_x = oldX;
super.upDatePosition();
} else if (ev.type == "switchoff") {
closed = true;
_x = -100;
super.upDatePosition();
}
}
function closeMe(inThis) {
this=inThis;//parameter overwritten
}
}
Symbol 256 MovieClip [__Packages.MoreGames] Frame 0
class MoreGames extends MovieClip
{
var _alpha, _parent, getURL;
function MoreGames () {
super();
_alpha = 0;
_parent.stop();
}
function onRollOver() {
_parent.gotoAndStop(2);
}
function onRollOut() {
_parent.gotoAndStop(1);
}
function onPress() {
getURL("http://www.agame.com");
}
}
Symbol 257 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var pinball, ballIcons, Level, allIntervals, nrTargets, extraBalls, targetsList, click_snd, song_snd, nextlevel_snd, gameTime, Levels, lvlbackground, background_id, maxBalls, levelname, nrBalls, _visible;
function Game () {
super();
_global.Game = this;
_global.game = this;
new LeanEvent();
pinball = _global.pinball;
ballIcons = new Array();
Level = 0;
loadXML();
startMusic();
allIntervals = new Array();
nrTargets = 0;
extraBalls = 0;
targetsList = new Array();
_global.gamePaused = false;
click_snd = new Sound(this);
song_snd = new Sound(this);
click_snd.attachSound("click_id");
song_snd.attachSound("song_id");
nextlevel_snd = new Sound(this);
nextlevel_snd.attachSound("nextlevelsound_id");
new Editor(this);
gameTime = getTimer();
}
function checkDomain() {
}
function internalXML() {
var _local1 = new XML("<game name=\"Gunner0.5\"><level name=\"27 levels to go\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"239\" y=\"254\"/><item id=\"gun_id\" x=\"210\" y=\"25\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"bigmetal_id\" x=\"169\" y=\"137\"/><item id=\"magnet_id\" x=\"92\" y=\"347\"/><item id=\"magnet_id\" x=\"409\" y=\"348\"/></level><level name=\"upstairs\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"240\" y=\"76\"/><item id=\"gun_id\" x=\"212\" y=\"236\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"magnet_id\" x=\"436\" y=\"247\"/><item id=\"heavyframe_id\" x=\"166\" y=\"171\"/></level><level name=\"thin maze\" background=\"hangar_id\" balls=\"4\"><item id=\"target_id\" x=\"52\" y=\"251\"/><item id=\"gun_id\" x=\"41\" y=\"27\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"230\" y=\"229\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"gate_id\" x=\"-100\" y=\"153\"/><item id=\"heavyframe_id\" x=\"0\" y=\"185\"/><item id=\"heavyframe_id\" x=\"0\" y=\"140\"/><item id=\"heavyframevert_id\" x=\"432\" y=\"159\"/><item id=\"heavyframevert_id\" x=\"153\" y=\"140\"/><item id=\"heavyframe_id\" x=\"152\" y=\"292\"/><item id=\"heavyframe_id\" x=\"279\" y=\"159\"/><item id=\"metalcrate_id\" x=\"101\" y=\"209\"/></level><level name=\"port\" background=\"window_id\" balls=\"4\"><item id=\"target_id\" x=\"454\" y=\"71\"/><item id=\"gun_id\" x=\"40\" y=\"86\"/><item id=\"crate_id\" x=\"202\" y=\"0\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"bigmetal_id\" x=\"-2\" y=\"197\"/><item id=\"bigmetal_id\" x=\"201\" y=\"54\"/><item id=\"heavyframe_id\" x=\"425\" y=\"165\"/><item id=\"crate_id\" x=\"1000\" y=\"0\"/></level><level name=\"narrow gate\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"442\" y=\"151\"/><item id=\"gun_id\" x=\"60\" y=\"235\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"346\" y=\"245\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"gate_id\" x=\"352\" y=\"153\"/><item id=\"heavyframe_id\" x=\"143\" y=\"127\"/><item id=\"heavyframe_id\" x=\"189\" y=\"195\"/><item id=\"switch_id\" x=\"294\" y=\"101\"/><item id=\"bigmetal_id\" x=\"346\" y=\"0\"/><item id=\"metalcrate_id\" x=\"346\" y=\"194\"/></level><level name=\"bounce off gate\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"360\" y=\"250\"/><item id=\"gun_id\" x=\"41\" y=\"129\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"287\" y=\"198\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"gate_id\" x=\"289\" y=\"151\"/><item id=\"heavyframevert_id\" x=\"439\" y=\"198\"/><item id=\"heavyframevert_id\" x=\"219\" y=\"199\"/><item id=\"heavyframe_id\" x=\"287\" y=\"125\"/><item id=\"openframe_id\" x=\"-1\" y=\"241\"/><item id=\"switch_id\" x=\"386\" y=\"73\"/></level><level name=\"double boss\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"360\" y=\"250\"/><item id=\"target_id\" x=\"365\" y=\"31\"/><item id=\"gun_id\" x=\"40\" y=\"82\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"241\" y=\"196\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"heavyframevert_id\" x=\"220\" y=\"1\"/><item id=\"heavyframevert_id\" x=\"219\" y=\"196\"/><item id=\"heavyframe_id\" x=\"244\" y=\"128\"/><item id=\"openframe_id\" x=\"-1\" y=\"196\"/><item id=\"switch_id\" x=\"261\" y=\"297\"/><item id=\"magnetOn_id\" x=\"294\" y=\"76\"/></level><level name=\"stack of crates\" background=\"window_id\" balls=\"2\"><item id=\"target_id\" x=\"417\" y=\"181\"/><item id=\"gun_id\" x=\"42\" y=\"86\"/><item id=\"crate_id\" x=\"1000\" y=\"298\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"bigmetal_id\" x=\"-1\" y=\"197\"/><item id=\"bigmetal_id\" x=\"303\" y=\"276\"/><item id=\"smallmetal_id\" x=\"335\" y=\"118\"/><item id=\"smallmetal_id\" x=\"333\" y=\"62\"/><item id=\"smallmetal_id\" x=\"335\" y=\"226\"/><item id=\"smallmetal_id\" x=\"335\" y=\"169\"/><item id=\"crate_id\" x=\"305\" y=\"168\"/><item id=\"crate_id\" x=\"1000\" y=\"113\"/><item id=\"crate_id\" x=\"1000\" y=\"139\"/><item id=\"crate_id\" x=\"305\" y=\"223\"/><item id=\"crate_id\" x=\"1000\" y=\"57\"/><item id=\"crate_id\" x=\"305\" y=\"2\"/><item id=\"crate_id\" x=\"305\" y=\"112\"/><item id=\"crate_id\" x=\"305\" y=\"56\"/></level><level name=\"switchrow\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"417\" y=\"103\"/><item id=\"gun_id\" x=\"60\" y=\"235\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"switch_id\" x=\"192\" y=\"145\"/><item id=\"switch_id\" x=\"294\" y=\"146\"/><item id=\"switch_id\" x=\"243\" y=\"145\"/><item id=\"bigmetal_id\" x=\"194\" y=\"-85\"/><item id=\"bigmetal_id\" x=\"346\" y=\"196\"/><item id=\"magnetOn_id\" x=\"130\" y=\"104\"/></level><level name=\"at the gate\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"445\" y=\"140\"/><item id=\"gun_id\" x=\"60\" y=\"235\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"349\" y=\"235\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"gate_id\" x=\"357\" y=\"137\"/><item id=\"switch_id\" x=\"298\" y=\"163\"/><item id=\"metalcrate_id\" x=\"349\" y=\"185\"/><item id=\"metalcrate_id\" x=\"349\" y=\"89\"/><item id=\"heavyframe_id\" x=\"349\" y=\"66\"/><item id=\"heavyframe_id\" x=\"198\" y=\"115\"/></level><level name=\"the lost level\" background=\"hangar_id\" balls=\"2\"><item id=\"target_id\" x=\"441\" y=\"251\"/><item id=\"gun_id\" x=\"134\" y=\"39\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"gate_id\" x=\"354\" y=\"299\"/><item id=\"switch_id\" x=\"348\" y=\"247\"/><item id=\"metalcrate_id\" x=\"348\" y=\"198\"/><item id=\"metalcrate_id\" x=\"353\" y=\"102\"/><item id=\"metalcrate_id\" x=\"398\" y=\"76\"/><item id=\"metalcrate_id\" x=\"93\" y=\"150\"/><item id=\"metalcrate_id\" x=\"142\" y=\"150\"/><item id=\"metalcrate_id\" x=\"192\" y=\"150\"/><item id=\"metalcrate_id\" x=\"224\" y=\"298\"/><item id=\"metalcrate_id\" x=\"341\" y=\"150\"/><item id=\"metalcrate_id\" x=\"213\" y=\"199\"/><item id=\"metalcrate_id\" x=\"233\" y=\"248\"/><item id=\"metalcrate_id\" x=\"446\" y=\"88\"/></level><level name=\"hidden switch\" background=\"hangar_id\" balls=\"3\"><item id=\"target_id\" x=\"369\" y=\"96\"/><item id=\"gun_id\" x=\"65\" y=\"236\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"magnetOn_id\" x=\"232\" y=\"140\"/><item id=\"openframe_id\" x=\"151\" y=\"64\"/><item id=\"switch_id\" x=\"445\" y=\"296\"/><item id=\"openframe_id\" x=\"-1\" y=\"64\"/><item id=\"crate_id\" x=\"1000\" y=\"246\"/><item id=\"crate_id\" x=\"1000\" y=\"246\"/><item id=\"crate_id\" x=\"1000\" y=\"296\"/><item id=\"crate_id\" x=\"398\" y=\"249\"/><item id=\"crate_id\" x=\"446\" y=\"246\"/><item id=\"crate_id\" x=\"396\" y=\"296\"/></level><level name=\"simple magnet\" background=\"hangar_id\" balls=\"3\"><item id=\"target_id\" x=\"420\" y=\"43\"/><item id=\"gun_id\" x=\"113\" y=\"236\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"magnetOn_id\" x=\"331\" y=\"51\"/><item id=\"openframe_id\" x=\"347\" y=\"134\"/><item id=\"switch_id\" x=\"347\" y=\"291\"/><item id=\"openframe_id\" x=\"124\" y=\"102\"/></level><level name=\"sliding block\" background=\"wall_id\" balls=\"3\"><item id=\"target_id\" x=\"444\" y=\"252\"/><item id=\"gun_id\" x=\"56\" y=\"234\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"346\" y=\"174\"/><item id=\"movingbox_id\" x=\"346\" y=\"247\"/><item id=\"switch_id\" x=\"345\" y=\"123\"/><item id=\"metalcrate_id\" x=\"346\" y=\"197\"/><item id=\"metalcrate_id\" x=\"346\" y=\"297\"/></level><level name=\"stuck in the corner\" background=\"hangar_id\" balls=\"4\"><item id=\"target_id\" x=\"70\" y=\"251\"/><item id=\"gun_id\" x=\"68\" y=\"46\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"magnet_id\" x=\"336\" y=\"79\"/><item id=\"bigmetal_id\" x=\"150\" y=\"159\"/><item id=\"metalcrate_id\" x=\"-1\" y=\"159\"/><item id=\"metalcrate_id\" x=\"99\" y=\"159\"/><item id=\"metalcrate_id\" x=\"49\" y=\"159\"/><item id=\"magnet_id\" x=\"436\" y=\"312\"/></level><level name=\"mushrooms\" background=\"hangar_id\" balls=\"7\"><item id=\"target_id\" x=\"194\" y=\"230\"/><item id=\"gun_id\" x=\"50\" y=\"28\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"-5\" y=\"141\"/><item id=\"magnet_id\" x=\"448\" y=\"293\"/><item id=\"magnet_id\" x=\"352\" y=\"264\"/><item id=\"magnet_id\" x=\"190\" y=\"154\"/><item id=\"magnet_id\" x=\"292\" y=\"177\"/><item id=\"heavyframe_id\" x=\"125\" y=\"324\"/></level><level name=\"bounce room\" background=\"wall_id\" balls=\"4\"><item id=\"target_id\" x=\"431\" y=\"97\"/><item id=\"gun_id\" x=\"41\" y=\"84\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"bigmetal_id\" x=\"198\" y=\"1\"/><item id=\"magnet_id\" x=\"254\" y=\"297\"/><item id=\"heavyframe_id\" x=\"380\" y=\"191\"/><item id=\"crate_id\" x=\"1000\" y=\"226\"/><item id=\"bigmetal_id\" x=\"0\" y=\"195\"/></level><level name=\"laboratory\" background=\"lab_id\" balls=\"4\"><item id=\"target_id\" x=\"385\" y=\"251\"/><item id=\"gun_id\" x=\"57\" y=\"235\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"crate_id\" x=\"1000\" y=\"14182\"/><item id=\"bigmetal_id\" x=\"176\" y=\"234\"/><item id=\"bigmetal_id\" x=\"176\" y=\"83\"/><item id=\"crate_id\" x=\"1000\" y=\"-2\"/><item id=\"heavyframe_id\" x=\"108\" y=\"1\"/></level><level name=\"drone uno\" background=\"hangar_id\" balls=\"2\"><item id=\"drone_id\" x=\"355.5\" y=\"86.15\"/><item id=\"gun_id\" x=\"41\" y=\"48\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"metalcrate_id\" x=\"-1\" y=\"159\"/><item id=\"metalcrate_id\" x=\"99\" y=\"159\"/><item id=\"metalcrate_id\" x=\"49\" y=\"159\"/></level><level name=\"drone tri\" background=\"hangar_id\" balls=\"4\"><item id=\"drone_id\" x=\"414.7\" y=\"150.3\"/><item id=\"drone_id\" x=\"281.15\" y=\"179.8\"/><item id=\"drone_id\" x=\"349.3\" y=\"225.1\"/><item id=\"gun_id\" x=\"41\" y=\"47\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"metalcrate_id\" x=\"-1\" y=\"159\"/><item id=\"metalcrate_id\" x=\"99\" y=\"159\"/><item id=\"metalcrate_id\" x=\"49\" y=\"159\"/></level><level name=\"a drone\" background=\"window_id\" balls=\"3\"><item id=\"drone_id\" x=\"35.15\" y=\"163.55\"/><item id=\"gun_id\" x=\"83\" y=\"235\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"metalcrate_id\" x=\"346\" y=\"197\"/><item id=\"metalcrate_id\" x=\"346\" y=\"297\"/><item id=\"metalcrate_id\" x=\"72\" y=\"19\"/><item id=\"metalcrate_id\" x=\"447\" y=\"128\"/><item id=\"metalcrate_id\" x=\"359\" y=\"30\"/><item id=\"metalcrate_id\" x=\"226\" y=\"102\"/><item id=\"metalcrate_id\" x=\"43\" y=\"140\"/></level><level name=\"3 drones\" background=\"window_id\" balls=\"3\"><item id=\"drone_id\" x=\"35.15\" y=\"163.55\"/><item id=\"drone_id\" x=\"35.15\" y=\"163.55\"/><item id=\"drone_id\" x=\"35.15\" y=\"163.55\"/><item id=\"gun_id\" x=\"83\" y=\"235\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"metalcrate_id\" x=\"346\" y=\"197\"/><item id=\"metalcrate_id\" x=\"346\" y=\"297\"/><item id=\"metalcrate_id\" x=\"72\" y=\"19\"/><item id=\"metalcrate_id\" x=\"447\" y=\"128\"/><item id=\"metalcrate_id\" x=\"359\" y=\"30\"/><item id=\"metalcrate_id\" x=\"226\" y=\"102\"/><item id=\"metalcrate_id\" x=\"43\" y=\"140\"/></level><level name=\"switchroom\" background=\"window_id\" balls=\"3\"><item id=\"target_id\" x=\"438\" y=\"110\"/><item id=\"gun_id\" x=\"38\" y=\"31\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"switch_id\" x=\"9\" y=\"293\"/><item id=\"magnetOn_id\" x=\"360\" y=\"49\"/><item id=\"bigmetal_id\" x=\"-2\" y=\"134\"/><item id=\"heavyframevert_id\" x=\"276\" y=\"0\"/><item id=\"heavyframevert_id\" x=\"276\" y=\"150\"/><item id=\"heavyframe_id\" x=\"299\" y=\"277\"/></level><level name=\"voltage\" background=\"wall_id\" balls=\"4\"><item id=\"target_id\" x=\"435\" y=\"49\"/><item id=\"gun_id\" x=\"62\" y=\"159\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"21\" y=\"265\"/><item id=\"switch_id\" x=\"225\" y=\"253\"/><item id=\"magnetOn_id\" x=\"287\" y=\"63\"/><item id=\"openframe_id\" x=\"346\" y=\"145\"/><item id=\"metalcrate_id\" x=\"346\" y=\"94\"/></level><level name=\"drone multi\" background=\"hangar_id\" balls=\"6\"><item id=\"drone_id\" x=\"300\" y=\"250\"/><item id=\"drone_id\" x=\"300\" y=\"250\"/><item id=\"drone_id\" x=\"300\" y=\"250\"/><item id=\"drone_id\" x=\"300\" y=\"250\"/><item id=\"drone_id\" x=\"300\" y=\"250\"/><item id=\"drone_id\" x=\"300\" y=\"250\"/><item id=\"gun_id\" x=\"19\" y=\"57\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"metalcrate_id\" x=\"-1\" y=\"159\"/><item id=\"metalcrate_id\" x=\"99\" y=\"159\"/><item id=\"metalcrate_id\" x=\"49\" y=\"159\"/></level><level name=\"double bounce\" background=\"hangar_id\" balls=\"5\"><item id=\"target_id\" x=\"143\" y=\"82\"/><item id=\"gun_id\" x=\"99\" y=\"236\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"crate_id\" x=\"1000\" y=\"295\"/><item id=\"gate_id\" x=\"-100\" y=\"153\"/><item id=\"metalcrate_id\" x=\"199\" y=\"176\"/><item id=\"metalcrate_id\" x=\"149\" y=\"176\"/><item id=\"metalcrate_id\" x=\"99\" y=\"176\"/><item id=\"metalcrate_id\" x=\"-1\" y=\"176\"/><item id=\"metalcrate_id\" x=\"49\" y=\"176\"/><item id=\"metalcrate_id\" x=\"249\" y=\"176\"/><item id=\"switch_id\" x=\"368\" y=\"182\"/><item id=\"magnetOn_id\" x=\"57\" y=\"79\"/><item id=\"magnet_id\" x=\"348\" y=\"295\"/></level><level name=\"double slide\" background=\"lab_id\" balls=\"4\"><item id=\"target_id\" x=\"189\" y=\"250\"/><item id=\"gun_id\" x=\"40\" y=\"18\"/><item id=\"worldbox_id\" x=\"0\" y=\"0\"/><item id=\"heavyframe_id\" x=\"147\" y=\"172\"/><item id=\"movingbox_id\" x=\"247\" y=\"71.35\"/><item id=\"switch_id\" x=\"197\" y=\"121\"/><item id=\"metalcrate_id\" x=\"247\" y=\"22\"/><item id=\"metalcrate_id\" x=\"248\" y=\"121\"/><item id=\"movingbox_id\" x=\"248\" y=\"247.35\"/><item id=\"metalcrate_id\" x=\"248\" y=\"197\"/><item id=\"metalcrate_id\" x=\"248\" y=\"298\"/><item id=\"heavyframe_id\" x=\"-1\" y=\"131\"/><item id=\"metalcrate_id\" x=\"247\" y=\"-23\"/><item id=\"bigmetal_id\" x=\"-2\" y=\"196\"/><item id=\"switch_id\" x=\"445\" y=\"206\"/><item id=\"metalcrate_id\" x=\"147\" y=\"121\"/></level></game>");
return(_local1);
}
function loadXML() {
var _local9 = internalXML();
_local9.ignoreWhite = true;
Levels = new Array();
var _local8 = _local9.firstChild;
var _local6 = 0;
while (_local6 < _local8.childNodes.length) {
var _local3 = _local8.childNodes[_local6];
var _local5 = new Object();
_local5.name = _local3.attributes.name;
_local5.background = _local3.attributes.background;
_local5.balls = _local3.attributes.balls;
var _local7 = new Array();
var _local2 = 0;
while (_local2 < _local3.childNodes.length) {
var _local4 = new Object();
_local4.id = _local3.childNodes[_local2].attributes.id;
_local4.x = _local3.childNodes[_local2].attributes.x;
_local4.y = _local3.childNodes[_local2].attributes.y;
_local7.push(_local4);
_local2++;
}
_local5.map = _local7;
Levels.push(_local5);
_local6++;
}
}
function loadMap(lvl) {
var _local6 = 0;
while (_local6 < pinball.collisionSet.length) {
pinball.collisionSet[_local6].removeMovieClip();
_local6++;
}
_global.gun.removeMovieClip();
for (_local6 in targetsList) {
targetsList[_local6].removeMovieClip();
}
targetsList = new Array();
_global.myEvents.Clear();
_global.myEvents.Subscribe(this, "onEvent");
pinball.collisionSet = new Array();
lvlbackground.removeMovieClip();
lvlbackground = _root.slot.attachMovie(Levels[lvl].background, "background", _root.getNextHighestDepth());
background_id = Levels[lvl].background;
var _local4 = Levels[lvl].map;
_local6 = 0;
while (_local6 < _local4.length) {
var _local5 = _root.attachMovie(_local4[_local6].id, (("mapitem" + _local6) + "-") + _local4[_local6].id, _root.getNextHighestDepth());
_local5.id = _local4[_local6].id;
_local5._x = _local4[_local6].x;
_local5._y = _local4[_local6].y;
new Animation(_local5);
_local6++;
}
maxBalls = Number(Levels[lvl].balls) + Number(extraBalls);
levelname = Levels[lvl].name;
toFront(_global.gun);
for (_local6 in targetsList) {
toFront(targetsList[_local6]);
}
toFront(_root.levelText);
loadIcons();
var _local8 = ((("Lvl " + (Level + 1)) + " \"") + Levels[lvl].name) + "\"";
new Typewriter(_root.levelText.level_txt, _local8);
}
function startMusic() {
song_snd.start(0, 1);
}
function loadIcons() {
nrBalls = maxBalls;
for (var _local5 in ballIcons) {
ballIcons[_local5].removeMovieClip();
}
ballIcons = new Array();
var _local3 = 0;
while (_local3 < maxBalls) {
var _local4 = _root.attachMovie("ballicon_id", "ballicon" + _local3, _root.getNextHighestDepth());
_local4._x = 20 + (20 * _local3);
_local4._y = 20;
ballIcons.push(_local4);
_local3++;
}
}
function onPress() {
nextLevel();
}
function addInterval(interval) {
allIntervals.push(interval);
}
function nextLevel() {
if (_root.cheat.text != "") {
Level = _root.cheat.text - 1;
_root.cheat.text = "";
}
click_snd.start(0, 1);
var _local4 = 0;
while (_local4 < allIntervals.length) {
clearInterval(allIntervals[_local4]);
_local4++;
}
allIntervals = new Array();
nrTargets = 0;
if (Level < Levels.length) {
loadMap(Level);
Level++;
_global.myEvents.Fire({type:"nextlevel"});
} else {
gameTime = Math.round((getTimer() - gameTime) / 1000);
var _local5 = ((("Girl with gun saved the ship, all enemies have been destroyed. It took you " + gameTime) + " secs.") + newline) + "Game over";
new Typewriter(_root.levelText.level_txt, _local5);
}
song_snd.stop();
song_snd.start(0, 0);
if (!_global.edit) {
_visible = false;
}
_global.gamePaused = false;
}
function addTarget(inTarget) {
nrTargets++;
targetsList.push(inTarget);
}
function removeTarget(inTarget) {
nrTargets--;
_global.myEvents.Fire({type:"enemykilled"});
if (nrTargets == 0) {
_global.gamePaused = true;
showSwitch();
if (nrBalls == maxBalls) {
new Typewriter(_root.levelText.level_txt, "one shot extra ball!");
extraBalls++;
}
} else {
nextBall();
}
}
function missedTarget() {
nextBall();
}
function nextBall() {
nrBalls--;
ballIcons[nrBalls]._visible = false;
if (nrBalls == 0) {
_global.gamePaused = true;
Level = 0;
_global.myEvents.Fire({type:"zeroballs"});
}
}
function onEvent(ev) {
if (ev.type == "beamready") {
showSwitch();
}
}
function showSwitch() {
var _local3 = _root.nextlevelswitch;
_local3._visible = true;
toFront(_local3);
new Animation(_local3);
nextlevel_snd.start(0, 1);
var _local4 = _root.moregamesswitch;
_local4._visible = true;
toFront(_local4);
new Animation(_local4);
}
function toFront(obj) {
obj.swapDepths(_root.getNextHighestDepth());
}
}
Symbol 258 MovieClip [__Packages.LeanEvent] Frame 0
class LeanEvent
{
var Listeners;
function LeanEvent () {
_global.myEvents = this;
Listeners = new Array();
}
function Subscribe(obj, handler) {
var _local2 = new Object();
_local2.obj = obj;
_local2.handler = handler;
Listeners.push(_local2);
}
function Clear() {
Listeners = new Array();
}
function Fire(ev) {
var _local2;
_local2 = 0;
while (_local2 < Listeners.length) {
Listeners[_local2].obj[Listeners[_local2].handler](ev);
_local2++;
}
}
}
Symbol 259 MovieClip [__Packages.Editor] Frame 0
class Editor
{
var game;
function Editor (inGame) {
game = inGame;
_global.editor = this;
}
function printLevel() {
_root.debug_txt.text = ((((("\t<level name=\"" + game.levelname) + "\" background=\"") + game.background_id) + "\" balls=\"") + game.maxBalls) + "\">";
var _local5 = 0;
while (_local5 < game.targetsList.length) {
_root.debug_txt.text = ((((((((_root.debug_txt.text + newline) + "\t\t<item id=\"") + game.targetsList[_local5].id) + "\" x=\"") + game.targetsList[_local5]._x) + "\"") + " y=\"") + game.targetsList[_local5]._y) + "\"/>";
_local5++;
}
_root.debug_txt.text = ((((((((_root.debug_txt.text + newline) + "\t\t<item id=\"") + "gun_id") + "\" x=\"") + _global.gun._x) + "\"") + " y=\"") + _global.gun._y) + "\"/>";
_local5 = 0;
while (_local5 < _global.pinball.collisionSet.length) {
var _local4 = _global.pinball.collisionSet[_local5];
_root.debug_txt.text = ((((((((_root.debug_txt.text + newline) + "\t\t<item id=\"") + _local4.id) + "\" x=\"") + _local4._x) + "\"") + " y=\"") + _local4._y) + "\"/>";
_local5++;
}
_root.debug_txt.text = (_root.debug_txt.text + newline) + "\t</level>";
}
}
Symbol 260 MovieClip [__Packages.Animation] Frame 0
class Animation
{
var clip, oldx, oldy, delay_int, update_int;
function Animation (inClip) {
clip = inClip;
if (clip.animating) {
return;
}
clip.animating = true;
oldx = clip._x;
oldy = clip._y;
clip._y = -_height;
delay_int = setInterval(Delay, 1000 * Math.random(), this);
_global.Game.addInterval(delay_int);
}
function Delay(inThis) {
this=inThis;//parameter overwritten
update_int = setInterval(Update, 20, this);
_global.Game.addInterval(update_int);
clearInterval(delay_int);
}
function Update(inThis) {
this=inThis;//parameter overwritten
var _local2 = (clip._y + oldy) / 2;
if (Math.abs(clip._y - _local2) < 1) {
clearInterval(update_int);
clip._y = oldy;
clip.animating = false;
clip.upDatePosition();
} else {
clip._y = _local2;
}
}
}
Symbol 261 MovieClip [__Packages.Typewriter] Frame 0
class Typewriter
{
var type_int, count, msg, field;
function Typewriter (inField, inMsg) {
type_int = setInterval(typeLetter, 40, this);
_global.Game.addInterval(type_int);
count = 0;
msg = inMsg;
field = inField;
field.text = "";
inField._parent.swapDepths(_root.getNextHighestDepth());
}
function typeLetter(inThis) {
this=inThis;//parameter overwritten
field.text = field.text + msg.charAt(count);
count++;
if (count == msg.length) {
clearInterval(type_int);
}
}
}
Symbol 262 MovieClip [__Packages.NextLevel] Frame 0
class NextLevel extends MovieClip
{
var _alpha, _parent;
function NextLevel () {
super();
_alpha = 0;
_parent.stop();
}
function onRollOver() {
_parent.gotoAndStop(2);
}
function onRollOut() {
_parent.gotoAndStop(1);
}
function onPress() {
_parent.gotoAndStop(3);
}
function onRelease() {
_global.Game.nextLevel();
_root.splashall._visible = false;
_parent._visible = false;
_root.moregamesswitch._visible = false;
}
function onReleaseOutside() {
_parent.gotoAndStop(1);
}
}
Symbol 263 MovieClip [__Packages.Edit] Frame 0
class Edit extends MovieClip
{
var pinball, label, Sprites, _url, _alpha;
function Edit () {
super();
pinball = _root.pinball;
_global.editmachine = this;
_global.edit = false;
_global.editButton = this;
_root.debug_txt._visible = false;
label.text = "edit off";
Sprites = new Array();
_global.myEvents.Subscribe(this, "onEvent");
}
function onEvent(ev) {
if (ev.type == "nextlevel") {
clearSprites();
}
}
function clearSprites() {
Sprites = new Array();
}
function onPress() {
if (_global.edit) {
_global.edit = false;
label.text = "edit off";
_root.debug_txt._visible = false;
var _local4 = 0;
while (_local4 < Sprites.length) {
delete Sprites[_local4].onPress;
delete Sprites[_local4].onRelease;
_local4++;
}
} else if (_url.substring(0, 5) == "file:") {
_global.edit = true;
label.text = "edit on";
_root.debug_txt._visible = true;
_global.Game._visible = true;
var _local4 = 0;
while (_local4 < Sprites.length) {
Sprites[_local4].onPress = function () {
Key.addListener(this);
if (Key.isDown(17)) {
this.Delete();
_global.pinball.removeCollisionSet(this);
this.removeMovieClip();
} else {
this.startDrag(false);
}
};
Sprites[_local4].onRelease = function () {
Key.removeListener(this);
this.upDatePosition();
this.stopDrag();
};
_local4++;
}
}
}
function onRollOver() {
_alpha = 50;
}
function onRollOut() {
_alpha = 100;
}
function Subscribe(sprite) {
Sprites.push(sprite);
}
function printLevel() {
var _local5 = _global.game;
_root.debug_txt.text = ((((("\t<level name=\"" + _local5.levelname) + "\" background=\"") + _local5.background_id) + "\" balls=\"") + _local5.maxBalls) + "\">";
var _local4 = 0;
while (_local4 < _local5.targetsList.length) {
_root.debug_txt.text = ((((((((_root.debug_txt.text + newline) + "\t\t<item id=\"") + _local5.targetsList[_local4].id) + "\" x=\"") + _local5.targetsList[_local4]._x) + "\"") + " y=\"") + _local5.targetsList[_local4]._y) + "\"/>";
_local4++;
}
_root.debug_txt.text = ((((((((_root.debug_txt.text + newline) + "\t\t<item id=\"") + "gun_id") + "\" x=\"") + _global.gun._x) + "\"") + " y=\"") + _global.gun._y) + "\"/>";
_local4 = 0;
while (_local4 < _global.pinball.collisionSet.length) {
var _local3 = _global.pinball.collisionSet[_local4];
_root.debug_txt.text = ((((((((_root.debug_txt.text + newline) + "\t\t<item id=\"") + _local3.id) + "\" x=\"") + _local3._x) + "\"") + " y=\"") + _local3._y) + "\"/>";
_local4++;
}
_root.debug_txt.text = (_root.debug_txt.text + newline) + "\t</level>";
}
}
Symbol 264 MovieClip [__Packages.PrintLevel] Frame 0
class PrintLevel extends MovieClip
{
var _alpha;
function PrintLevel () {
super();
}
function onPress() {
_global.editmachine.printLevel();
}
function onRollOver() {
_alpha = 50;
}
function onRollOut() {
_alpha = 100;
}
}
Symbol 265 MovieClip [__Packages.Ball] Frame 0
class Ball extends MovieClip
{
var pinball, game, StartPos, _x, _y, Trail, swapDepths, ballexplode_snd, ExplodeTime_int, _visible;
function Ball () {
super();
pinball = _global.pinball;
game = _root.Game;
_global.ball = this;
StartPos = new Vector(_x, _y);
Trail = new Array();
var _local5 = 0;
while (_local5 < 10) {
Trail.push(_root.attachMovie("balltrail_id", "balltrail" + _local5, _root.getNextHighestDepth()));
Trail[_local5]._alpha = 5 * _local5;
Trail[_local5]._x = -100;
_local5++;
}
swapDepths(_root.getNextHighestDepth());
ballexplode_snd = new Sound(this);
ballexplode_snd.attachSound("ballexplode_id");
}
function onEnterFrame() {
if (Armed) {
var _local2 = 0;
while (_local2 < Trail.length) {
Trail[_local2]._x = Trail[_local2 + 1]._x;
Trail[_local2]._y = Trail[_local2 + 1]._y;
_local2++;
}
Trail[Trail.length - 1]._x = _x;
Trail[Trail.length - 1]._y = _y;
}
}
function Arm() {
clearInterval(ExplodeTime_int);
ExplodeTime_int = setInterval(SelfExplode, 5000, this);
_global.Game.addInterval(ExplodeTime_int);
Armed = true;
_visible = true;
var _local3 = 0;
while (_local3 < Trail.length) {
Trail[_local3]._visible = true;
_local3++;
}
}
function SelfExplode(pThis) {
this=pThis;//parameter overwritten
new Explosion(_x, _y, true);
clearInterval(ExplodeTime_int);
Destroy();
game.missedTarget();
ballexplode_snd.start(0, 1);
}
function Destroy() {
clearInterval(ExplodeTime_int);
Armed = false;
_visible = false;
var _local3 = 0;
while (_local3 < Trail.length) {
Trail[_local3]._visible = false;
_local3++;
}
_global.pinball.Reset();
}
var Armed = false;
}
Symbol 266 MovieClip [__Packages.URLLogo] Frame 0
class URLLogo extends MovieClip
{
var getURL, _alpha;
function URLLogo () {
super();
}
function onRelease() {
getURL("http://www.girlwithgun.com", "_new");
}
function onRollOver() {
_alpha = 100;
}
function onRollOut() {
}
}
Symbol 267 MovieClip [__Packages.Pinball] Frame 0
class Pinball extends MovieClip
{
var myBall, pos, oldpos, vel, normal, gravity, drag, elasticity, F, oldtime, posDebug, pixel, collisionSet;
function Pinball () {
super();
_root.stop();
_root.pinball = this;
_global.pinball = this;
myBall = _root.Ball_mc;
pos = new Vector(Math.round(myBall._x), Math.round(myBall._y));
oldpos = new Vector();
oldpos = pos;
vel = new Vector();
normal = new Vector();
gravity = new Vector(0, 0.0007);
drag = 0.0001;
elasticity = 1.85;
F = new Vector();
oldtime = getTimer();
setInterval(runSim, 30, this);
posDebug = new debugLine(16711935, 100, 10000);
pixel = new Vector(0, 1);
collisionSet = new Array();
myBall.swapDepths(_root.getNextHighestDepth());
}
function Reset() {
readyForFrameLoop = false;
pos.x = 10;
pos.y = 10;
vel.x = 0;
vel.y = 0;
oldtime = getTimer();
myBall._x = pos.x;
myBall._y = pos.y;
}
function runSim(inThis) {
this=inThis;//parameter overwritten
if (!readyForFrameLoop) {
return(undefined);
}
var _local3;
var _local5;
var _local4;
_local3 = getTimer() - oldtime;
oldtime = getTimer();
steps = 4;
var _local2 = 0;
while (_local2 < steps) {
stepTime(_local3 / steps);
_local2++;
}
myBall._x = pos.x;
myBall._y = pos.y;
}
function stepTime(dt) {
F.x = 0;
F.y = 0;
if (checkCollision()) {
F = F.Add(gravity);
F = F.Add(normal.Multiply(-gravity.Dot(normal)));
vel = vel.Add(normal.Multiply((-elasticity) * vel.Dot(normal)));
} else {
F = F.Add(gravity);
vel = vel.Add(vel.Multiply((-dt) * drag));
}
vel = vel.Add(F.Multiply(dt));
pos = pos.Add(vel.Multiply(dt));
}
function addImpulse(v) {
vel = vel.Add(v);
}
function addCollisionSet(body) {
collisionSet.push(body);
}
function removeCollisionSet(body) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < collisionSet.length) {
if (body != collisionSet[_local2]) {
_local3.push(collisionSet[_local2]);
}
_local2++;
}
collisionSet = _local3;
}
function checkCollision() {
var _local2 = 0;
while (_local2 < collisionSet.length) {
var _local3 = collisionSet[_local2].detectCol(this);
if (_local3.colliding) {
normal = _local3.normal;
pos = _local3.safepos;
return(true);
}
_local2++;
}
}
var readyForFrameLoop = false;
var steps = 4;
var newsteps = 1;
}
Symbol 268 MovieClip [__Packages.debugLine] Frame 0
class debugLine extends MovieClip
{
var canvas, color, alpha, firsttime, oldPos;
function debugLine (inColor, inAlpha, clearDelay) {
super();
canvas = _root.createEmptyMovieClip("canvas_asdf", _root.getNextHighestDepth() + 239);
color = inColor;
alpha = inAlpha;
firsttime = true;
oldPos = new Vector(0, 0);
setInterval(clearMe, clearDelay, this);
}
function Draw(pos, dest, mult) {
canvas.moveTo(pos.x, pos.y);
canvas.lineStyle(1, color, alpha);
canvas.lineTo(pos.x + (mult * dest.x), pos.y + (mult * dest.y));
}
function Trail(pos) {
if (firsttime) {
canvas.moveTo(pos.x, pos.y);
oldPos = pos;
firsttime = false;
} else {
canvas.lineStyle(1, color, alpha);
canvas.moveTo(oldPos.x, oldPos.y);
canvas.lineTo(pos.x, pos.y);
oldPos = pos;
}
}
function clearMe(inThis) {
this=inThis;//parameter overwritten
canvas.clear();
}
function Clear() {
canvas.clear();
}
}
Symbol 269 MovieClip [__Packages.TileFactory] Frame 0
class TileFactory extends MovieClip
{
var curTile, TileList, slot, createEmptyMovieClip, preview;
function TileFactory () {
super();
Key.addListener(this);
_global.pinball.collisionSet;
curTile = 0;
TileList = new Array();
TileList.push("metalcrate_id");
TileList.push("crate_id");
TileList.push("heavyframe_id");
TileList.push("switch_id");
TileList.push("magnetOn_id");
TileList.push("worldbox_id");
TileList.push("openframe_id");
TileList.push("magnet_id");
TileList.push("movingbox_id");
TileList.push("bigmetal_id");
TileList.push("heavyframevert_id");
TileList.push("gate_id");
TileList.push("smallmetal_id");
slot = createEmptyMovieClip("slot", _root.getNextHighestDepth());
slot._y = slot._y + 30;
}
function loadTile(id) {
var _local4 = _root.attachMovie(id, "newtile" + Math.random(), _root.getNextHighestDepth());
_local4.id = id;
_local4.onPress = function () {
Key.addListener(this);
if (Key.isDown(17)) {
this.Delete();
_global.pinball.removeCollisionSet(this);
this.removeMovieClip();
} else {
this.startDrag();
}
};
_local4.onRelease = function () {
Key.removeListener(this);
this.upDatePosition();
this.stopDrag();
};
}
function onPress() {
if (_global.edit) {
loadTile(TileList[curTile]);
}
}
function onKeyDown() {
if (_global.edit) {
if (Key.isDown(38)) {
curTile++;
} else if (Key.isDown(40)) {
curTile--;
} else {
return(undefined);
}
if (curTile > TileList.length) {
curTile = 0;
}
preview.removeMovieClip();
preview = slot.attachMovie(TileList[curTile], "previewtile", _root.getNextHighestDepth());
_global.pinball.removeCollisionSet(preview);
}
}
}
Symbol 270 MovieClip [__Packages.Branding] Frame 0
class Branding extends MovieClip
{
var getURL;
function Branding () {
super();
}
function onPress() {
getURL("http://www.agame.com", "_blank");
}
}