Section 1
//Beacon_arrow_37 (cattlepult_fla.Beacon_arrow_37)
package cattlepult_fla {
import flash.display.*;
public dynamic class Beacon_arrow_37 extends MovieClip {
public var beacon:MovieClip;
}
}//package cattlepult_fla
Section 2
//EDITOR_28 (cattlepult_fla.EDITOR_28)
package cattlepult_fla {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class EDITOR_28 extends MovieClip {
public var purgeTarget;
public var zCounter;
public var EDITORGRID;
public var c_title1:ContextMenuItem;
public var levelName:TextField;
public var c_title3:ContextMenuItem;
public var c_title4:ContextMenuItem;
public var shotCount;
public var c_title6:ContextMenuItem;
public var myContextMenu:ContextMenu;
public var brushValue;
public var i;
public var textActiveLevel:TextField;
public var renderState;
public var buildGraphicsArray;
public var purgeCounter;
public var textBrushType:TextField;
public var userName:TextField;
public var item:ContextMenuItem;
public var yPos;
public var ii;
public var saveCode;
public var btn_shots:MovieClip;
public var btn_exit:MovieClip;
public var renderStateCount;
public var saveCodeText:TextField;
public var clone;
public var prompt:MovieClip;
public var startPointCount;
public var c_title:ContextMenuItem;
public var item2:ContextMenuItem;
public var item4:ContextMenuItem;
public var item5:ContextMenuItem;
public var item8:ContextMenuItem;
public var btn_save:MovieClip;
public var zCode;
public var textShotCount:TextField;
public var purgeActive;
public var purgeActivateSwitch;
public var item3:ContextMenuItem;
public var brushType;
public var contextBox:MovieClip;
public var GRIDPOINTS;
public var gridCounter;
public var saveCounter;
public function EDITOR_28(){
addFrameScript(0, frame1);
}
public function Context_StartBlock(_arg1){
brushType = "START";
brushValue = 4;
}
public function prepareName(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:*;
_local4 = "";
_local5 = 0;
while (_local5 < this[_arg1].text.length) {
if ((((((((this[_arg1].text.charAt(_local5) == " ")) || ((this[_arg1].text.charAt(_local5) == ".")))) || ((this[_arg1].text.charAt(_local5) == "-")))) || ((this[_arg1].text.charAt(_local5) == _arg2)))){
_local4 = (_local4 + _arg3);
} else {
_local4 = (_local4 + this[_arg1].text.charAt(_local5));
};
_local5++;
};
this[_arg1].text = _local4;
}
public function func_btn_exit(_arg1){
purgeActive = true;
purgeTarget = "CUSTOM";
}
public function Context_ChinaBlock(_arg1){
brushType = "CHINA";
brushValue = 2;
}
public function Context_EraseBlock(_arg1){
brushType = "ERASE";
brushValue = 0;
}
public function purgeFromMemory(){
var _local1:*;
c_title.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
c_title1.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
c_title4.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
c_title6.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
item.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_GroundBlock);
item4.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_ChinaBlock);
item2.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_BouncerBlock);
item8.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Boost);
item5.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_StartBlock);
item3.removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_EraseBlock);
_local1 = 0;
while (_local1 < myContextMenu.customItems.length) {
myContextMenu.customItems[_local1] = null;
_local1++;
};
btn_save.removeEventListener(MouseEvent.MOUSE_UP, func_btn_save);
btn_exit.removeEventListener(MouseEvent.MOUSE_UP, func_btn_exit);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
MovieClip(parent).gotoAndStop(purgeTarget);
}
public function zCrush(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:*;
zCode = "";
zCounter = 0;
_local4 = 0;
while (_local4 < 226) {
if (saveCode.charAt(_local4) == _arg1){
zCounter++;
if (zCounter == _arg3){
zCode = (zCode + _arg2);
zCounter = 0;
};
} else {
_local5 = 0;
while (_local5 < zCounter) {
zCode = (zCode + _arg1);
_local5++;
};
zCounter = 0;
zCode = (zCode + saveCode.charAt(_local4));
};
_local4++;
};
saveCode = zCode;
}
function frame1(){
stop();
myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
c_title = new ContextMenuItem("-EDITOR-");
c_title.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
myContextMenu.customItems.push(c_title);
c_title4 = new ContextMenuItem("----------");
c_title4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
myContextMenu.customItems.push(c_title4);
c_title1 = new ContextMenuItem("-ITEMS-");
c_title1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
myContextMenu.customItems.push(c_title1);
item = new ContextMenuItem("Ground Tile");
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_GroundBlock);
myContextMenu.customItems.push(item);
item4 = new ContextMenuItem("China Plate");
item4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_ChinaBlock);
myContextMenu.customItems.push(item4);
item2 = new ContextMenuItem("Bouncer");
item2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_BouncerBlock);
myContextMenu.customItems.push(item2);
item8 = new ContextMenuItem("Boost Power");
item8.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Boost);
myContextMenu.customItems.push(item8);
c_title6 = new ContextMenuItem("-----------");
c_title6.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
myContextMenu.customItems.push(c_title6);
c_title3 = new ContextMenuItem("-TOOLS-");
c_title3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_Title);
myContextMenu.customItems.push(c_title3);
item5 = new ContextMenuItem("Start Point");
item5.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_StartBlock);
myContextMenu.customItems.push(item5);
item3 = new ContextMenuItem("Eraser");
item3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Context_EraseBlock);
myContextMenu.customItems.push(item3);
contextBox.contextMenu = myContextMenu;
EDITORGRID = new MovieClip();
EDITORGRID.x = 125;
EDITORGRID.y = 50;
addChild(EDITORGRID);
setChildIndex(contextBox, 22);
GRIDPOINTS = new Array();
gridCounter = 0;
brushType = "ERASE";
brushValue = 0;
yPos = 0;
buildGraphicsArray = new Array("ERASE", "GROUND", "CHINA", "BOUNCER", "START", "MAGPLUS", "MAGMINUS", "BOOST");
saveCode = MovieClip(parent).saveCode;
if (checkCodeIntegrity() == false){
saveCode = "J_Atkinson<@>BackBounce<@>Z01111Z00100301Z100000010000001000200010011110002000210100111000100010130B04072001010011100010201010200000100301010020001020001010002710200001001000012002010000AAZZZZ<@>1<@>15";
};
splitNamesFromCode();
saveCodeText.text = saveCode;
zStretch("A", "1", 5);
zStretch("B", "2", 3);
zStretch("C", "3", 3);
zStretch("X", "Z", 5);
zStretch("Z", "0", 8);
saveCounter = 0;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
btn_save.addEventListener(MouseEvent.MOUSE_UP, func_btn_save);
renderStateCount = 1;
btn_exit.addEventListener(MouseEvent.MOUSE_UP, func_btn_exit);
btn_shots.addEventListener(MouseEvent.MOUSE_UP, func_btn_shots);
renderState = false;
startPointCount = 0;
ii = 0;
while (ii < 15) {
i = 0;
while (i < 15) {
clone = new EDITOR_block();
gridCounter++;
clone.x = (clone.width * i);
clone.y = (clone.height * yPos);
clone.rotation = saveCode.charAt(saveCounter);
saveCounter++;
clone.alpha = 1;
EDITORGRID.addChild(clone);
GRIDPOINTS[gridCounter] = clone;
i++;
};
yPos++;
ii++;
};
zCode = "";
zCounter = 0;
purgeActive = false;
purgeCounter = 0;
purgeTarget = "";
purgeActivateSwitch = false;
}
public function Context_GroundBlock(_arg1){
brushType = "GROUND";
brushValue = 1;
}
public function Context_BouncerBlock(_arg1){
brushType = "BOUNCER";
brushValue = 3;
}
public function func_btn_save(_arg1){
renderState = true;
renderStateCount = 0;
}
public function renderCode(){
var _local1:*;
prepareName("levelName", " ", "_");
prepareName("userName", " ", "_");
saveCode = "";
_local1 = 1;
while (_local1 < (gridCounter + 1)) {
saveCode = (saveCode + GRIDPOINTS[_local1].rotation);
_local1++;
};
zCrush("0", "Z", 8);
zCrush("Z", "X", 5);
zCrush("1", "A", 5);
zCrush("2", "B", 3);
zCrush("3", "C", 3);
saveCodeText.text = saveCode;
addNamesToCode();
MovieClip(parent).saveCode = saveCode;
MovieClip(parent).updateLevelCode(MovieClip(parent).activeLevel, saveCode);
}
public function onEnterFrame(_arg1){
var _local2:*;
if ((((purgeActivateSwitch == true)) && ((purgeActive == false)))){
purgeActive = true;
purgeTarget = "GAME";
} else {
if ((((purgeActive == true)) && ((purgeCounter < 2)))){
purgeCounter++;
} else {
if (purgeActive == true){
_local2 = 1;
while (_local2 < (gridCounter + 1)) {
GRIDPOINTS[_local2] = null;
_local2++;
};
GRIDPOINTS = null;
purgeFromMemory();
};
};
};
textBrushType.text = brushType;
textActiveLevel.text = MovieClip(parent).activeLevel;
textShotCount.text = shotCount;
if ((((renderStateCount == 0)) && ((renderState == false)))){
renderState = true;
renderStateCount++;
} else {
if (renderState == true){
renderCode();
renderState = false;
purgeActivateSwitch = true;
};
};
}
public function Context_Boost(_arg1){
brushType = "BOOST";
brushValue = 7;
}
public function addNamesToCode(){
var _local1:*;
_local1 = "";
_local1 = (_local1 + userName.text);
_local1 = (_local1 + "<@>");
_local1 = (_local1 + levelName.text);
_local1 = (_local1 + "<@>");
_local1 = (_local1 + saveCode);
_local1 = (_local1 + "<@>");
_local1 = (_local1 + shotCount);
saveCode = _local1;
}
public function zStretch(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:*;
var _local6:*;
_local4 = "";
_local5 = 0;
while (_local5 < saveCode.length) {
if (saveCode.charAt(_local5) == _arg1){
_local6 = 0;
while (_local6 < _arg3) {
_local4 = (_local4 + _arg2);
_local6++;
};
} else {
_local4 = (_local4 + saveCode.charAt(_local5));
};
_local5++;
};
saveCode = _local4;
}
public function splitNamesFromCode(){
var _local1:*;
_local1 = saveCode;
_local1 = _local1.split("<@>");
userName.text = _local1[0];
levelName.text = _local1[1];
saveCode = _local1[2];
shotCount = _local1[3];
if ((((shotCount > 0)) && ((shotCount < 6)))){
} else {
shotCount = 3;
};
}
public function func_btn_shots(_arg1){
if (shotCount < 5){
shotCount++;
} else {
shotCount = 1;
};
}
public function Context_Title(_arg1){
}
public function extractCodeName(){
}
public function checkCodeIntegrity(){
if ((((((saveCode.length < 1)) || ((saveCode.length > 266)))) || ((saveCode == "EMPTY_SLOT")))){
return (false);
};
}
public function addCodeName(){
}
}
}//package cattlepult_fla
Section 3
//EDITOR_SAVE_30 (cattlepult_fla.EDITOR_SAVE_30)
package cattlepult_fla {
import flash.display.*;
import flash.text.*;
public dynamic class EDITOR_SAVE_30 extends MovieClip {
public var btn_no:MovieClip;
public var btn_yes:MovieClip;
public var Text_Title:TextField;
}
}//package cattlepult_fla
Section 4
//ENDOFLEVEL_38 (cattlepult_fla.ENDOFLEVEL_38)
package cattlepult_fla {
import flash.display.*;
public dynamic class ENDOFLEVEL_38 extends MovieClip {
public function ENDOFLEVEL_38(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package cattlepult_fla
Section 5
//ENDOFLEVEL_FAIL_41 (cattlepult_fla.ENDOFLEVEL_FAIL_41)
package cattlepult_fla {
import flash.display.*;
public dynamic class ENDOFLEVEL_FAIL_41 extends MovieClip {
public function ENDOFLEVEL_FAIL_41(){
addFrameScript(88, frame89);
}
function frame89(){
MovieClip(parent).gotoAndStop(1);
}
}
}//package cattlepult_fla
Section 6
//ENDOFLEVEL_LOSTLIFE_ANIM_43 (cattlepult_fla.ENDOFLEVEL_LOSTLIFE_ANIM_43)
package cattlepult_fla {
import flash.display.*;
public dynamic class ENDOFLEVEL_LOSTLIFE_ANIM_43 extends MovieClip {
public function ENDOFLEVEL_LOSTLIFE_ANIM_43(){
addFrameScript(78, frame79);
}
function frame79(){
MovieClip(parent).gotoAndStop(1);
}
}
}//package cattlepult_fla
Section 7
//ENDOFLEVEL_SUCCESS_39 (cattlepult_fla.ENDOFLEVEL_SUCCESS_39)
package cattlepult_fla {
import flash.display.*;
public dynamic class ENDOFLEVEL_SUCCESS_39 extends MovieClip {
public function ENDOFLEVEL_SUCCESS_39(){
addFrameScript(92, frame93);
}
function frame93(){
MovieClip(parent).gotoAndStop(1);
}
}
}//package cattlepult_fla
Section 8
//Explosion_sprite_21 (cattlepult_fla.Explosion_sprite_21)
package cattlepult_fla {
import flash.display.*;
public dynamic class Explosion_sprite_21 extends MovieClip {
public function Explosion_sprite_21(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package cattlepult_fla
Section 9
//GAME_ENGINE_31 (cattlepult_fla.GAME_ENGINE_31)
package cattlepult_fla {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class GAME_ENGINE_31 extends MovieClip {
public var buildPosX;
public var buildPosY;
public var purgeTarget;
public var beaconArrow:MovieClip;
public var offsetX;
public var offsetY;
public var levelName;
public var bullPosX;
public var bullPosY;
public var beacon:MovieClip;
public var pausedGame;
public var SHARDS;
public var plateMax;
public var trackerActive;
public var tutorialTimer;
public var launchTop:BUILD_LAUNCHER;
public var offsetBullX;
public var offsetBullY;
public var hudActive;
public var EFFECTS;
public var userName;
public var groundArray;
public var bull:BUILD_BULL;
public var locY;
public var saveCode;
public var locX;
public var tracker:MovieClip;
public var maxFuel;
public var buildCountY;
public var buildCountX;
public var clone;
public var GROUND;
public var purgeActive;
public var plateCount;
public var levelID;
public var fuel;
public var bullCount;
public var groundCount;
public var purgeSwitch;
public var lineThickness;
public var bullActive;
public function GAME_ENGINE_31(){
addFrameScript(0, frame1);
}
public function MouseUp(_arg1){
trackerActive = false;
if ((((((bull.gravity == 0)) && ((bullActive == true)))) && ((pythag(bull.x, bull.y, bullPosX, bullPosY) > 20)))){
bullActive = false;
bull.speed = (pythag(bull.x, bull.y, bullPosX, bullPosY) / 2);
bull.gravity = 1;
bull.rotation = Math.round(((Math.atan2((bullPosY - bull.y), (bullPosX - bull.x)) / 3.141593) * 180));
bull.ySpeed = (bull.speed * Math.sin((bull.rotation * 0.01745329)));
bull.xSpeed = (bull.speed * Math.cos((bull.rotation * 0.01745329)));
stage.removeEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
MovieClip(parent).playSound("LAUNCH");
} else {
if (pythag(bull.x, bull.y, bullPosX, bullPosY) <= 20){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
bull.x = bullPosX;
bull.y = bullPosY;
bullActive = false;
};
};
}
public function newShards(_arg1, _arg2, _arg3, _arg4, _arg5){
var _local6:*;
var _local7:*;
MovieClip(parent).playSound("SMASH");
_local6 = 0;
while (_local6 < (_arg3 * 0.3)) {
_local7 = new SHARD();
_local7.x = _arg1;
_local7.y = _arg2;
_local7.scaleX = _arg5;
_local7.scaleY = _arg5;
_local7.rotation = (Math.random() * 360);
SHARDS.addChild(_local7);
_local6++;
};
plateCount++;
if (plateCount == plateMax){
fuel = 2;
};
}
function frame1(){
MovieClip(parent.parent).scaleX = 0.75;
MovieClip(parent.parent).scaleY = 0.75;
MovieClip(parent).HUD.scaleX = (MovieClip(parent).HUD.scaleX + 0.25);
MovieClip(parent).HUD.scaleY = (MovieClip(parent).HUD.scaleY + 0.25);
MovieClip(parent).HUD.x = (MovieClip(parent).HUD.x + 92);
MovieClip(parent).HUD.y = (MovieClip(parent).HUD.y + 110);
MovieClip(parent).tutorial.scaleX = (MovieClip(parent).tutorial.scaleX + 0.25);
MovieClip(parent).tutorial.scaleY = (MovieClip(parent).tutorial.scaleY + 0.25);
MovieClip(parent).tutorial.x = (MovieClip(parent).tutorial.x + 90);
MovieClip(parent).tutorial.y = (MovieClip(parent).tutorial.y - 20);
MovieClip(parent).BG.scaleX = (MovieClip(parent).BG.scaleX + (0.25 + 0.1));
MovieClip(parent).BG.scaleY = (MovieClip(parent).BG.scaleY + (0.25 + 0.1));
MovieClip(parent).BG.y = (MovieClip(parent).BG.y - 10);
MovieClip(parent).EOL.scaleX = (MovieClip(parent).EOL.scaleX + 0.25);
MovieClip(parent).EOL.scaleY = (MovieClip(parent).EOL.scaleY + 0.25);
MovieClip(parent).EOL.x = (MovieClip(parent).EOL.x + 60);
MovieClip(parent).EOL.y = (MovieClip(parent).EOL.y + 50);
MovieClip(parent).HUD.gotoAndStop(2);
tutorialTimer = 400;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
bull.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
MovieClip(parent).BG.addEventListener(MouseEvent.MOUSE_DOWN, beaconPlace);
MovieClip(parent).HUD.hudButton.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_editor);
purgeTarget = "";
bullPosX = bull.x;
bullPosY = bull.y;
lineThickness = 0;
SHARDS = new MovieClip();
addChild(SHARDS);
GROUND = new MovieClip();
addChild(GROUND);
EFFECTS = new MovieClip();
addChild(EFFECTS);
setChildIndex(bull, 7);
offsetX = 0;
offsetY = 0;
plateCount = 0;
plateMax = 0;
buildPosX = 0;
buildPosY = 0;
saveCode = MovieClip(parent).saveCode;
splitNamesFromCode();
zStretch("A", "1", 5);
zStretch("B", "2", 3);
zStretch("C", "3", 3);
zStretch("X", "Z", 5);
zStretch("Z", "0", 8);
groundArray = new Array();
groundCount = 0;
buildCountX = 0;
buildCountY = 0;
buildGround(saveCode);
buildCountX = 0;
buildCountY = 0;
bull.x = launchTop.x;
bull.y = launchTop.y;
x = (x - ((((bull.x - 275) + offsetX) + x) / 1));
y = (y - ((((bull.y - 200) + offsetY) + y) / 1));
offsetBullX = bull.x;
offsetBullY = bull.y;
trackerActive = false;
purgeSwitch = 0;
purgeActive = 0;
maxFuel = 400;
fuel = maxFuel;
beaconArrow.x = bull.x;
beaconArrow.y = bull.y;
hudActive = false;
beacon.visible = false;
bullActive = false;
pausedGame = false;
}
public function onEnterFrame(_arg1){
var _local2:*;
if (tutorialTimer > 0){
tutorialTimer--;
} else {
MovieClip(parent).tutorial.alpha = (MovieClip(parent).tutorial.alpha / 1.1);
};
if (purgeActive != 1){
MovieClip(parent).HUD.textLevelName.text = levelName;
MovieClip(parent).HUD.textUserName.text = userName;
MovieClip(parent).HUD.textBullCount.text = bullCount;
MovieClip(parent).HUD.textPlateCount.text = plateCount;
MovieClip(parent).HUD.textPlateMax.text = plateMax;
} else {
MovieClip(parent).HUD.textLevelName.text = "";
MovieClip(parent).HUD.textUserName.text = "";
MovieClip(parent).HUD.textBullCount.text = "";
MovieClip(parent).HUD.textPlateCount.text = "";
MovieClip(parent).HUD.textPlateMax.text = "";
};
if (beacon.visible == true){
beaconArrow.visible = true;
beaconArrow.rotation = Math.round(((Math.atan2((beacon.y - beaconArrow.y), (beacon.x - beaconArrow.x)) / 3.141593) * 180));
} else {
beaconArrow.visible = false;
};
tracker.x = bull.x;
tracker.y = bull.y;
_local2 = Math.round(((Math.atan2((bullPosY - bull.y), (bullPosX - bull.x)) / 3.141593) * 180));
bull.speed = (pythag(bull.x, bull.y, bullPosX, bullPosY) / 2);
tracker.ySpeed = (bull.speed * Math.sin((_local2 * 0.01745329)));
tracker.xSpeed = (bull.speed * Math.cos((_local2 * 0.01745329)));
EFFECTS.graphics.clear();
if (bull.gravity == 0){
fuel = maxFuel;
lineThickness = pythag(bull.x, bull.y, bullPosX, bullPosY);
if (lineThickness < 40){
lineThickness = 40;
};
EFFECTS.graphics.lineStyle((300 / lineThickness), 10058291, 100);
EFFECTS.graphics.moveTo(bull.x, bull.y);
rotatedXY(launchTop.elastic1.x, launchTop.elastic1.y, launchTop.rotation);
EFFECTS.graphics.lineTo((launchTop.x + locX), (launchTop.y + locY));
EFFECTS.graphics.moveTo(bull.x, bull.y);
rotatedXY(launchTop.elastic2.x, launchTop.elastic2.y, launchTop.rotation);
EFFECTS.graphics.lineTo((launchTop.x + locX), (launchTop.y + locY));
if (bull.scaleX > 0){
bull.rotation = Math.round(((Math.atan2((bullPosY - bull.y), (bullPosX - bull.x)) / 3.141593) * 180));
} else {
bull.rotation = (Math.round(((Math.atan2((bullPosY - bull.y), (bullPosX - bull.x)) / 3.141593) * 180)) + 180);
};
launchTop.rotation = Math.round(((Math.atan2((bullPosY - bull.y), (bullPosX - bull.x)) / 3.141593) * 180));
} else {
fuel--;
if (fuel < 0){
fuel = 0;
};
};
MovieClip(parent).HUD.fuel.scaleX = (((fuel / maxFuel) * 100) / 100);
if (((!((purgeActive == 0))) && ((purgeSwitch == 0)))){
purgeSwitch = 1;
} else {
if (purgeSwitch == 1){
purgeObjects();
purgeSwitch = 2;
};
};
camera();
}
public function MouseDown(_arg1){
if (bull.gravity == 0){
bullActive = true;
offsetX = 0;
offsetY = 0;
bull.speed = 0;
bullPosX = bull.x;
bullPosY = bull.y;
stage.addEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
};
}
public function unlockCurrentLevel(){
if (levelID != "NONE"){
MovieClip(parent).lockDataArray[Number(levelID)] = false;
MovieClip(parent).saveAllLock();
if ((((Number(levelID) == 15)) || ((levelID == "15")))){
MovieClip(parent).medalBoxActive = true;
};
};
}
public function func_btn_editor(_arg1){
MovieClip(parent).musicButtonCode();
MovieClip(parent).musicButtonCode();
if (MovieClip(parent).engineMode == "PREVIEW"){
purgeTarget = "EDITOR";
} else {
purgeTarget = "PREBUILT";
};
purgeActive = 1;
}
public function explosion(_arg1, _arg2, _arg3){
var _local4:*;
_local4 = new EFFECT_EXPLOSION();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = _arg3;
_local4.scaleY = _arg3;
EFFECTS.addChild(_local4);
}
public function beaconPlace(_arg1){
}
public function camera(){
if (bull.gravity == 1){
offsetX = 0;
offsetY = 0;
} else {
if (Key.isDown(Keyboard.RIGHT)){
offsetX = (offsetX + 20);
} else {
if (Key.isDown(Keyboard.LEFT)){
offsetX = (offsetX - 20);
};
};
if (Key.isDown(Keyboard.DOWN)){
offsetY = (offsetY + 20);
} else {
if (Key.isDown(Keyboard.UP)){
offsetY = (offsetY - 20);
};
};
if (Key.isDown(Keyboard.SPACE)){
offsetX = 0;
offsetY = 0;
};
};
x = (x - ((((bull.x - 350) + offsetX) + x) / 5));
y = (y - ((((bull.y - 250) + offsetY) + y) / 5));
}
public function rotatedXY(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local4 = ((6.28 / 360) * _arg3);
_local5 = Math.sin(_local4);
_local6 = Math.cos(_local4);
_local7 = ((_arg1 * _local6) - (_arg2 * _local5));
_local8 = ((_arg1 * _local5) + (_arg2 * _local6));
locX = _local7;
locY = _local8;
}
public function zStretch(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:*;
var _local6:*;
_local4 = "";
_local5 = 0;
while (_local5 < saveCode.length) {
if (saveCode.charAt(_local5) == " "){
_local5++;
};
if (saveCode.charAt(_local5) == _arg1){
_local6 = 0;
while (_local6 < _arg3) {
_local4 = (_local4 + _arg2);
_local6++;
};
} else {
_local4 = (_local4 + saveCode.charAt(_local5));
};
_local5++;
};
saveCode = _local4;
}
public function splitNamesFromCode(){
var _local1:*;
_local1 = saveCode;
_local1 = _local1.split("<@>");
saveCode = _local1[2];
bullCount = _local1[3];
userName = _local1[0];
levelName = _local1[1];
levelID = _local1[4];
if (levelID == undefined){
levelID = "NONE";
} else {
levelID++;
};
MovieClip(parent).tutorial.gotoAndStop(levelID);
if (MovieClip(parent).musicON == true){
if (MovieClip(parent).voiceTemp[levelID] == true){
MovieClip(parent).voiceTemp[levelID] = false;
MovieClip(parent).voiceMC.gotoAndStop(levelID);
};
};
levelID--;
}
public function pythag(_arg1, _arg2, _arg3, _arg4){
var _local5:*;
_local5 = Math.sqrt((((_arg2 - _arg4) * (_arg2 - _arg4)) + ((_arg1 - _arg3) * (_arg1 - _arg3))));
return (_local5);
}
public function buildGround(_arg1){
var _local2:*;
_local2 = 0;
while (_local2 < _arg1.length) {
if (_arg1.charAt(_local2) == "1"){
clone = new BUILD_BLOCK();
clone.x = buildPosX;
clone.y = buildPosY;
GROUND.addChild(clone);
groundArray[_local2] = clone;
groundCount++;
} else {
if (_arg1.charAt(_local2) == "2"){
clone = new BUILD_PLATE();
clone.x = buildPosX;
clone.y = buildPosY;
plateMax++;
addChild(clone);
} else {
if (_arg1.charAt(_local2) == "3"){
clone = new BUILD_BOUNCER();
clone.x = buildPosX;
clone.y = buildPosY;
addChild(clone);
} else {
if (_arg1.charAt(_local2) == "4"){
launchTop.x = (buildPosX + 50);
launchTop.y = (buildPosY + 50);
} else {
if (_arg1.charAt(_local2) == "5"){
clone = new BUILD_MAGPLUS();
clone.x = buildPosX;
clone.y = buildPosY;
addChild(clone);
} else {
if (_arg1.charAt(_local2) == "7"){
clone = new BUILD_BOOSTER();
clone.x = buildPosX;
clone.y = buildPosY;
addChild(clone);
};
};
};
};
};
};
buildPosX = (buildPosX + 100);
if (buildPosX == (15 * 100)){
buildPosX = 0;
buildPosY = (buildPosY + 100);
};
_local2++;
};
}
public function loopPause(){
do {
} while (pausedGame == true);
}
public function purgeObjects(){
var _local1:*;
MovieClip(parent.parent).scaleX = 1;
MovieClip(parent.parent).scaleY = 1;
_local1 = 0;
while (_local1 < groundCount) {
GROUND.removeChildAt(0);
delete groundArray[_local1];
groundArray[_local1] = null;
_local1++;
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
bull.removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, MouseUp);
MovieClip(parent).HUD.hudButton.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_editor);
MovieClip(parent).BG.removeEventListener(MouseEvent.MOUSE_DOWN, beaconPlace);
MovieClip(parent).gotoAndStop(purgeTarget);
}
public function MouseMove(_arg1){
trackerActive = true;
if ((((bull.gravity == 0)) && ((pythag(bull.x, bull.y, bullPosX, bullPosY) < 150)))){
bull.x = (bull.x - ((bull.x - mouseX) / 10));
bull.y = (bull.y - ((bull.y - mouseY) / 10));
bull.x = (bull.x - ((bull.x - bullPosX) / 9));
bull.y = (bull.y - ((bull.y - bullPosY) / 9));
while (pythag(bull.x, bull.y, bullPosX, bullPosY) >= 150) {
bull.x = (bull.x - ((bull.x - bullPosX) / 32));
bull.y = (bull.y - ((bull.y - bullPosY) / 32));
};
if (Math.round((Math.random() * 10)) == 1){
MovieClip(parent).playSound("CRANK");
};
};
}
}
}//package cattlepult_fla
Section 10
//GAME_HOLDER_10 (cattlepult_fla.GAME_HOLDER_10)
package cattlepult_fla {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class GAME_HOLDER_10 extends MovieClip {
public var lockGraphic_lvl2:MovieClip;
public var lockGraphic_lvl3:MovieClip;
public var lockGraphic_lvl6:MovieClip;
public var lockGraphic_lvl7:MovieClip;
public var lockGraphic_lvl1:MovieClip;
public var lockGraphic_lvl4:MovieClip;
public var lockGraphic_lvl5:MovieClip;
public var btn_lvl10:MovieClip;
public var lockGraphic_lvl9:MovieClip;
public var btn_lvl13:MovieClip;
public var activeLevel;
public var lockGraphic_lvl8:MovieClip;
public var btn_lvl14:MovieClip;
public var voiceTemp;
public var btn_lvl11:MovieClip;
public var btn_lvl12:MovieClip;
public var level2Code;
public var lockGraphic_lvl10:MovieClip;
public var lockGraphic_lvl14:MovieClip;
public var BG:MovieClip;
public var voiceMC:MovieClip;
public var lockGraphic_lvl13:MovieClip;
public var lockGraphic_lvl12:MovieClip;
public var btn_lvl1:MovieClip;
public var btn_lvl6:MovieClip;
public var btn_lvl7:MovieClip;
public var btn_lvl8:MovieClip;
public var btn_lvl3:MovieClip;
public var btn_lvl5:MovieClip;
public var btn_lvl0:MovieClip;
public var btn_lvl9:MovieClip;
public var myContextMenu:ContextMenu;
public var btn_lvl2:MovieClip;
public var btn_lvl4:MovieClip;
public var i;
public var tempName;
public var lockGraphic_lvl11:MovieClip;
public var slotNameText_0:TextField;
public var slotNameText_1:TextField;
public var slotNameText_2:TextField;
public var slotNameText_4:TextField;
public var slotNameText_3:TextField;
public var level5Code;
public var level1Code;
public var saveData;
public var musicON;
public var HUD:MovieClip;
public var saveCodeInput:TextField;
public var soundMC:MovieClip;
public var btn_load:MovieClip;
public var EOL:MovieClip;
public var engineMode;
public var saveCode;
public var ii;
public var lockDataSize;
public var levelGlow:MovieClip;
public var importCode:TextField;
public var levelArray;
public var level4Code;
public var medalBox:MovieClip;
public var btn_menu:MovieClip;
public var tutorial:MovieClip;
public var saveDataSize;
public var lockData;
public var medalBoxActive;
public var level3Code;
public var tempUser;
public var slotUserText_0:TextField;
public var slotUserText_1:TextField;
public var slotUserText_2:TextField;
public var slotUserText_4:TextField;
public var btn_pre0:MovieClip;
public var slotUserText_3:TextField;
public var GAME:MovieClip;
public var lockDataArray;
public function GAME_HOLDER_10(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function func_btn_lvl_7(_arg1){
loadLevel(levelArray[7]);
}
public function func_btn_lvl_8(_arg1){
loadLevel(levelArray[8]);
}
public function func_btn_lvl_6(_arg1){
loadLevel(levelArray[6]);
}
public function func_btn_load(_arg1){
if (((!((saveCodeInput.text == ""))) && (!((saveCodeInput.text == "CLICK A SLOT TO LOAD ITS LEVEL CODE. RIGHT CLICK THIS BOX AND COPY THE TEXT TO SHARE YOUR LEVEL WITH OTHERS!"))))){
saveCode = saveCodeInput.text;
engineMode = "PREVIEW";
purgeListenersCustom();
gotoAndStop("EDITOR");
};
}
public function saveAllLock(){
var _local1:*;
_local1 = 0;
while (_local1 < lockDataSize) {
lockData.data[(("level" + _local1) + "Lock")] = lockDataArray[_local1];
_local1++;
};
lockData.flush();
}
public function playSound(_arg1){
if (musicON == true){
soundMC.gotoAndStop(_arg1);
soundMC.gotoAndStop(1);
};
}
public function purgeListenersCustom(){
btn_load.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_load);
btn_lvl0.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl0);
btn_lvl1.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl1);
btn_lvl2.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl2);
btn_lvl3.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl3);
btn_lvl4.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl4);
btn_pre0.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_pre0);
}
public function musicButtonCode(){
if (musicON == true){
musicON = false;
SoundMixer.stopAll();
MovieClip(parent).musicButton.gotoAndStop(1);
} else {
musicON = true;
MovieClip(parent).musicButton.gotoAndStop(2);
};
}
function frame4(){
stop();
activeLevel = 0;
saveCode = 0;
engineMode = "";
saveCodeInput.text = "CLICK A SLOT TO LOAD ITS LEVEL CODE. RIGHT CLICK THIS BOX AND COPY THE TEXT TO SHARE YOUR LEVEL WITH OTHERS!";
btn_load.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_load);
btn_lvl0.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl0);
btn_lvl1.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl1);
btn_lvl2.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl2);
btn_lvl3.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl3);
btn_lvl4.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_lvl4);
btn_pre0.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_pre0);
i = 0;
while (i < 5) {
getNames(this[(("level" + i) + "Code")]);
this[("slotNameText_" + i)].text = tempName;
this[("slotUserText_" + i)].text = tempUser;
i++;
};
}
function frame5(){
stop();
}
function frame2(){
stop();
myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
contextMenu = myContextMenu;
}
public function loadLevel(_arg1){
purgeListeners();
engineMode = "FULL";
saveCode = _arg1;
gotoAndStop("GAME");
}
function frame1(){
voiceTemp = new Array();
ii = 0;
while (ii < 17) {
voiceTemp[ii] = true;
ii++;
};
MovieClip(parent).musicButton.addEventListener(MouseEvent.MOUSE_UP, musicButton);
musicON = true;
medalBoxActive = false;
Key.initialize(stage);
saveData = SharedObject.getLocal("CATTLEPULTDATA");
lockData = SharedObject.getLocal("CATTLEPULTLOCK");
saveDataSize = 5;
lockDataSize = 20;
lockDataArray = new Array();
loadLock();
resetData();
loadData();
}
public function func_btn_menu(_arg1){
purgeListeners();
gotoAndStop("TITLE");
}
function frame3(){
levelArray = new Array();
levelArray[0] = "Armor<@>Tutorial_1<@>ZZA1111000000A1111000000112000211000000110000011000000110040011000000110000011000000112000211000000A1111000000A1111XX<@>4<@>1";
levelArray[1] = "Armor<@>Tutorial_2<@>AAAAAA11Z0001111040000000201111Z000AAAAAA11XXX<@>3<@>2";
levelArray[2] = "Armor<@>Tutorial_3<@>A1Z0100121Z0100101Z0104031Z0100111Z0A1XXXZZZ<@>2<@>3";
levelArray[3] = "Armor<@>Tutorial_4<@>A11Z102003111000000A3031000000104011101000000100303031000000A1111XXXZZ00000<@>2<@>4";
levelArray[4] = "Chris<@>Start<@>AAA100100010000001100130310000001100120010000001100121210000001100121210000001100121210000001100171210000001100121210000001100141010000001100A00000011Z0000011Z0000011Z00000AAA1<@>1<@>5";
levelArray[5] = "Armor<@>Bloons<@>AA000001Z10000010000B010000010400B010000010100B010000010000B01000001Z100000AAXXZZZ000000<@>3<@>6";
levelArray[6] = "Lucy<@>Easyone<@>AA111011Z0000011Z0000011Z0000011Z0000011Z0000011Z0000011Z00000110000AA10000102100000110000102100200110000103100120110000102100100110000103230104AAA1<@>1<@>7";
levelArray[7] = "Chris<@>SplitSec<@>AAA1Z0001211300203000001011Z0001011000110A10110111000004012113231000007010111101020003010110001000000010113231000002010110111000000010112100030203010110AA10113000002000003AAA1<@>3<@>8";
levelArray[8] = "Lucy<@>Mix_And_Match<@>000000AZ0010001Z0012301Z0010001Z1111031Z1020301Z1011171Z1300001Z1211131Z1300041ZA11XZZZ<@>1<@>9";
levelArray[9] = "Lucy<@>Chilli<@>AAA1Z0000011302020202023011Z00000112Z000011Z00000112Z0000110000002000000112Z000011Z00000112Z0000113000000030300110000007201000110000003031304AAA1<@>1<@>10";
levelArray[10] = "Armor<@>Bull_Cake<@>AAA1Z0000011000000300000011000000200000011000000200000011Z0000011Z0000011Z0000011202020702020311Z00000110010004000000110010011100000110320202100000110A1100000111100000A11<@>1<@>11";
levelArray[11] = "J_Atkinson<@>Babel<@>000000111Z00001011Z0011301Z00102311Z0132001Z1102301Z1032001Z1002001Z1032001Z1002301Z10020011000000010023001000000110320001000000140020001000000A1111000<@>1<@>12";
levelArray[12] = "J_Atkinson<@>FYIAD<@>ZZZZ000011Z00011001Z0100010101010B730030110101000011100111001000001030111001000011121011001000112230A1001013070011101000010003001Z13000231Z12311041000000A01111<@>1<@>13";
levelArray[13] = "Lucy<@>Misleading<@>XZZZZ0000000A11000000011000001100011110000000A3000303000002110000001000300110100301002310110100101210010117111101011110113000041300003AAA1<@>1<@>14";
levelArray[14] = "J_Atkinson<@>BackBounce<@>Z01111Z00100301Z100000010000001000200010011110002000210100111000100010130B04072001010011100010201010200000100301010020000020001010002710200001001000012002010000AAZZZZ<@>1<@>15";
importCode.text = "";
if (medalBoxActive == true){
medalBoxActive = false;
medalBox.y = 200;
medalBox.play();
} else {
medalBox.stop();
};
setLocks();
btn_lvl0.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_0);
btn_lvl1.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_1);
btn_lvl2.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_2);
btn_lvl3.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_3);
btn_lvl4.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_4);
btn_lvl5.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_5);
btn_lvl6.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_6);
btn_lvl7.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_7);
btn_lvl8.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_8);
btn_lvl9.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_9);
btn_lvl10.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_10);
btn_lvl11.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_11);
btn_lvl12.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_12);
btn_lvl13.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_13);
btn_lvl14.addEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_14);
btn_menu.addEventListener(MouseEvent.MOUSE_UP, func_btn_menu);
btn_load.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_loadCustom);
}
public function func_btn_loadCustom(_arg1){
if (importCode.text != ""){
loadLevel(importCode.text);
};
}
public function saveAllData(){
var _local1:*;
_local1 = 0;
while (_local1 < saveDataSize) {
saveData.data[(("level" + _local1) + "Code")] = this[(("level" + _local1) + "Code")];
_local1++;
};
saveData.flush();
}
public function updateLevelCode(_arg1, _arg2){
this[(("level" + _arg1) + "Code")] = _arg2;
saveAllData();
}
public function func_btn_lvl_13(_arg1){
loadLevel(levelArray[13]);
}
public function func_btn_lvl_10(_arg1){
loadLevel(levelArray[10]);
}
public function func_btn_lvl_14(_arg1){
loadLevel(levelArray[14]);
}
public function func_btn_lvl_12(_arg1){
loadLevel(levelArray[12]);
}
public function func_btn_pre0(_arg1){
purgeListenersCustom();
gotoAndStop("TITLE");
}
public function func_btn_lvl_11(_arg1){
loadLevel(levelArray[11]);
}
public function loadLock(){
var _local1:*;
_local1 = 0;
while (_local1 < lockDataSize) {
if (lockData.data[(("level" + _local1) + "Lock")] == undefined){
lockDataArray[_local1] = true;
} else {
lockDataArray[_local1] = lockData.data[(("level" + _local1) + "Lock")];
};
_local1++;
};
saveAllLock();
}
public function setLocks(){
var _local1:*;
_local1 = 1;
while (_local1 < 15) {
this[("lockGraphic_lvl" + _local1)].visible = false;
this[("lockGraphic_lvl" + _local1)].visible = lockDataArray[_local1];
if (this[("lockGraphic_lvl" + _local1)].visible == false){
levelGlow.x = this[("lockGraphic_lvl" + _local1)].x;
levelGlow.y = this[("lockGraphic_lvl" + _local1)].y;
};
_local1++;
};
}
public function func_btn_lvl1(_arg1){
levelButton(1);
}
public function func_btn_lvl2(_arg1){
levelButton(2);
}
public function func_btn_lvl4(_arg1){
levelButton(4);
}
public function func_btn_lvl0(_arg1){
levelButton(0);
}
public function func_btn_lvl3(_arg1){
levelButton(3);
}
public function getNames(_arg1){
var _local2:*;
_local2 = _arg1.split("<@>");
tempUser = _local2[0];
tempName = _local2[1];
if (tempUser == undefined){
tempUser = "No UserName";
};
if (tempName == undefined){
tempName = "No LevelName";
};
}
public function resetData(){
var _local1:*;
if (saveData.data.saveActive == undefined){
saveData.data.saveActive = true;
_local1 = 0;
while (_local1 < saveDataSize) {
this[(("level" + _local1) + "Code")] = "EMPTY_SLOT";
_local1++;
};
saveAllData();
};
}
public function loadData(){
var _local1:*;
_local1 = 0;
while (_local1 < saveDataSize) {
this[(("level" + _local1) + "Code")] = saveData.data[(("level" + _local1) + "Code")];
_local1++;
};
}
public function musicButton(_arg1){
musicButtonCode();
}
public function func_btn_pre(_arg1){
}
public function purgeListeners(){
btn_lvl0.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_0);
btn_lvl1.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_1);
btn_lvl2.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_2);
btn_lvl3.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_3);
btn_lvl4.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_4);
btn_lvl5.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_5);
btn_lvl6.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_6);
btn_lvl7.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_7);
btn_lvl8.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_8);
btn_lvl9.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_9);
btn_lvl10.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_10);
btn_lvl11.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_11);
btn_lvl12.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_12);
btn_lvl13.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_13);
btn_lvl14.removeEventListener(MouseEvent.MOUSE_UP, func_btn_lvl_14);
btn_menu.removeEventListener(MouseEvent.MOUSE_UP, func_btn_menu);
btn_load.removeEventListener(MouseEvent.MOUSE_UP, func_btn_load);
}
public function levelButton(_arg1){
saveCodeInput.text = this[(("level" + _arg1) + "Code")];
activeLevel = _arg1;
}
public function func_btn_lvl_2(_arg1){
loadLevel(levelArray[2]);
}
public function func_btn_lvl_3(_arg1){
loadLevel(levelArray[3]);
}
public function func_btn_lvl_4(_arg1){
loadLevel(levelArray[4]);
}
public function func_btn_lvl_5(_arg1){
loadLevel(levelArray[5]);
}
public function func_btn_lvl_0(_arg1){
loadLevel(levelArray[0]);
}
public function func_btn_lvl_1(_arg1){
loadLevel(levelArray[1]);
}
public function func_btn_lvl_9(_arg1){
loadLevel(levelArray[9]);
}
}
}//package cattlepult_fla
Section 11
//HUD_45 (cattlepult_fla.HUD_45)
package cattlepult_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_45 extends MovieClip {
public var hudButton:MovieClip;
public var textBullCount:TextField;
public var textUserName:TextField;
public var textLevelName:TextField;
public var textPlateCount:TextField;
public var textPlateMax:TextField;
public var fuel:MovieClip;
public function HUD_45(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package cattlepult_fla
Section 12
//MainTimeline (cattlepult_fla.MainTimeline)
package cattlepult_fla {
import flash.display.*;
import flash.events.*;
public dynamic class MainTimeline extends MovieClip {
public var musicButton:MovieClip;
public var plb:MovieClip;
public function MainTimeline(){
addFrameScript(1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
addEventListener(Event.ENTER_FRAME, preLoader);
}
public function preLoader(_arg1:Event){
var _local2:*;
var _local3:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
plb.scaleX = ((1 / _local2) * _local3);
if (_local3 >= _local2){
removeEventListener(Event.ENTER_FRAME, preLoader);
play();
};
}
}
}//package cattlepult_fla
Section 13
//MEDAL_27 (cattlepult_fla.MEDAL_27)
package cattlepult_fla {
import flash.display.*;
public dynamic class MEDAL_27 extends MovieClip {
public function MEDAL_27(){
addFrameScript(682, frame683);
}
function frame683(){
stop();
y = (y - 1000);
}
}
}//package cattlepult_fla
Section 14
//MssageSstem_47 (cattlepult_fla.MssageSstem_47)
package cattlepult_fla {
import flash.display.*;
public dynamic class MssageSstem_47 extends MovieClip {
public function MssageSstem_47(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package cattlepult_fla
Section 15
//MUSIC_50 (cattlepult_fla.MUSIC_50)
package cattlepult_fla {
import flash.display.*;
public dynamic class MUSIC_50 extends MovieClip {
public function MUSIC_50(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package cattlepult_fla
Section 16
//Sound_48 (cattlepult_fla.Sound_48)
package cattlepult_fla {
import flash.display.*;
public dynamic class Sound_48 extends MovieClip {
public function Sound_48(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package cattlepult_fla
Section 17
//SYSTEM_Square_29 (cattlepult_fla.SYSTEM_Square_29)
package cattlepult_fla {
import flash.display.*;
public dynamic class SYSTEM_Square_29 extends MovieClip {
public function SYSTEM_Square_29(){
addFrameScript(0, frame1);
}
function frame1(){
alpha = 0;
}
}
}//package cattlepult_fla
Section 18
//TITLE_INTRO_12 (cattlepult_fla.TITLE_INTRO_12)
package cattlepult_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public dynamic class TITLE_INTRO_12 extends MovieClip {
public var displayText:TextField;
public var btn_play:MovieClip;
public var btn_create:MovieClip;
public var btn_lvl0:MovieClip;
public var creditsScreen:MovieClip;
public var btn_credits:MovieClip;
public var btn_armor:MovieClip;
public function TITLE_INTRO_12(){
addFrameScript(81, frame82);
}
public function btn_armor_MD(_arg1){
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://www.armorgames.com";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
public function btn_armor_MM(_arg1){
displayText.text = "PLAY MORE GREAT FREE GAMES AT ARMOR GAMES!";
}
public function btn_armor_MO(_arg1){
displayText.text = "CAN YOU BEAT THE LEVELS AND WIN THE PRIZE? OR PLAY LIKE A BULL IN A CHINA SHOP?";
}
public function creditsMouseUp(_arg1){
creditsScreen.x = -1000;
creditsScreen.removeEventListener(MouseEvent.MOUSE_UP, creditsMouseUp);
}
public function btn_credits_MD(_arg1){
creditsScreen.x = 0;
creditsScreen.addEventListener(MouseEvent.MOUSE_UP, creditsMouseUp);
}
public function btn_credits_MO(_arg1){
displayText.text = "CAN YOU BEAT THE LEVELS AND WIN THE PRIZE? OR PLAY LIKE A BULL IN A CHINA SHOP?";
}
function frame82(){
stop();
btn_play.addEventListener(MouseEvent.MOUSE_UP, btn_play_MD);
btn_create.addEventListener(MouseEvent.MOUSE_UP, btn_create_MD);
btn_armor.addEventListener(MouseEvent.MOUSE_UP, btn_armor_MD);
btn_play.addEventListener(MouseEvent.MOUSE_OVER, btn_play_MM);
btn_play.addEventListener(MouseEvent.MOUSE_OUT, btn_play_MO);
btn_create.addEventListener(MouseEvent.MOUSE_OVER, btn_create_MM);
btn_create.addEventListener(MouseEvent.MOUSE_OUT, btn_create_MO);
btn_armor.addEventListener(MouseEvent.MOUSE_OVER, btn_armor_MM);
btn_armor.addEventListener(MouseEvent.MOUSE_OUT, btn_armor_MO);
btn_credits.addEventListener(MouseEvent.MOUSE_UP, btn_credits_MD);
btn_credits.addEventListener(MouseEvent.MOUSE_OVER, btn_credits_MM);
btn_credits.addEventListener(MouseEvent.MOUSE_OUT, btn_credits_MO);
}
public function btn_credits_MM(_arg1){
displayText.text = "VIEW WHO GAVE THIS FINE GAME LIFE...";
}
public function btn_create_MD(_arg1){
purgeListeners();
MovieClip(parent).gotoAndStop("CUSTOM");
}
public function btn_play_MD(_arg1){
purgeListeners();
MovieClip(parent).gotoAndStop("PREBUILT");
}
public function btn_create_MM(_arg1){
displayText.text = "CREATE YOUR OWN LEVELS IN THE LEVEL EDITOR AND SHARE THEM WITH YOUR FRIENDS! OR PLAY LEVELS CREATED BY OTHERS! CAN YOU BEST THEIR CHALLENGE?";
}
public function btn_play_MM(_arg1){
displayText.text = "PLAY THE PRE-BUILT CATTLEPULT LEVELS";
}
public function btn_play_MO(_arg1){
displayText.text = "CAN YOU BEAT THE LEVELS AND WIN THE PRIZE? OR PLAY LIKE A BULL IN A CHINA SHOP?";
}
public function btn_create_MO(_arg1){
displayText.text = "CAN YOU BEAT THE LEVELS AND WIN THE PRIZE? OR PLAY LIKE A BULL IN A CHINA SHOP?";
}
public function purgeListeners(){
btn_play.removeEventListener(MouseEvent.MOUSE_DOWN, btn_play_MD);
btn_create.removeEventListener(MouseEvent.MOUSE_DOWN, btn_create_MD);
btn_armor.removeEventListener(MouseEvent.MOUSE_DOWN, btn_armor_MD);
btn_play.removeEventListener(MouseEvent.MOUSE_OVER, btn_play_MM);
btn_create.removeEventListener(MouseEvent.MOUSE_OVER, btn_create_MM);
btn_armor.removeEventListener(MouseEvent.MOUSE_OVER, btn_armor_MM);
btn_play.removeEventListener(MouseEvent.MOUSE_OUT, btn_play_MO);
btn_create.removeEventListener(MouseEvent.MOUSE_OUT, btn_create_MO);
btn_armor.removeEventListener(MouseEvent.MOUSE_OUT, btn_armor_MO);
btn_credits.removeEventListener(MouseEvent.MOUSE_UP, btn_credits_MD);
btn_credits.removeEventListener(MouseEvent.MOUSE_OVER, btn_credits_MM);
btn_credits.removeEventListener(MouseEvent.MOUSE_OUT, btn_credits_MO);
}
}
}//package cattlepult_fla
Section 19
//TRACKERDOT_35 (cattlepult_fla.TRACKERDOT_35)
package cattlepult_fla {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class TRACKERDOT_35 extends MovieClip {
public var timer;
public var ySpeed;
public var speed;
public var gravity;
public var maxGravity;
public var hitFloorActive;
public var xSpeed;
public var drop;
public function TRACKERDOT_35(){
addFrameScript(0, frame1);
}
public function hitGround(_arg1, _arg2){
if (MovieClip(parent).GROUND.hitTestPoint(((x + MovieClip(parent).x) + _arg1), ((y + MovieClip(parent).y) + _arg2), true)){
return (true);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
speed = 0;
ySpeed = 0;
xSpeed = 0;
drop = 0;
gravity = 1;
maxGravity = 40;
hitFloorActive = false;
timer = 50;
alpha = 0;
}
public function onEnterFrame(_arg1){
if (MovieClip(parent).trackerActive == true){
timer = 50;
MovieClip(parent).EFFECTS.graphics.lineStyle(2, 16755370, (timer / 50));
MovieClip(parent).EFFECTS.graphics.moveTo(x, y);
while (timer > 0) {
if (hitTestObject(MovieClip(parent).launchTop.hit)){
hitFloorActive = true;
};
MovieClip(parent).EFFECTS.graphics.lineStyle(2, 16755370, (timer / 50));
timer--;
x = (x + xSpeed);
y = (y + (ySpeed + drop));
xSpeed = (xSpeed / 1.01);
ySpeed = (ySpeed / 1.01);
drop = (drop + (gravity / 2));
if ((((hitGround(0, 0) == true)) && ((hitFloorActive == true)))){
timer = 0;
};
if (drop > maxGravity){
drop = maxGravity;
};
MovieClip(parent).EFFECTS.graphics.lineTo(x, y);
};
hitFloorActive = false;
drop = 0;
};
}
}
}//package cattlepult_fla
Section 20
//Voice_49 (cattlepult_fla.Voice_49)
package cattlepult_fla {
import flash.display.*;
public dynamic class Voice_49 extends MovieClip {
public function Voice_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package cattlepult_fla
Section 21
//xczcxzc_7 (cattlepult_fla.xczcxzc_7)
package cattlepult_fla {
import flash.display.*;
public dynamic class xczcxzc_7 extends MovieClip {
public function xczcxzc_7(){
addFrameScript(125, frame126);
}
function frame126(){
MovieClip(parent).nextFrame();
}
}
}//package cattlepult_fla
Section 22
//BUILD_BLOCK (BUILD_BLOCK)
package {
import flash.display.*;
public dynamic class BUILD_BLOCK extends MovieClip {
public function BUILD_BLOCK(){
addFrameScript(0, frame1);
}
function frame1(){
}
public function removeFromLevel(){
parent.removeChild(this);
delete ??getglobalscope
[this];
}
}
}//package
Section 23
//BUILD_BOOSTER (BUILD_BOOSTER)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class BUILD_BOOSTER extends MovieClip {
public var hit:MovieClip;
public var bounceTimer;
public function BUILD_BOOSTER(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
bounceTimer = 0;
}
public function onEnterFrame(_arg1){
if (bounceTimer > 0){
bounceTimer--;
};
if (((((this.hit.hitTestObject(MovieClip(parent).bull)) && ((bounceTimer == 0)))) && ((MovieClip(parent).bull.hitFloorActive == true)))){
bounceTimer = 20;
MovieClip(parent.parent).playSound("EXP");
MovieClip(parent).explosion(MovieClip(parent).bull.x, MovieClip(parent).bull.y, 4);
MovieClip(parent).bull.boostActive = true;
};
if (MovieClip(parent).purgeActive == 1){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
};
}
}
}//package
Section 24
//BUILD_BOUNCER (BUILD_BOUNCER)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class BUILD_BOUNCER extends MovieClip {
public var scaler;
public var hit:MovieClip;
public var bounceTimer;
public var sprite:MovieClip;
public function BUILD_BOUNCER(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
sprite.rotation = (Math.round((Math.random() * 8)) * 45);
bounceTimer = 0;
scaler = 0;
}
public function onEnterFrame(_arg1){
if (bounceTimer > 0){
bounceTimer--;
scaler = (scaler / 1.2);
sprite.scaleX = (scaler + 1);
sprite.scaleY = (scaler + 1);
};
if (((((this.hit.hitTestObject(MovieClip(parent).bull)) && ((bounceTimer == 0)))) && ((MovieClip(parent).bull.gravity == 1)))){
bounceTimer = 10;
MovieClip(parent.parent).playSound("BOUNCER");
MovieClip(parent).bull.rotation = sprite.rotation;
MovieClip(parent).bull.ySpeed = (15 * Math.sin((MovieClip(parent).bull.rotation * 0.01745329)));
MovieClip(parent).bull.xSpeed = (15 * Math.cos((MovieClip(parent).bull.rotation * 0.01745329)));
MovieClip(parent).bull.drop = 0;
MovieClip(parent).bull.x = (this.x + 50);
MovieClip(parent).bull.y = (this.y + 50);
scaler = 1;
};
if (MovieClip(parent).purgeActive == 1){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
delete ??getglobalscope
[this];
};
}
public function MouseDown(_arg1){
sprite.rotation = (sprite.rotation + 45);
}
}
}//package
Section 25
//BUILD_BULL (BUILD_BULL)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class BUILD_BULL extends MovieClip {
public var emotionState;
public var noFuel;
public var boingBuffer;
public var hitSize;
public var ySpeed;
public var speed;
public var gravity;
public var changeLast;
public var activityTimer;
public var maxGravity;
public var emotionBuffer;
public var boostActive;
public var fader;
public var spriteScale;
public var lastXPos;
public var hitFloorActive;
public var xSpeed;
public var hitPos;
public var sprite:MovieClip;
public var lastYPos;
public var drop;
public function BUILD_BULL(){
addFrameScript(0, frame1);
}
public function hitGround(_arg1, _arg2){
if (MovieClip(parent).GROUND.hitTestPoint(((x + MovieClip(parent).x) + _arg1), ((y + MovieClip(parent).y) + _arg2), true)){
boostActive = false;
return (true);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
speed = 0;
ySpeed = 0;
xSpeed = 0;
drop = 0;
gravity = 0;
maxGravity = 40;
hitPos = 0;
spriteScale = sprite.scaleX;
lastXPos = x;
lastYPos = y;
boingBuffer = 0;
changeLast = false;
emotionBuffer = 0;
emotionState = "norm";
hitSize = 22;
noFuel = false;
activityTimer = 0;
hitFloorActive = false;
boostActive = false;
}
public function onEnterFrame(_arg1){
if ((((noFuel == true)) && ((gravity == 1)))){
if (alpha != 0){
MovieClip(parent).explosion(x, y, 2);
MovieClip(parent.parent).playSound("EXP");
MovieClip(parent).bullCount--;
if (((!((MovieClip(parent).plateCount == MovieClip(parent).plateMax))) && ((MovieClip(parent).bullCount == 0)))){
MovieClip(parent.parent).EOL.gotoAndStop("FAIL");
} else {
if (((!((MovieClip(parent).plateCount == MovieClip(parent).plateMax))) && ((MovieClip(parent).bullCount > 0)))){
MovieClip(parent.parent).EOL.gotoAndStop("LOSTLIFE");
} else {
if (MovieClip(parent).plateCount == MovieClip(parent).plateMax){
MovieClip(parent.parent).EOL.gotoAndStop("SUCCESS");
MovieClip(parent).unlockCurrentLevel();
MovieClip(parent).bullCount = 0;
};
};
};
};
alpha = 0;
scaleX = 0;
scaleY = 0;
xSpeed = 0;
ySpeed = 0;
drop = 0;
hitFloorActive = false;
if (activityTimer < 120){
activityTimer++;
} else {
if (MovieClip(parent).bullCount > 0){
activityTimer = 0;
noFuel = false;
gravity = 0;
alpha = 1;
scaleX = 1;
scaleY = 1;
x = MovieClip(parent).launchTop.x;
y = MovieClip(parent).launchTop.y;
boostActive = false;
sprite.gotoAndStop("still");
} else {
if (MovieClip(parent.parent).engineMode == "PREVIEW"){
MovieClip(parent).purgeTarget = "EDITOR";
} else {
MovieClip(parent).purgeTarget = "PREBUILT";
};
MovieClip(parent).purgeActive = 1;
};
};
} else {
if (noFuel == false){
if (MovieClip(parent).fuel == 0){
noFuel = true;
};
if (boostActive == false){
sprite.gotoAndStop("still");
xSpeed = (xSpeed / 1.01);
ySpeed = (ySpeed / 1.01);
drop = (drop + (gravity / 2));
} else {
sprite.gotoAndStop("blur");
MovieClip(parent).explosion(x, y, 0.5);
};
changeLast = true;
x = (x + xSpeed);
if (hitFloorActive == true){
setHitPos(xSpeed, hitSize, true);
if ((((((hitGround(hitSize, 0) == true)) || ((hitGround((hitSize / 2), 0) == true)))) || ((hitGround((hitSize * 1.5), 0) == true)))){
while ((((((hitGround(hitSize, 0) == true)) || ((hitGround((hitSize / 2), 0) == true)))) || ((hitGround((hitSize * 1.5), 0) == true)))) {
x--;
};
changeLast = false;
xSpeed = (-(xSpeed) / 2);
};
setHitPos(xSpeed, -(hitSize), false);
if ((((((hitGround(-(hitSize), 0) == true)) || ((hitGround((-(hitSize) / 2), 0) == true)))) || ((hitGround((-(hitSize) * 1.5), 0) == true)))){
while ((((((hitGround(-(hitSize), 0) == true)) || ((hitGround((-(hitSize) / 2), 0) == true)))) || ((hitGround((-(hitSize) * 1.5), 0) == true)))) {
x++;
};
changeLast = false;
xSpeed = (-(xSpeed) / 2);
};
};
y = (y + (ySpeed + drop));
if (hitFloorActive == true){
setHitPos((ySpeed + drop), hitSize, true);
if ((((((hitGround(0, hitSize) == true)) || ((hitGround(0, (hitSize / 2)) == true)))) || ((hitGround(0, (hitSize * 1.5)) == true)))){
while ((((((hitGround(0, hitSize) == true)) || ((hitGround(0, (hitSize / 2)) == true)))) || ((hitGround(0, (hitSize * 1.5)) == true)))) {
y--;
};
changeLast = false;
drop = (-((drop + ySpeed)) / 1.5);
ySpeed = 0;
xSpeed = (xSpeed / 1.04);
};
setHitPos((ySpeed + drop), -(hitSize), false);
if ((((((hitGround(0, -(hitSize)) == true)) || ((hitGround(0, (-(hitSize) / 2)) == true)))) || ((hitGround(0, (-(hitSize) * 1.5)) == true)))){
while ((((((hitGround(0, -(hitSize)) == true)) || ((hitGround(0, (-(hitSize) / 2)) == true)))) || ((hitGround(0, (-(hitSize) * 1.5)) == true)))) {
y++;
};
changeLast = false;
drop = (-((drop + ySpeed)) / 1.2);
ySpeed = 0;
xSpeed = (xSpeed / 1.04);
};
if (drop > maxGravity){
drop = maxGravity;
};
if (changeLast == false){
if (boingBuffer > 5){
MovieClip(parent.parent).playSound("BOING");
};
boingBuffer = 0;
if (MovieClip(parent).pythag(x, y, lastXPos, lastYPos) > 100){
x = lastXPos;
y = lastYPos;
};
};
boingBuffer++;
};
if (gravity != 0){
if (hitGround(0, (hitSize * 2)) != true){
rotation = Math.round(((Math.atan2((y - lastYPos), (x - lastXPos)) / 3.141593) * 180));
if (x > lastXPos){
sprite.scaleY = spriteScale;
} else {
if (x < lastXPos){
sprite.scaleY = -(spriteScale);
};
};
};
if ((((boostActive == false)) && ((gravity == 1)))){
fader = new EFFECT_BULLFADE();
fader.alpha = (MovieClip(parent).pythag(x, y, lastXPos, lastYPos) / 100);
MovieClip(parent).EFFECTS.addChild(fader);
};
lastXPos = x;
lastYPos = y;
if (Key.isDown(Keyboard.SPACE)){
MovieClip(parent).fuel = 0;
};
if (((hitTestObject(MovieClip(parent).launchTop.hit)) && ((hitFloorActive == false)))){
hitFloorActive = true;
lastXPos = MovieClip(parent).launchTop.x;
lastYPos = MovieClip(parent).launchTop.y;
};
};
};
};
}
public function setHitPos(_arg1, _arg2, _arg3){
if (_arg3 == true){
if (_arg1 > _arg2){
hitPos = _arg1;
} else {
hitPos = _arg2;
};
} else {
if (_arg1 < _arg2){
hitPos = _arg1;
} else {
hitPos = _arg2;
};
};
}
}
}//package
Section 26
//BUILD_LAUNCHER (BUILD_LAUNCHER)
package {
import flash.display.*;
public dynamic class BUILD_LAUNCHER extends MovieClip {
public var elastic1:MovieClip;
public var hit:MovieClip;
public var elastic2:MovieClip;
}
}//package
Section 27
//BUILD_MAGMINUS (BUILD_MAGMINUS)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class BUILD_MAGMINUS extends MovieClip {
public var bullSpeed;
public var bullAngle;
public function BUILD_MAGMINUS(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
if (MovieClip(parent).bull.gravity == 1){
bullAngle = Math.round(((Math.atan2((MovieClip(parent).bull.y - y), (MovieClip(parent).bull.x - x)) / 3.141593) * 180));
bullSpeed = MovieClip(parent).pythag((x + 50), (y + 50), MovieClip(parent).bull.x, MovieClip(parent).bull.y);
MovieClip(parent).bull.ySpeed = (MovieClip(parent).bull.ySpeed + ((10000 / bullSpeed) * Math.sin((MovieClip(parent).bullAngle * 0.01745329))));
MovieClip(parent).bull.xSpeed = (MovieClip(parent).bull.xSpeed + ((10000 / bullSpeed) * Math.cos((MovieClip(parent).bullAngle * 0.01745329))));
};
}
}
}//package
Section 28
//BUILD_MAGPLUS (BUILD_MAGPLUS)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class BUILD_MAGPLUS extends MovieClip {
public var damping;
public var spring;
public var bullVelX;
public var bullVelY;
public function BUILD_MAGPLUS(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
bullVelX = 0;
bullVelY = 0;
damping = 0.8;
spring = 0.004;
}
public function onEnterFrame(_arg1){
if ((((MovieClip(parent).bull.gravity == 1)) && ((MovieClip(parent).pythag((x + 50), (y + 50), MovieClip(parent).bull.x, MovieClip(parent).bull.y) < 300)))){
bullVelX = (bullVelX + (((x + 50) - MovieClip(parent).bull.x) * spring));
bullVelY = (bullVelY + (((y + 50) - MovieClip(parent).bull.y) * spring));
bullVelX = (bullVelX * damping);
bullVelY = (bullVelY * damping);
MovieClip(parent).bull.x = (MovieClip(parent).bull.x + bullVelX);
MovieClip(parent).bull.y = (MovieClip(parent).bull.y + bullVelY);
MovieClip(parent).bull.drop = (MovieClip(parent).bull.drop / 1.1);
};
}
}
}//package
Section 29
//BUILD_PLATE (BUILD_PLATE)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class BUILD_PLATE extends MovieClip {
public function BUILD_PLATE(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onClick);
}
public function onClick(_arg1){
if ((((((MovieClip(parent).pythag((x + (width / 2)), (y + (height / 2)), MovieClip(parent).bull.x, MovieClip(parent).bull.y) < (width / 1.5))) && ((MovieClip(parent).bull.gravity > 0)))) || ((MovieClip(parent).purgeActive == 1)))){
if (MovieClip(parent).purgeActive != 1){
MovieClip(parent).newShards((x + (width / 2)), (y + (width / 2)), 40, width, (scaleX / 1.5));
};
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, onClick);
delete ??getglobalscope
[this];
};
}
}
}//package
Section 30
//EDITOR_block (EDITOR_block)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class EDITOR_block extends MovieClip {
public var blockValue;
public var startPointSwitch;
public var mousePressed;
public var sprite:MovieClip;
public function EDITOR_block(){
addFrameScript(0, frame1);
}
public function MouseUp(_arg1){
mousePressed = false;
}
public function getPointBounds(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
if ((((((((_arg1 > _arg3)) && ((_arg1 < (_arg3 + _arg5))))) && ((_arg2 > _arg4)))) && ((_arg2 < (_arg4 + _arg6))))){
return (true);
};
}
function frame1(){
blockValue = rotation;
startPointSwitch = false;
sprite.gotoAndStop(MovieClip(parent.parent).buildGraphicsArray[blockValue]);
stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
stage.addEventListener(Event.ENTER_FRAME, MouseOver);
mousePressed = false;
}
public function MouseDown(_arg1){
mousePressed = true;
}
public function MouseOver(_arg1){
if (MovieClip(parent.parent).renderState == true){
rotation = blockValue;
} else {
rotation = 0;
};
if (((((!((blockValue == 4))) && ((mousePressed == true)))) && ((getPointBounds(MovieClip(parent).mouseX, MovieClip(parent).mouseY, x, y, width, height) == true)))){
sprite.gotoAndStop(MovieClip(parent.parent).brushType);
blockValue = MovieClip(parent.parent).brushValue;
startPointSwitch = true;
} else {
if ((((((((((((((((parent.mouseY > 0)) && ((parent.mouseY < 300)))) && ((parent.mouseX > 0)))) && ((parent.mouseX < 300)))) && ((mousePressed == true)))) && ((blockValue == 4)))) && ((MovieClip(parent.parent).brushValue == 4)))) && (!((getPointBounds(MovieClip(parent).mouseX, MovieClip(parent).mouseY, (x - 1), (y - 1), (width + 2), (height + 1)) == true))))){
startPointSwitch = false;
sprite.gotoAndStop(1);
blockValue = 0;
};
};
if (MovieClip(parent.parent).purgeActive == true){
stage.removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, MouseUp);
stage.removeEventListener(Event.ENTER_FRAME, MouseOver);
parent.removeChild(this);
delete ??getglobalscope
[this];
};
}
}
}//package
Section 31
//EFFECT_BULLFADE (EFFECT_BULLFADE)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class EFFECT_BULLFADE extends MovieClip {
public var timer;
public function EFFECT_BULLFADE(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
x = MovieClip(parent.parent).bull.x;
scaleX = MovieClip(parent.parent).bull.scaleX;
y = MovieClip(parent.parent).bull.y;
rotation = MovieClip(parent.parent).bull.rotation;
visible = false;
timer = 5;
}
public function onEnterFrame(_arg1){
visible = true;
alpha = (alpha / 1.2);
timer--;
if ((((MovieClip(parent.parent).purgeActive == true)) || ((timer == 0)))){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
};
}
}
}//package
Section 32
//EFFECT_EXPLOSION (EFFECT_EXPLOSION)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class EFFECT_EXPLOSION extends MovieClip {
public var timer;
public function EFFECT_EXPLOSION(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
timer = 20;
x = (x + ((Math.random() * 10) - 5));
y = (y + ((Math.random() * 10) - 5));
rotation = (Math.random() * 360);
}
public function onEnterFrame(_arg1){
timer--;
if ((((MovieClip(parent.parent).purgeActive == true)) || ((timer == 0)))){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
};
}
}
}//package
Section 33
//Key (Key)
package {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package
Section 34
//SHARD (SHARD)
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class SHARD extends MovieClip {
public var initMove;
public var floorPoint;
public var ySpeed;
public var speed;
public var spin;
public var xSpeed;
public var sprite:MovieClip;
public var drop;
public function SHARD(){
addFrameScript(0, frame1);
}
public function hitGround(_arg1, _arg2){
if (MovieClip(parent.parent).GROUND.hitTestPoint(((x + MovieClip(parent.parent).x) + _arg1), ((y + MovieClip(parent.parent).y) + _arg2), true)){
return (true);
};
}
function frame1(){
sprite.gotoAndStop(Math.round(((Math.random() * 5) + 1)));
speed = (((Math.random() * 20) + 5) * scaleX);
sprite.scaleX = (((Math.random() * 200) + 30) / 80);
sprite.scaleY = (((Math.random() * 200) + 30) / 80);
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
rotation = (Math.random() * 360);
drop = ((Math.random() * 10) * -1);
floorPoint = (400 + (Math.random() * 20));
spin = ((Math.random() * 80) - 40);
initMove = (Math.random() * 4);
x = (x + (xSpeed * initMove));
y = (y + (ySpeed * initMove));
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
sprite.rotation = (sprite.rotation + spin);
spin = (spin / 1.1);
x = (x + xSpeed);
y = (y + (ySpeed + drop));
drop++;
ySpeed = (ySpeed / 1.1);
if (MovieClip(parent.parent).pythag(x, y, MovieClip(parent.parent).bull.x, MovieClip(parent.parent).bull.y) > 500){
parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
};
}
}
}//package
Section 35
//SPARK (SPARK)
package {
import flash.display.*;
import flash.events.*;
public dynamic class SPARK extends MovieClip {
public var distance;
public var mouseAngle;
public var ySpeed;
public var speed;
public var xSpeed2;
public var xSpeed;
public var ySpeed2;
public function SPARK(){
addFrameScript(0, frame1);
}
function frame1(){
speed = (1 + (Math.random() * 40));
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
ySpeed2 = 1;
xSpeed2 = 1;
mouseAngle = 0;
distance = 0;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
x = (x + xSpeed);
y = (y + ySpeed);
xSpeed = (xSpeed / 1.1);
ySpeed = (ySpeed / 1.1);
distance = Math.sqrt((((parent.mouseY - y) * (parent.mouseY - y)) + ((parent.mouseX - x) * (parent.mouseX - x))));
mouseAngle = Math.round(((Math.atan2((parent.mouseY - y), (parent.mouseX - x)) / 3.141593) * 180));
ySpeed2 = ((1000 / distance) * Math.sin((mouseAngle * 0.01745329)));
xSpeed2 = ((1000 / distance) * Math.cos((mouseAngle * 0.01745329)));
x = (x + xSpeed2);
y = (y + ySpeed2);
if (distance < 50){
parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
};
}
}
}//package