Section 1
//ASLForm (com.morpheme.g5.ASLForm)
package com.morpheme.g5 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class ASLForm extends MovieClip {
private var sexId:Number;// = 0
private var g5:G5Framework;// = null
private var soSurvey:SharedObject;// = null
private var ageId:Number;// = 0
public function ASLForm(_arg1:G5Framework){
this.g5 = _arg1;
var _local2:Number = 0;
_local2 = 1;
while (_local2 <= 7) {
this[("movAge" + _local2)].gotoAndStop(1);
_local2++;
};
this["movSex1"].gotoAndStop(1);
this["movSex2"].gotoAndStop(1);
_local2 = 1;
while (_local2 <= 7) {
this[("movAge" + _local2)].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPressAge);
_local2++;
};
this["movSex1"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPressSex);
this["movSex2"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPressSex);
this["btnSkip"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPressSkip);
this["btnDone"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPressDone);
_local2 = 1;
while (_local2 <= 7) {
this[("movAge" + _local2)].buttonMode = true;
_local2++;
};
this["movSex1"].buttonMode = true;
this["movSex2"].buttonMode = true;
}
public function onButtonPressDone(_arg1:MouseEvent):void{
soSurvey.setProperty("a", ageId);
soSurvey.setProperty("s", sexId);
soSurvey.flush();
var _local2:URLVariables = new URLVariables();
_local2.op = G5Framework.OP_OTW_SUBMIT_ASL_VALS;
_local2.GameId = g5.getGameId();
_local2.AgeId = ageId;
_local2.SexId = sexId;
var _local3:URLRequest = new URLRequest(G5Framework.SERVLET_URL);
var _local4:URLLoader = new URLLoader();
_local4.dataFormat = URLLoaderDataFormat.VARIABLES;
_local3.data = _local2;
_local3.method = URLRequestMethod.POST;
_local4.addEventListener(Event.COMPLETE, aslSubmitHandler);
_local4.addEventListener(IOErrorEvent.IO_ERROR, aslSubmitError);
_local4.load(_local3);
g5.surveyComplete();
}
public function cookieCheck():Boolean{
soSurvey = SharedObject.getLocal("g5Survey");
return (((g5.isASLEnabled()) && ((soSurvey.size == 0))));
}
public function onButtonPressAge(_arg1:MouseEvent):void{
var _local3:String;
var _local2:Number = 1;
while (_local2 <= 7) {
_local3 = ("movAge" + _local2);
if (_arg1.target.name != _local3){
this[_local3].gotoAndStop(1);
} else {
ageId = _local2;
this[_local3].gotoAndStop(2);
};
_local2++;
};
showDoneButton();
}
public function onButtonPressSkip(_arg1:MouseEvent):void{
g5.surveyComplete();
}
private function showDoneButton():void{
this.btnDone.visible = (((ageId > 0)) && ((sexId > 0)));
this.btnSkip.visible = !(this.btnDone.visible);
}
public function onButtonPressSex(_arg1:MouseEvent):void{
var _local3:String;
var _local2:Number = 1;
while (_local2 <= 2) {
_local3 = ("movSex" + _local2);
if (_arg1.target.name != _local3){
this[_local3].gotoAndStop(1);
} else {
sexId = _local2;
this[_local3].gotoAndStop(2);
};
_local2++;
};
showDoneButton();
}
public function aslSubmitError(_arg1:IOErrorEvent):void{
}
public function aslSubmitHandler(_arg1:Event):void{
}
}
}//package com.morpheme.g5
Section 2
//G5Framework (com.morpheme.g5.G5Framework)
package com.morpheme.g5 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
public class G5Framework extends MovieClip {
private var TeaserScreen:Class;
private var movTeaser:MovieClip;
private var timedOut:Boolean;// = false
private var movSplash:MovieClip;
private var gameName:String;// = ""
private var mochiEnabled:Boolean;// = false
private var gameId:Number;
private var igaEnabled:Boolean;// = false
private var g5Game:G5Game;
public var teaserSkipped:Boolean;// = false
private var teaserEnabled:Boolean;// = false
private var SplashScreen:Class;
private var teaserTimer:Timer;// = null
private var aslForm:ASLForm;// = null
private var mochiadId:String;// = ""
private var mochibotId:String;// = ""
private var timeoutTimer:Timer;// = null
private var aslEnabled:Boolean;// = false
private var gameCode:String;// = ""
public static var TEASER_URL:String = "http://www.addictinggames.com";
public static var HS_SERVLET_URL:String = (SERVER_URL + "/servlet/hiServlet");
public static var INDEX_URL:String = (SERVER_URL + "/index.jsp?id=");
public static var HS_DATA_DELIM_ROW:String = ">";
public static var OP_OTW_GET_CONFIG_PROPS:Number = 0;
private static var SERVER_TIMEOUT_MILLIS:Number = 7500;
public static var OP_HS_GET_DATA:Number = 1;
public static var SERVER_URL:String = "http://www.gimme5games.com";
public static var SERVLET_URL:String = (SERVER_URL + "/servlet/otwServlet");
public static var HS_DATA_DELIM_COL:String = "/";
public static var OP_OTW_SUBMIT_ASL_VALS:Number = 1;
public function G5Framework(){
SplashScreen = G5Framework_SplashScreen;
movSplash = new SplashScreen();
TeaserScreen = G5Framework_TeaserScreen;
movTeaser = new TeaserScreen();
super();
}
public function teaserPause():void{
if (g5Game.debug){
trace("[G5 DEBUG] - teaserWait");
};
movTeaser["AGhome01"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
teaserTimer = new Timer(4000, 1);
teaserTimer.addEventListener("timer", teaserComplete);
teaserTimer.start();
}
public function setConfigProps(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean, _arg7:String, _arg8:String):void{
this.gameCode = _arg1;
this.gameName = _arg2;
this.aslEnabled = _arg3;
this.igaEnabled = _arg4;
this.mochiEnabled = _arg5;
this.teaserEnabled = _arg6;
this.mochiadId = _arg7;
this.mochibotId = _arg8;
}
public function getConfigPropsHandler(_arg1:Event):void{
var _local2:URLLoader;
timeoutTimer.stop();
timeoutTimer = null;
if (!timedOut){
if (g5Game.debug){
trace("[G5 DEBUG] - Config props fetched from server");
};
_local2 = URLLoader(_arg1.target);
if (_local2.data.err == undefined){
setConfigProps(_local2.data.GameCode, _local2.data.GameName, (_local2.data.ASLEnabled == 1), (_local2.data.IGAEnabled == 1), (_local2.data.MochiEnabled == 1), false, _local2.data.MochiAdId, _local2.data.MochiBotId);
} else {
getConfigPropsError(null);
};
configComplete();
};
}
public function getGameName():String{
return (this.gameName);
}
public function getMochiBotId():String{
return (this.mochibotId);
}
public function getConfigProps():void{
if (g5Game.debug){
trace("[G5 DEBUG] - getConfigProps");
};
var _local1:URLVariables = new URLVariables();
_local1.op = OP_OTW_GET_CONFIG_PROPS;
_local1.GameId = gameId;
var _local2:URLRequest = new URLRequest(SERVLET_URL);
var _local3:URLLoader = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.VARIABLES;
_local2.data = _local1;
_local2.method = URLRequestMethod.POST;
_local3.addEventListener(Event.COMPLETE, getConfigPropsHandler);
_local3.addEventListener(IOErrorEvent.IO_ERROR, getConfigPropsError);
_local3.load(_local2);
timedOut = false;
timeoutTimer = new Timer(G5Framework.SERVER_TIMEOUT_MILLIS, 1);
timeoutTimer.addEventListener("timer", getConfigPropsTimeout);
timeoutTimer.start();
}
public function isIGAEnabled():Boolean{
return (this.igaEnabled);
}
public function getGameId():Number{
return (this.gameId);
}
public function getConfigPropsTimeout(_arg1:TimerEvent):void{
if (g5Game.debug){
trace("[G5 DEBUG] - getConfigPropsTimeout");
};
timedOut = true;
configComplete();
}
public function teaserComplete(_arg1:TimerEvent):void{
if (g5Game.debug){
trace("[G5 DEBUG] - teaserComplete");
};
if (teaserTimer != null){
teaserTimer.stop();
teaserTimer = null;
};
this.g5Game.removeChild(this.movTeaser);
this.g5Game.showSplashScreen(movSplash);
}
public function isASLEnabled():Boolean{
return (this.aslEnabled);
}
public function surveyComplete():void{
if (g5Game.debug){
trace("[G5 DEBUG] - surveyComplete");
};
if (this.g5Game.contains(aslForm)){
this.g5Game.removeChild(aslForm);
};
this.g5Game.initGame();
this.g5Game.showTitleScreen();
}
private function configComplete():void{
if (g5Game.debug){
trace("[G5 DEBUG] - configComplete");
};
this.g5Game.trackMochi();
if (teaserEnabled){
this.g5Game.showTeaserScreen(movTeaser);
} else {
this.g5Game.showSplashScreen(movSplash);
};
this.g5Game.removePreloader();
}
public function splashComplete():void{
if (g5Game.debug){
trace("[G5 DEBUG] - splashComplete");
};
if (aslForm.cookieCheck()){
aslForm.x = ((this.g5Game.swfWidth - aslForm.width) / 2);
aslForm.y = ((this.g5Game.swfHeight - aslForm.height) / 2);
this.g5Game.addChild(aslForm);
} else {
surveyComplete();
};
}
public function getMochiAdId():String{
return (this.mochiadId);
}
public function getConfigPropsError(_arg1:IOErrorEvent):void{
if (g5Game.debug){
trace("[G5 DEBUG] - getConfigPropsError");
};
}
public function onButtonPress(_arg1:MouseEvent):void{
var _local2:URLRequest;
var _local3:URLRequest;
switch (_arg1.target.name){
case "btnUrl":
_local2 = new URLRequest(G5Framework.SERVER_URL);
navigateToURL(_local2, "_blank");
break;
case "AGhome01":
_local3 = new URLRequest(G5Framework.TEASER_URL);
navigateToURL(_local3, "_blank");
break;
case "OriginalSkip":
teaserSkipped = true;
break;
};
}
public function toggleSound():void{
g5Game.toggleSound();
}
public function initG5(_arg1:Number, _arg2:G5Game):void{
if (_arg2.debug){
trace("[G5 DEBUG] - initG5");
};
this.gameId = _arg1;
this.g5Game = _arg2;
aslForm = new ASLForm(this);
movSplash.gotoAndStop(1);
movTeaser.gotoAndStop(1);
movSplash["btnUrl"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
movTeaser["OriginalSkip"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
if (!_arg2.skip){
getConfigProps();
} else {
configComplete();
};
}
public function isMochiEnabled():Boolean{
return (this.mochiEnabled);
}
public function getGameCode():String{
return (this.gameCode);
}
}
}//package com.morpheme.g5
Section 3
//G5Framework_SplashScreen (com.morpheme.g5.G5Framework_SplashScreen)
package com.morpheme.g5 {
import flash.display.*;
import mx.core.*;
public class G5Framework_SplashScreen extends MovieClipAsset {
public var movSex2:DisplayObject;
public var movAge1:DisplayObject;
public var movAge3:DisplayObject;
public var movAge4:DisplayObject;
public var movAge5:DisplayObject;
public var movAge6:DisplayObject;
public var movAge2:DisplayObject;
public var movAge7:DisplayObject;
public var hand:DisplayObject;
public var btnUrl:DisplayObject;
public var btnSkip:DisplayObject;
public var btnDone:DisplayObject;
public var movSex1:DisplayObject;
}
}//package com.morpheme.g5
Section 4
//G5Framework_TeaserScreen (com.morpheme.g5.G5Framework_TeaserScreen)
package com.morpheme.g5 {
import flash.display.*;
import mx.core.*;
public class G5Framework_TeaserScreen extends MovieClipAsset {
public var movSex2:DisplayObject;
public var movAge1:DisplayObject;
public var movAge3:DisplayObject;
public var movAge4:DisplayObject;
public var movAge5:DisplayObject;
public var movAge6:DisplayObject;
public var movAge7:DisplayObject;
public var AGhome01:DisplayObject;
public var movAge2:DisplayObject;
public var OriginalSkip:DisplayObject;
public var hand:DisplayObject;
public var btnUrl:DisplayObject;
public var btnSkip:DisplayObject;
public var btnDone:DisplayObject;
public var movSex1:DisplayObject;
}
}//package com.morpheme.g5
Section 5
//G5Game (com.morpheme.g5.G5Game)
package com.morpheme.g5 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class G5Game extends MovieClip {
private var g5Game:G5Game;// = null
private var hiScores:HiScores;
private var movTeaser:MovieClip;// = null
public var swfHeight:Number;// = 0
public var debug:Boolean;// = false
private var loader:G5Preloader;// = null
private var movSplash:MovieClip;// = null
public var swfWidth:Number;// = 0
protected var g5:G5Framework;
private var gameId:Number;// = 0
public var skip:Boolean;// = false
public static const SURVEY_ON:Boolean = true;
public static const TEASER_OFF:Boolean = false;
public static const SURVEY_OFF:Boolean = false;
public static const TEASER_ON:Boolean = true;
public static const MOCHI_AD_OFF:Boolean = false;
public static const IGA_OFF:Boolean = false;
public static const IGA_ON:Boolean = true;
public static const MOCHI_AD_ON:Boolean = true;
public function G5Game(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:G5Game, _arg5:Boolean){
g5 = new G5Framework();
hiScores = new HiScores();
super();
this.gameId = _arg1;
this.swfWidth = _arg2;
this.swfHeight = _arg3;
this.g5Game = _arg4;
this.debug = _arg5;
}
public function hiScoreDataLoaded(_arg1:Array):void{
}
public function exitHiScoresScreen():void{
removeHiScores();
advertFinished();
}
public function advertStarted():void{
}
public function showSplashScreen(_arg1:MovieClip):void{
if (debug){
trace("[G5 DEBUG] - showSplashScreen");
};
this.movSplash = _arg1;
this.movSplash.x = ((this.swfWidth - _arg1.width) / 2);
this.movSplash.y = ((this.swfHeight - _arg1.height) / 2);
this.movSplash.addEventListener(Event.ENTER_FRAME, splashEnterFrame);
addChild(this.movSplash);
this.movSplash.gotoAndPlay(1);
}
public function showMenuScreen():void{
}
private function showAd():void{
if (debug){
trace("[G5 DEBUG] - showAd");
};
if (g5.isMochiEnabled()){
MochiAd.showTimedAd({id:g5.getMochiAdId(), res:((this.swfWidth + "x") + this.swfHeight), clip:this, ad_started:advertStarted, ad_finished:advertFinished});
} else {
advertFinished();
};
}
public function removePreloader():void{
loader.removeLoader();
}
public function getHiScoreDataHandler(_arg1:Event):void{
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local7:HiScoreRow;
var _local2:Array = new Array();
var _local3:URLLoader = URLLoader(_arg1.target);
if (_local3.data.err == undefined){
_local4 = _local3.data.res.split(G5Framework.HS_DATA_DELIM_ROW);
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split(G5Framework.HS_DATA_DELIM_COL);
if (_local6[1] != null){
_local7 = new HiScoreRow();
_local7.setLevelId(_local6[0]);
_local7.setName(_local6[1]);
_local7.setScore(_local6[2]);
_local2.push(_local7);
};
_local5++;
};
hiScoreDataLoaded(_local2);
} else {
getHiScoreDataError(null);
};
}
public function advertFinished():void{
showMenuScreen();
}
public function preloadComplete(_arg1:G5Preloader):void{
if (debug){
trace("[G5 DEBUG] - preloadComplete");
};
this.loader = _arg1;
g5.initG5(this.gameId, this.g5Game);
}
public function getHiScoreDataError(_arg1:IOErrorEvent):void{
trace("[G5 ERROR] - getHiScoreDataError");
}
public function teaserEnterFrame(_arg1:Event):void{
if ((((this.movTeaser.currentFrame == this.movTeaser.totalFrames)) || (g5.teaserSkipped))){
this.movTeaser.removeEventListener(Event.ENTER_FRAME, teaserEnterFrame);
this.movTeaser.stop();
if (g5.teaserSkipped){
g5.teaserComplete(null);
} else {
g5.teaserPause();
};
};
}
public function showTitleScreen():void{
}
public function manualConfig(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean, _arg7:String, _arg8:String):void{
this.skip = true;
g5.setConfigProps(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function initGame():void{
}
public function toggleSound():void{
}
public function removeHiScores():void{
try {
removeChild(hiScores);
} catch(error:Error) {
};
}
public function initHiScores(_arg1:Number, _arg2:Boolean, _arg3:Number, _arg4:String, _arg5:String, _arg6:Number, _arg7:Number):void{
if (debug){
trace("[G5 DEBUG] - initHiScores");
};
hiScores.setDetails(g5.getGameId(), _arg1, g5.getGameCode(), _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
addChild(hiScores);
}
public function exitTitleScreen():void{
showAd();
}
public function trackMochi():void{
MochiBot.track(this.loader, g5.getMochiBotId());
}
public function showTeaserScreen(_arg1:MovieClip):void{
if (debug){
trace("[G5 DEBUG] - showTeaserScreen");
};
this.movTeaser = _arg1;
this.movTeaser.x = 0;
this.movTeaser.y = 0;
this.movTeaser.width = swfWidth;
this.movTeaser.height = swfHeight;
this.movTeaser.addEventListener(Event.ENTER_FRAME, teaserEnterFrame);
addChild(this.movTeaser);
this.movTeaser.gotoAndPlay(1);
}
public function splashEnterFrame(_arg1:Event):void{
if (this.movSplash.currentFrame == this.movSplash.totalFrames){
this.movSplash.removeEventListener(Event.ENTER_FRAME, splashEnterFrame);
this.movSplash.stop();
removeChild(this.movSplash);
g5.splashComplete();
};
}
public function getHiScoreData(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean):void{
var _local7:URLVariables;
var _local8:URLRequest;
var _local9:URLLoader;
if (debug){
trace("[G5 DEBUG] - getHiScoreData");
};
var _local6:Number = (((_arg2 + 1) - _arg1) * ((_arg4 + 1) - _arg3));
if (_local6 <= 100){
_local7 = new URLVariables();
_local7.op = G5Framework.OP_HS_GET_DATA;
_local7.gameId = gameId;
_local7.startPos = _arg1;
_local7.endPos = _arg2;
_local7.startLevel = _arg3;
_local7.endLevel = _arg4;
_local7.lowIsBest = _arg5;
_local8 = new URLRequest(G5Framework.HS_SERVLET_URL);
_local9 = new URLLoader();
_local9.dataFormat = URLLoaderDataFormat.VARIABLES;
_local8.data = _local7;
_local8.method = URLRequestMethod.POST;
_local9.addEventListener(Event.COMPLETE, getHiScoreDataHandler);
_local9.addEventListener(IOErrorEvent.IO_ERROR, getHiScoreDataError);
_local9.load(_local8);
} else {
trace("[G5 ERROR] - 100 row max per request");
};
}
}
}//package com.morpheme.g5
Section 6
//G5Preloader (com.morpheme.g5.G5Preloader)
package com.morpheme.g5 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class G5Preloader extends MovieClip {
private var G5Loader:Class;
private var swfWidth:Number;// = 0
private var percent:Number;// = 0
private var movLoader:Sprite;
private var swfHeight:Number;// = 0
private var mainClassName:String;// = ""
private var barWidth:Number;// = 0
public function G5Preloader(_arg1:String, _arg2:Number, _arg3:Number){
G5Loader = G5Preloader_G5Loader;
movLoader = new G5Loader();
super();
this.mainClassName = _arg1;
this.swfWidth = _arg2;
this.swfHeight = _arg3;
stop();
movLoader.x = ((this.swfWidth - movLoader.width) / 2);
movLoader.y = ((this.swfHeight - movLoader.height) / 2);
addChild(movLoader);
barWidth = movLoader["movLoadingBar"].width;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
movLoader["btnUrl"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
}
private function init():void{
var _local2:Object;
var _local1:Class = Class(getDefinitionByName(mainClassName));
if (_local1){
_local2 = new _local1(this.swfWidth, this.swfHeight);
addChild((_local2 as DisplayObject));
_local2.preloadComplete(this);
};
}
public function removeLoader():void{
removeChild(movLoader);
}
public function onButtonPress(_arg1:MouseEvent):void{
var _local2:URLRequest;
switch (_arg1.target.name){
case "btnUrl":
_local2 = new URLRequest(G5Framework.SERVER_URL);
navigateToURL(_local2, "_blank");
break;
};
}
public function onEnterFrame(_arg1:Event):void{
if (framesLoaded == totalFrames){
movLoader["movLoadingBar"].width = barWidth;
movLoader["txtPercent"].text = "100% loaded";
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
nextFrame();
init();
} else {
percent = Math.round(((root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal) * 100));
movLoader["movLoadingBar"].width = Math.round((percent * (barWidth / 100)));
movLoader["txtPercent"].text = (percent + "% loaded");
};
}
}
}//package com.morpheme.g5
Section 7
//G5Preloader_G5Loader (com.morpheme.g5.G5Preloader_G5Loader)
package com.morpheme.g5 {
import flash.display.*;
import mx.core.*;
public class G5Preloader_G5Loader extends SpriteAsset {
public var movSex2:DisplayObject;
public var AGhome01:DisplayObject;
public var movAge3:DisplayObject;
public var movAge4:DisplayObject;
public var movAge5:DisplayObject;
public var movAge6:DisplayObject;
public var movAge7:DisplayObject;
public var movAge1:DisplayObject;
public var movAge2:DisplayObject;
public var OriginalSkip:DisplayObject;
public var movLoadingBar:DisplayObject;
public var hand:DisplayObject;
public var btnUrl:DisplayObject;
public var txtPercent:DisplayObject;
public var btnSkip:DisplayObject;
public var btnDone:DisplayObject;
public var movSex1:DisplayObject;
}
}//package com.morpheme.g5
Section 8
//HiScoreRow (com.morpheme.g5.HiScoreRow)
package com.morpheme.g5 {
public class HiScoreRow {
private var name:String;// = ""
private var score:Number;// = 0
private var levelId:Number;// = 0
public function getName():String{
return (this.name);
}
public function getLevelId():Number{
return (this.levelId);
}
public function setName(_arg1:String):void{
this.name = _arg1;
}
public function setScore(_arg1:Number):void{
this.score = _arg1;
}
public function getScore():Number{
return (this.score);
}
public function setLevelId(_arg1:Number):void{
this.levelId = _arg1;
}
}
}//package com.morpheme.g5
Section 9
//HiScores (com.morpheme.g5.HiScores)
package com.morpheme.g5 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class HiScores extends MovieClip {
private var levelId:Number;
private var KEY:String;// = "rocket"
private var score:Number;
private var lowIsBest:Boolean;
private var gameId:Number;
private var infoScreen:MovieClip;// = null
private var entryScreen:MovieClip;// = null
private var gameCode:String;
public function HiScores(){
this.visible = false;
}
public function setDetails(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean, _arg5:Number, _arg6:String, _arg7:String, _arg8:Number, _arg9:Number):void{
this.gameId = _arg1;
this.levelId = _arg2;
this.gameCode = _arg3;
this.lowIsBest = _arg4;
this.score = _arg5;
this.infoScreen = this["movInfoScreen"];
this.entryScreen = this["movEntryScreen"];
entryScreen["txtMsg1"].text = _arg6;
entryScreen["txtMsg2"].text = _arg7;
entryScreen["txtName"].text = "";
entryScreen["txtCode"].text = "";
entryScreen.visible = true;
infoScreen.visible = false;
secCodeLoad();
entryScreen["btnRefreshCode"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnView"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnBack"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
this.x = _arg8;
this.y = _arg9;
this.visible = true;
}
public function showInfoMessage(_arg1:String, _arg2:Boolean):void{
infoScreen["txtInfo"].text = _arg1;
infoScreen["btnBack"].visible = _arg2;
infoScreen["btnView"].visible = !(_arg2);
}
public function submitDetails():void{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:URLVariables;
var _local7:URLRequest;
var _local8:URLLoader;
entryScreen.visible = false;
infoScreen.visible = true;
var _local1:Boolean;
if (entryScreen["txtName"].text.length == 0){
showInfoMessage("Please enter your name.", true);
} else {
if (entryScreen["txtCode"].text.length != 5){
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
infoScreen["btnBack"].visible = false;
_local1 = false;
};
};
if (!_local1){
_local2 = ((((((((("save|" + entryScreen["txtName"].text) + "|") + entryScreen["txtCode"].text) + "|") + score) + "|") + gameId) + "|") + levelId);
_local3 = "";
_local4 = 0;
_local5 = 0;
while (_local4 < _local2.length) {
if (_local5 >= KEY.length){
_local5 = 0;
};
_local3 = (_local3 + String.fromCharCode(((_local2.charCodeAt(_local4) ^ KEY.charCodeAt(_local5)) + 1)));
_local4++;
_local5++;
};
_local6 = new URLVariables();
_local6.ffdata = _local3;
_local6.lowIsBest = lowIsBest;
_local7 = new URLRequest(G5Framework.HS_SERVLET_URL);
_local8 = new URLLoader();
_local8.dataFormat = URLLoaderDataFormat.VARIABLES;
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
_local8.addEventListener(Event.COMPLETE, submitHiScoreHandler);
_local8.addEventListener(IOErrorEvent.IO_ERROR, submitHiScoreError);
_local8.load(_local7);
};
}
public function secCodeLoadError(_arg1:IOErrorEvent):void{
entryScreen.visible = false;
infoScreen.visible = true;
showInfoMessage("Could not generate a security code. Click on back and try to refresh the code window.", true);
}
public function onButtonPress(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "btnRefreshCode":
secCodeLoad();
break;
case "btnSubmit":
submitDetails();
break;
case "btnView":
viewScore();
break;
case "btnBack":
back();
break;
};
}
public function back():void{
entryScreen.visible = true;
infoScreen.visible = false;
}
public function secCodeLoad():void{
var _local1:Loader = new Loader();
_local1.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, secCodeLoadError);
var _local2:String = ((G5Framework.HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime());
_local1.load(new URLRequest(_local2));
entryScreen["movCode"].addChild(_local1);
}
public function submitHiScoreError(_arg1:IOErrorEvent):void{
showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
}
public function submitHiScoreHandler(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
var _local3:Number = _local2.data.res;
if (_local3 == -1){
showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else {
if (_local3 == 0){
showInfoMessage("Sorry, a better score already exists with that name.", false);
} else {
if (_local3 == 1){
showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
};
};
};
}
public function viewScore():void{
var _local1:URLRequest = new URLRequest(((((((((G5Framework.INDEX_URL + gameCode) + "_hs") + "&name=") + entryScreen["txtName"].text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
navigateToURL(_local1, "_blank");
}
}
}//package com.morpheme.g5
Section 10
//MochiAd (com.morpheme.g5.MochiAd)
package com.morpheme.g5 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("1.5");
}
public static function showTimedAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
}, ad_finished:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local2:MovieClip;
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_local2 = this.parent.parent;
MochiAd.unload(_local2);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function load(_arg1:Object):MovieClip{
var mc:MovieClip;
var k:String;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
var clip:Object = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
if (clip.loaderInfo.loaderURL.indexOf("http") != 0){
options.no_page = true;
};
var server:String = lv.server;
delete lv.server;
var hostname:String = _allowDomains(server);
mc["onEnterFrame"] = function ():void{
if (!this._mochiad_ctr){
delete this["onEnterFrame"];
MochiAd.unload(this.parent);
};
};
doOnEnterFrame(mc);
var lc:LocalConnection = new LocalConnection();
lc.client = mc;
var name:String = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
var loader:Loader = new Loader();
var f:Function = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var req:URLRequest = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var mc:MovieClip;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
var DEFAULTS:Object = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
var clip:Object = options.clip;
var clipname:String = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
var server:String = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
var lv:URLVariables = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
_arg1 = parseInt(_arg1.toString());
var _local3:Array = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
var _local4:Array = [];
var _local5:Number = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
var _local6:Object = _local3[1];
var _local7:Object = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local5:Array;
mc._endpoint = _arg1;
var _local2:Array = mc._queue;
delete mc._queue;
var _local3:Function = mc.doSend;
var _local4:Number = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
var _local5:Number = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
var _local6:LocalConnection = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreloaderAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local2:MovieClip;
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_local2 = this.parent.parent;
MochiAd.unload(_local2);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local11:Number;
var _local1:Object = this.parent.parent.root;
if (!_local1){
delete this["onEnterFrame"];
return;
};
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
var _local7:Number = ((100 * _local6) / _local5);
var _local8:Number = ((100 * _local3) / chk.ad_msec);
var _local9:Object = this._mochiad_bar._inside;
var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if ((((((_local5 > 0)) && ((_local6 >= _local5)))) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package com.morpheme.g5
Section 11
//MochiBot (com.morpheme.g5.MochiBot)
package com.morpheme.g5 {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package com.morpheme.g5
Section 12
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 13
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 14
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 15
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexSprite(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 16
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 17
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 18
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 19
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 20
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 21
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 22
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 23
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function SpriteAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 24
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 25
//BitmapFont (BitmapFont)
package {
public class BitmapFont {
var gaWidth:Array;
var gCharOffset:int;
var gSineDelayFrames:int;
var gSpacing:int;
var gSineDir:int;
var gSineMaxY:int;
var gHeight:int;
var gSineDY:int;
var gCharIndex:Array;
var gSineFrame:int;
var gPlatform:Platform;
var gSpriteFont:CheekySprite;
public function BitmapFont(_arg1, _arg2:Array, _arg3:Array, _arg4:int, _arg5:int, _arg6:int, _arg7:Object){
var _local8:int;
super();
gPlatform = _arg1;
_local8 = _arg3.length;
gaWidth = new Array(_local8);
var _local9:* = 0;
while (_local9 < _local8) {
gaWidth[_local9] = _arg3[_local9];
_local9++;
};
gSpacing = _arg4;
gHeight = _arg6;
setCharMap(_arg2);
gSpriteFont = new CheekySprite(_arg1, _arg7, _arg5, _arg6);
}
public function drawSineString(_arg1:String, _arg2:int, _arg3:int, _arg4, _arg5:Boolean){
drawStringFull(_arg1, _arg2, _arg3, _arg4, _arg5, true);
}
public function setCharSpacing(_arg1:int){
gSpacing = _arg1;
}
public function getStringLength(_arg1:String):Number{
var _local2:*;
var _local5:*;
var _local3:* = 0;
var _local4:* = _arg1.length;
_local2 = 0;
while (_local2 < _local4) {
_local5 = _arg1.charAt(_local2);
_local3 = (_local3 + ((_arg1.charAt(_local2))==" ") ? gSpacing : gaWidth[gCharIndex[(_arg1.charCodeAt(_local2) - gCharOffset)]]);
_local2++;
};
return (_local3);
}
public function paintString(_arg1:String, _arg2:int, _arg3:int, _arg4:Boolean){
var _local5:*;
var _local6:*;
var _local7:*;
var _local10:*;
var _local8:* = _arg1.length;
_local6 = gSineDY;
_local7 = gSineDir;
var _local9:* = 0;
while (_local9 < _local8) {
_local10 = _arg1.charAt(_local9);
if (_local10 == " "){
_arg2 = (_arg2 + gSpacing);
} else {
if (_arg4){
_local6 = (_local6 + _local7);
if (gPlatform.abs(_local6) == gSineMaxY){
_local7 = -(_local7);
};
gSpriteFont.setPosition(_arg2, (_arg3 + _local6));
} else {
gSpriteFont.setPosition(_arg2, _arg3);
};
_local5 = gCharIndex[(_arg1.charCodeAt(_local9) - gCharOffset)];
gSpriteFont.setFrame(_local5);
gSpriteFont.paint();
_arg2 = (_arg2 + gaWidth[_local5]);
};
_local9++;
};
}
public function setSineProperties(_arg1, _arg2, _arg3){
gSineFrame = 0;
gSineDY = 0;
gSineMaxY = _arg2;
gSineDelayFrames = _arg3;
gSineDir = _arg1;
}
public function setCharMap(_arg1:Array){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local4 = _arg1.length;
_local6 = _arg1[0];
_local5 = _local6;
_local3 = 0;
while (_local3 < _local4) {
_local2 = _arg1[_local3];
if (_local2 < _local5){
_local5 = _local2;
} else {
if (_local2 > _local6){
_local6 = _local2;
};
};
_local3++;
};
gCharOffset = _local5.charCodeAt(0);
gCharIndex = new Array(((_local6.charCodeAt(0) - gCharOffset) + 1));
_local3 = 0;
while (_local3 < _local4) {
gCharIndex[(_arg1[_local3].charCodeAt(0) - gCharOffset)] = _local3;
_local3++;
};
}
public function setCharWidths(_arg1:Array){
var _local2:int = _arg1.length;
gaWidth = new Array(_local2);
var _local3:* = 0;
while (_local3 < _local2) {
gaWidth[_local3] = _arg1[_local3];
_local3++;
};
}
public function updateSineString(){
gSineFrame++;
if (gSineFrame == gSineDelayFrames){
gSineFrame = 0;
gSineDY = (gSineDY + gSineDir);
if (gPlatform.abs(gSineDY) == gSineMaxY){
gSineDir = -(gSineDir);
};
};
}
public function drawStringFull(_arg1:String, _arg2:int, _arg3:int, _arg4, _arg5:Boolean, _arg6:Boolean){
_arg1 = _arg1.toUpperCase();
if ((_arg4 & Platform.BOTTOM) != 0){
_arg3 = (_arg3 + gHeight);
} else {
if ((_arg4 & Platform.VCENTER) != 0){
_arg3 = (_arg3 + (gHeight >> 1));
};
};
if ((_arg4 & Platform.HCENTER) != 0){
_arg2 = (_arg2 - (getStringLength(_arg1) >> 1));
} else {
if ((_arg4 & Platform.RIGHT) != 0){
_arg2 = (_arg2 - getStringLength(_arg1));
};
};
paintString(_arg1, _arg2, _arg3, _arg6);
}
public function drawString(_arg1:String, _arg2:int, _arg3:int, _arg4, _arg5:Boolean){
drawStringFull(_arg1, _arg2, _arg3, _arg4, _arg5, false);
}
}
}//package
Section 26
//CheekySprite (CheekySprite)
package {
import flash.display.*;
public class CheekySprite {
var gPlatform:Platform;
var gnFrame:int;// = 0
var gX:int;
var gY:int;// = 0
var gnFramesAcross:int;// = 0
var gbVisible:Boolean;
var gWidth:int;// = 0
var gaSeq:Array;
var giFrame:int;// = 0
var gHeight:int;// = 0
var gnFramesDown:int;// = 0
var gLayout:int;// = 0
var gImage:BitmapData;
var gAlpha:int;// = 0
var gRotate:int;// = 0
static var SPRITE_LAYOUT_HORIZ = 2;
static var SPRITE_LAYOUT_LUMP = 3;
static var SPRITE_LAYOUT_VERT = 1;
public function CheekySprite(_arg1, _arg2:Object, _arg3:int, _arg4:int){
gPlatform = _arg1;
gbVisible = true;
gaSeq = null;
gRotate = 0;
gAlpha = 0xFF;
gnFrame = 0;
giFrame = 0;
setImage(_arg2, _arg3, _arg4);
}
public function setRotation(_arg1:int){
gRotate = _arg1;
}
public function getX():int{
return (gX);
}
public function setPosition(_arg1:int, _arg2:int){
gX = _arg1;
gY = _arg2;
}
public function nextFrame(){
if (giFrame < (gnFrame - 1)){
giFrame++;
} else {
giFrame = 0;
};
}
public function getFrame():Number{
return (giFrame);
}
public function setImage(_arg1:Object, _arg2:int, _arg3:int){
var _local4:int;
var _local5:int;
gImage = BitmapData(_arg1);
gWidth = _arg2;
gHeight = _arg3;
_local4 = gImage.width;
_local5 = gImage.height;
if ((((_local4 > _arg2)) && ((_local5 > _arg3)))){
gLayout = SPRITE_LAYOUT_LUMP;
gnFramesAcross = (_local4 / _arg2);
gnFramesDown = (_local5 / _arg3);
if (gaSeq == null){
gnFrame = (gnFramesAcross * gnFramesDown);
};
} else {
if (_local5 > _arg3){
gLayout = SPRITE_LAYOUT_VERT;
if (gaSeq == null){
gnFrame = (_local5 / _arg3);
};
} else {
gLayout = SPRITE_LAYOUT_HORIZ;
if (gaSeq == null){
gnFrame = (_local4 / _arg2);
};
};
};
}
public function getY():int{
return (gY);
}
public function getNumFrames():Number{
return (gnFrame);
}
public function setAlpha(_arg1:int){
gAlpha = _arg1;
}
public function prevFrame(){
if (giFrame == 0){
giFrame = (gnFrame - 1);
} else {
giFrame--;
};
}
public function getImage():Object{
return (Object(gImage));
}
public function paint(){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Boolean;
var _local1:int;
if (gbVisible == false){
return;
};
if (gaSeq != null){
_local1 = gaSeq[giFrame];
} else {
_local1 = giFrame;
};
switch (gLayout){
case SPRITE_LAYOUT_VERT:
if (gRotate > 0){
_local2 = 0;
_local3 = (gHeight * _local1);
_local4 = gWidth;
_local5 = gHeight;
_local6 = false;
if ((gRotate & Platform.SPRITE_FLIP_HORIZ) > 0){
_local2 = gWidth;
_local4 = -(gWidth);
_local6 = true;
};
if ((gRotate & Platform.SPRITE_FLIP_VERT) > 0){
_local3 = (_local3 + gHeight);
_local5 = -(gHeight);
_local6 = true;
};
if (_local6){
gPlatform.drawRegion(gImage, _local2, _local3, _local4, _local5, gX, gY, 0, gAlpha);
} else {
gPlatform.drawRegion(gImage, 0, (gHeight * _local1), gWidth, gHeight, gX, gY, gRotate, gAlpha);
};
} else {
gPlatform.drawRegion(gImage, 0, (gHeight * _local1), gWidth, gHeight, gX, gY, gRotate, gAlpha);
};
break;
case SPRITE_LAYOUT_HORIZ:
gPlatform.drawRegion(gImage, (gWidth * _local1), 0, gWidth, gHeight, gX, gY, gRotate, gAlpha);
break;
case SPRITE_LAYOUT_LUMP:
gPlatform.drawRegion(gImage, (gWidth * (_local1 % gnFramesAcross)), (gHeight * Math.floor((_local1 / gnFramesAcross))), gWidth, gHeight, gX, gY, gRotate, gAlpha);
break;
};
}
public function setVisible(_arg1:Boolean){
gbVisible = _arg1;
}
public function setFrame(_arg1:int){
giFrame = _arg1;
}
public function setFrameSequence(_arg1:Array){
gaSeq = _arg1;
giFrame = 0;
if (_arg1 == null){
switch (gLayout){
case SPRITE_LAYOUT_VERT:
gnFrame = (gImage.height / gHeight);
break;
case SPRITE_LAYOUT_HORIZ:
gnFrame = (gImage.width / gWidth);
break;
case SPRITE_LAYOUT_LUMP:
gnFrame = (gnFramesAcross * gnFramesDown);
break;
};
} else {
gnFrame = _arg1.length;
};
}
}
}//package
Section 27
//FixedMath (FixedMath)
package {
public class FixedMath {
var m_aSinValues:Array;
public function FixedMath(){
m_aSinValues = [0, 17, 35, 53, 71, 89, 107, 125, 142, 160, 178, 195, 213, 230, 248, 265, 283, 300, 317, 334, 351, 367, 384, 401, 417, 433, 450, 466, 481, 497, 513, 528, 543, 559, 574, 588, 603, 617, 631, 645, 659, 673, 686, 699, 712, 725, 738, 750, 762, 774, 786, 797, 808, 819, 830, 840, 850, 860, 869, 879, 888, 897, 905, 913, 921, 929, 936, 943, 950, 957, 963, 969, 974, 980, 985, 990, 994, 998, 1002, 1005, 1009, 1012, 1014, 1016, 1018, 1020, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1022, 1021, 1019, 1017, 1015, 1013, 1010, 1007, 1004, 1000, 996, 992, 987, 982, 977, 972, 966, 960, 953, 947, 940, 933, 925, 917, 909, 901, 892, 883, 874, 865, 855, 845, 835, 824, 813, 802, 791, 780, 0x0300, 756, 744, 731, 719, 706, 693, 680, 666, 652, 638, 624, 610, 596, 581, 566, 551, 536, 521, 505, 489, 474, 458, 441, 425, 409, 392, 376, 359, 342, 325, 308, 291, 274, 0x0101, 239, 222, 204, 187, 169, 151, 134, 116, 98, 80, 62, 44, 26, 8, 0, -26, -44, -62, -80, -98, -116, -134, -151, -169, -187, -204, -222, -239, -257, -274, -291, -308, -325, -342, -359, -376, -392, -409, -425, -441, -458, -474, -489, -505, -521, -536, -551, -566, -581, -596, -610, -624, -638, -652, -666, -680, -693, -706, -719, -731, -744, -756, -768, -780, -791, -802, -813, -824, -835, -845, -855, -865, -874, -883, -892, -901, -909, -917, -925, -933, -940, -947, -953, -960, -966, -972, -977, -982, -987, -992, -996, -1000, -1004, -1007, -1010, -1013, -1015, -1017, -1019, -1021, -1022, -1023, -1023, -1023, -1023, -1023, -1022, -1021, -1020, -1018, -1016, -1014, -1012, -1009, -1005, -1002, -998, -994, -990, -985, -980, -974, -969, -963, -957, -950, -943, -936, -929, -921, -913, -905, -897, -888, -879, -869, -860, -850, -840, -830, -819, -808, -797, -786, -774, -762, -750, -738, -725, -712, -699, -686, -673, -659, -645, -631, -617, -603, -588, -574, -559, -543, -528, -513, -497, -481, -466, -450, -433, -417, -401, -384, -367, -351, -334, -317, -300, -283, -265, -248, -230, -213, -195, -178, -160, -142, -125, -107, -89, -71, -53, -35, -17, 0];
super();
}
public function atan(_arg1:int):int{
if (_arg1 > Platform.DEFAULTMATHSCALE){
return (((Platform.PI / 2) - atan(((Platform.DEFAULTMATHSCALE * Platform.DEFAULTMATHSCALE) / _arg1))));
};
if (_arg1 < -(Platform.DEFAULTMATHSCALE)){
return (((-(Platform.PI) / 2) - atan(((Platform.DEFAULTMATHSCALE * Platform.DEFAULTMATHSCALE) / _arg1))));
};
var _local2 = 65536;
var _local3:int = ((_arg1 * _local2) / Platform.DEFAULTMATHSCALE);
var _local4:int = ((_local3 * _local3) / _local2);
var _local5 = 1365;
_local5 = ((_local5 * _local4) / _local2);
_local5 = (_local5 - 5579);
_local5 = ((_local5 * _local4) / _local2);
_local5 = (_local5 + 11805);
_local5 = ((_local5 * _local4) / _local2);
_local5 = (_local5 - 21646);
_local5 = ((_local5 * _local4) / _local2);
_local5 = (_local5 + 65527);
_local5 = ((_local5 * _local3) / _local2);
_local5 = ((_local5 * Platform.DEFAULTMATHSCALE) / _local2);
return (_local5);
}
public function tan(_arg1:int):int{
var _local4:int;
var _local2:int = sin(_arg1);
var _local3:int = cos(_arg1);
if (_local3 == 0){
if (_local2 > 0){
_local4 = Number.MAX_VALUE;
} else {
_local4 = Number.MIN_VALUE;
};
} else {
_local4 = ((_local2 * Platform.DEFAULTMATHSCALE) / _local3);
};
return (_local4);
}
public function random(_arg1:int):int{
return (Math.floor((Math.random() * _arg1)));
}
public function rand(){
}
public function cos(_arg1:int):int{
_arg1 = angleToTableIndex((_arg1 + (Platform.PI / 2)));
return (m_aSinValues[_arg1]);
}
public function sqrt(_arg1:int):int{
return (Math.sqrt(_arg1));
}
public function abs(_arg1):int{
if (_arg1 < 0){
return (-(_arg1));
};
return (_arg1);
}
public function srand(_arg1:int){
}
public function angleToTableIndex(_arg1:int):int{
var _local2:int = m_aSinValues.length;
_arg1 = ((_arg1 * _local2) / (Platform.PI << 1));
_arg1 = (_arg1 % _local2);
if (_arg1 < 0){
_arg1 = (_arg1 + _local2);
};
return (_arg1);
}
public function getAngleXY(_arg1:int, _arg2:int):int{
if (_arg2 == 0){
return (((_arg1)>0) ? (Platform.PI >> 1) : Platform.PI_1DOT5);
};
if (_arg1 == 0){
return (((_arg2)<0) ? 0 : Platform.PI);
};
var _local3:int = atan(((_arg1 * Platform.DEFAULTMATHSCALE) / _arg2));
if ((((((_arg1 > 0)) && ((_arg2 < 0)))) || ((((_arg1 < 0)) && ((_arg2 < 0)))))){
_local3 = (_local3 + Platform.PI);
} else {
if ((((_arg1 < 0)) && ((_arg2 > 0)))){
_local3 = (_local3 + (Platform.PI << 1));
};
};
return (_local3);
}
public function sin(_arg1:int):int{
_arg1 = angleToTableIndex(_arg1);
return (m_aSinValues[_arg1]);
}
}
}//package
Section 28
//Game (Game)
package {
import flash.utils.*;
public class Game {
private var gFacebookScoreTimer:int;// = 0
private var giScreenNext;
public var gMusicTitle:Object;// = null
public var gbMusic:Boolean;
public var gBMPFontMenu:Object;
private var gaStringsPauseMenu:Array;
private var giBigLumpLoadStage;
public var gMusicGame:Object;// = null
public var TOTAL_LOAD_STAGES;
public var gbVibrate:Boolean;
public var gImgCredits:Object;
private var gaStringsMainMenu:Array;
public var gImgMouse;
private var gaStringsYesNoMenu:Array;
private var gaStringsCredits:Array;
private var giMouseLoadStage;
public var gbMouseClicked:Boolean;// = false
public var gbKeyUp:Boolean;
private var giStrings;
public var gImgHelp:Array;
public var gbKeyDown:Boolean;
public var gSpriteSoftkey:Object;
public var gImgFont:Object;
private var giHighScore;// = -1
private var gLastMouseX:int;// = -1
private var gLastMouseY:int;// = -1
public var gbBitmapHelp:Boolean;
public var gbBitmapCredits:Boolean;
private var gbToggleSound:Boolean;// = true
public var gbBitmapFont:Boolean;
private var gaSFX:Array;
public var gImgMenu:Object;
public var gImgSplash:Object;
public var gDigitSprite:Object;
public var STAGE_LOAD_MUSIC;
public var gImgSoftkey:Object;
private var giLoadSFX;// = 0
public var gImgLogoCheeky:Object;
private var giScreenAfterLoad;
private var giLocaleTmp;// = 0
public var gImgInstructions:Object;
public var gbKeySelect:Boolean;
private var gaStringsHelp:Array;
public var gbSFX:Boolean;
public var gbKeyLeft:Boolean;
public var gImgLogoG5:Object;
private var gFontHelp:Object;
private var gaStringsPlayAgainMenu:Array;
private var gaStringsOptionsMenu:Array;
private var gMain:Gridrunner;
public var STAGE_LOAD_SFX;
public var gImgLogoLlama:Object;
private var giMenuItemSelected;// = 0
public var gbKeyPause:Boolean;
private var gFontMenu:Object;
private var giLocale;// = 0
public var gaHighScores:Array;
private var giScreen;
private var giLoadStage;// = 0
public var STAGE_LOAD_LANGUAGE;
public var gbKeyRight:Boolean;
public var gSpriteMouse;
private var gPlatform:Platform;
private var giScreenTimer;// = 0
public static var DIGIT_WIDTHS:Array = [Prefs.DIGIT_WIDTH_0, Prefs.DIGIT_WIDTH_1, Prefs.DIGIT_WIDTH_2, Prefs.DIGIT_WIDTH_3, Prefs.DIGIT_WIDTH_4, Prefs.DIGIT_WIDTH_5, Prefs.DIGIT_WIDTH_6, Prefs.DIGIT_WIDTH_7, Prefs.DIGIT_WIDTH_8, Prefs.DIGIT_WIDTH_9];
private static var FONT_CHARMAP:Array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ".", "5"];
private static var FONT_SPRITE_WIDTHS:Array = [Prefs.FONT_SPRITE_WIDTH_A, Prefs.FONT_SPRITE_WIDTH_B, Prefs.FONT_SPRITE_WIDTH_C, Prefs.FONT_SPRITE_WIDTH_D, Prefs.FONT_SPRITE_WIDTH_E, Prefs.FONT_SPRITE_WIDTH_F, Prefs.FONT_SPRITE_WIDTH_G, Prefs.FONT_SPRITE_WIDTH_H, Prefs.FONT_SPRITE_WIDTH_I, Prefs.FONT_SPRITE_WIDTH_J, Prefs.FONT_SPRITE_WIDTH_K, Prefs.FONT_SPRITE_WIDTH_L, Prefs.FONT_SPRITE_WIDTH_M, Prefs.FONT_SPRITE_WIDTH_N, Prefs.FONT_SPRITE_WIDTH_O, Prefs.FONT_SPRITE_WIDTH_P, Prefs.FONT_SPRITE_WIDTH_Q, Prefs.FONT_SPRITE_WIDTH_R, Prefs.FONT_SPRITE_WIDTH_S, Prefs.FONT_SPRITE_WIDTH_T, Prefs.FONT_SPRITE_WIDTH_U, Prefs.FONT_SPRITE_WIDTH_V, Prefs.FONT_SPRITE_WIDTH_W, Prefs.FONT_SPRITE_WIDTH_X, Prefs.FONT_SPRITE_WIDTH_Y, Prefs.FONT_SPRITE_WIDTH_Z, Prefs.FONT_SPRITE_WIDTH_DOT, Prefs.FONT_SPRITE_WIDTH_S];
private static var gaSFX_ID:Array = [Prefs.SFX_CUNT, Prefs.SFX_SHIT, Prefs.SFX_BOLLOCKS, Prefs.SFX_FUCK, Prefs.SFX_ZAP2, Prefs.SFX_FIRE, Prefs.SFX_KUNG, Prefs.SFX_HUM, Prefs.SFX_EXPLODE, Prefs.SFX_EXPLODE_1, Prefs.SFX_EXPLODE_2, Prefs.SFX_ZAPPO, Prefs.SFX_MADREZLO, Prefs.SFX_OOOH, Prefs.SFX_BADASS, Prefs.SFX_HAMSTER, Prefs.SFX_LEVEL_UP, Prefs.SFX_WARP, Prefs.SFX_BAA, Prefs.SFX_FLUFFY_SHEEPIE, Prefs.SFX_LOOK_A_SHEEPIE, Prefs.SFX_LOVELY_SHEEPIE, Prefs.SFX_ITS_FLOSSIE, Prefs.SFX_SHEEP_UP, Prefs.SFX_ULP, Prefs.SFX_ZAPHOD, Prefs.SFX_SHEEPIE_ZAPPER, Prefs.SFX_SHEEPIE_ILY, Prefs.SFX_SHEEPIE_JOY, Prefs.SFX_ZAPPER_RECHARGE, Prefs.SFX_ZAP];
public function Game(){
TOTAL_LOAD_STAGES = (Prefs.NUM_LOAD_STAGES + 6);
STAGE_LOAD_MUSIC = Prefs.NUM_LOAD_STAGES;
STAGE_LOAD_SFX = (STAGE_LOAD_MUSIC + 4);
STAGE_LOAD_LANGUAGE = (STAGE_LOAD_SFX + 1);
giScreen = Prefs.SCREEN_LOAD;
giScreenNext = Prefs.SCREEN_LOAD;
giScreenAfterLoad = Prefs.SCREEN_TITLE;
gbVibrate = Prefs.OPT_VIBRATE_ON;
gbBitmapFont = Prefs.BITMAP_FONT;
gbBitmapHelp = Prefs.BITMAP_HELP;
gbBitmapCredits = Prefs.BITMAP_CREDITS;
gbMusic = Prefs.OPT_MUSIC_ON;
gbSFX = Prefs.OPT_SFX_ON;
gImgHelp = new Array(Prefs.NUM_HELP_PAGES);
gaStringsHelp = new Array();
gaStringsMainMenu = new Array();
gaStringsPauseMenu = new Array();
gaStringsYesNoMenu = new Array();
gaStringsOptionsMenu = new Array();
gaStringsCredits = new Array();
gaStringsPlayAgainMenu = new Array();
gaHighScores = new Array(Prefs.NUM_HIGHSCORES);
gaSFX = new Array(Prefs.SFX_TOTAL_SFX);
giBigLumpLoadStage = (Prefs.BIG_LUMP) ? 1 : 0;
giMouseLoadStage = (Prefs.BITMAP_MOUSE) ? 1 : 0;
super();
}
private function processGame(){
if ((Prefs.REVERSE_SOFTKEYS) ? gbKeySelect : gbKeyPause){
gbKeyPause = false;
gbKeySelect = false;
setScreen(Prefs.SCREEN_PAUSE_MENU);
return;
};
gMain.main();
if (Prefs.FACEBOOK){
gFacebookScoreTimer++;
if (gFacebookScoreTimer > Prefs.FACEBOOK_UPDATE_FRAME){
gFacebookScoreTimer = 0;
gPlatform.updateFacebookScore(gMain.score);
};
};
}
private function paintHelpScreen(){
if ((((giScreen < Prefs.SCREEN_HELP_FIRST)) || ((giScreen >= (Prefs.SCREEN_HELP_FIRST + Prefs.NUM_HELP_PAGES))))){
return;
};
gMain.quickGR(false);
gPlatform.paintPixelBuffer();
gPlatform.drawImage(gImgInstructions, ((Prefs.SCREEN_WIDTH - gPlatform.getImageWidth(gImgInstructions)) >> 1), ((Prefs.SCREEN_HEIGHT - gPlatform.getImageHeight(gImgInstructions)) >> 1), 0, 0);
}
private function paintLoadingScreen(){
gPlatform.drawImage(gImgSplash, 0, 0, 0, 0);
gPlatform.setColor(Prefs.LOADING_BAR_COLOUR);
gPlatform.drawRect(Prefs.LOADING_BAR_X, Prefs.LOADING_BAR_Y, (Prefs.SCREEN_WIDTH - (Prefs.LOADING_BAR_X << 1)), Prefs.LOADING_BAR_HEIGHT);
gPlatform.fillRect(Prefs.LOADING_BAR_X, Prefs.LOADING_BAR_Y, (((Prefs.SCREEN_WIDTH - (Prefs.LOADING_BAR_X << 1)) * giLoadStage) / TOTAL_LOAD_STAGES), Prefs.LOADING_BAR_HEIGHT);
if (Prefs.DEBUG){
gPlatform.drawString(("Loading: " + giLoadStage), 0, 0, (Platform.TOP | Platform.LEFT), 0xFFFFFF, true);
};
}
private function processHelpScreen(){
if ((((giScreen < Prefs.SCREEN_HELP_FIRST)) || ((giScreen > (Prefs.SCREEN_HELP_FIRST + Prefs.NUM_HELP_PAGES))))){
return;
};
if (((gbKeySelect) || (gbMouseClicked))){
gbKeySelect = false;
gbMouseClicked = false;
if (giScreen < ((Prefs.SCREEN_HELP_FIRST + Prefs.NUM_HELP_PAGES) - 1)){
setScreen((giScreen + 1));
} else {
setScreen(giScreenNext);
};
};
}
public function init(_arg1){
var _local3:*;
gPlatform = _arg1;
if (Prefs.DEBUG){
_arg1.enableDebug(true);
};
if (Prefs.BITMAP_MOUSE){
_arg1.hideMouse();
};
_arg1.setPropertyBool(Platform.PROP_USE_MOUSE, Prefs.USE_MOUSE);
_arg1.setPropertyString(Platform.PROP_SAVENAME, Text.STR_SAVENAME);
var _local2:* = 0;
while (_local2 < Prefs.NUM_HIGHSCORES) {
gaHighScores[_local2] = 0;
_local2++;
};
var _local4:String = _arg1.getPlatformLocale();
giLocale = (giStrings = 0);
_local3 = 0;
while (_local3 < Text.LOCALES.length) {
if (_local4.substr(0, 2) == Text.LOCALES[_local3].substr(0, 2)){
giLocale = _local3;
giStrings = (Text.NUM_STRS * _local3);
break;
};
_local3++;
};
gPlatform.debugMsg(("giLocale: " + giLocale));
if (giLocale == 0){
gbBitmapFont = Prefs.BITMAP_FONT;
gbBitmapHelp = Prefs.BITMAP_HELP;
gbBitmapCredits = Prefs.BITMAP_CREDITS;
} else {
gbBitmapFont = Prefs.BITMAP_FONT_FOR_ALL_LANGS;
gbBitmapHelp = (gbBitmapCredits = false);
};
gMain = new Gridrunner(_arg1, this);
}
private function paintMenuBackground(){
gPlatform.clearPixelBuffer(0);
gPlatform.paintPixelBuffer();
gPlatform.drawImage(gImgMenu, 0, 0, 0, 0);
if (!Prefs.FACEBOOK){
gPlatform.drawImage(gImgLogoG5, (Prefs.SCREEN_WIDTH_HALF - (gPlatform.getImageWidth(gImgLogoG5) >> 1)), Prefs.LOGO_START_Y, 0, 0);
};
gPlatform.drawImage(gImgLogoLlama, 0, (Prefs.SCREEN_HEIGHT - gPlatform.getImageHeight(gImgLogoLlama)), 0, 0);
gPlatform.drawImage(gImgLogoCheeky, (Prefs.SCREEN_WIDTH - gPlatform.getImageWidth(gImgLogoCheeky)), (Prefs.SCREEN_HEIGHT - gPlatform.getImageHeight(gImgLogoCheeky)), 0, 0);
}
private function paintHighScoresScreen():void{
gMain.quickGR(false);
gPlatform.paintPixelBuffer();
gPlatform.drawBitmapFontStringFull(gBMPFontMenu, Text.gaszStrings[(giStrings + Text.STR_EXIT)], (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), (((Prefs.SCREEN_Y + Prefs.SCREEN_HEIGHT) - Prefs.FONT_SPRITE_HEIGHT) - Prefs.MENU_GAP_Y), (Platform.TOP | Platform.HCENTER), true, true);
}
public function stopSound(_arg1:int){
if (_arg1 != Prefs.SFX_NOT_USED){
gPlatform.stopSound(gaSFX[((_arg1 & 0xFF) - 1)]);
};
}
private function processOptionsMenu(){
var _local2:String;
var _local1:* = gbMusic;
giMenuItemSelected = processMenu(gaStringsOptionsMenu.length, giMenuItemSelected);
if (((gbKeySelect) || (((gbMouseClicked) && ((gPlatform.getMouseY() > Prefs.MENU_START_Y)))))){
_local2 = gaStringsOptionsMenu[giMenuItemSelected];
gbKeySelect = false;
gbMouseClicked = false;
if (((Prefs.OPT_LANG) && ((_local2 == Text.gaszStrings[(giStrings + Text.STR_LANGUAGE)])))){
if (giLocaleTmp < (Text.LOCALES.length - 1)){
giLocaleTmp++;
} else {
giLocaleTmp = 0;
};
} else {
if (((Prefs.OPT_MUSIC) && ((_local2 == Text.gaszStrings[(giStrings + Text.STR_MUSIC)])))){
} else {
if (((Prefs.OPT_SFX) && ((_local2 == Text.gaszStrings[(giStrings + Text.STR_SFX)])))){
} else {
if (((Prefs.OPT_VIBRATE) && ((_local2 == Text.gaszStrings[(giStrings + Text.STR_VIBRATE)])))){
gbVibrate = !(gbVibrate);
} else {
if (giLocaleTmp != giLocale){
giLocale = giLocaleTmp;
giStrings = (Text.NUM_STRS * giLocale);
giScreenAfterLoad = giScreenNext;
giLoadStage = STAGE_LOAD_LANGUAGE;
if (giLocale == 0){
gbBitmapFont = Prefs.BITMAP_FONT;
gbBitmapHelp = Prefs.BITMAP_HELP;
gbBitmapCredits = Prefs.BITMAP_CREDITS;
} else {
gbBitmapFont = Prefs.BITMAP_FONT_FOR_ALL_LANGS;
gbBitmapHelp = (gbBitmapCredits = false);
};
setScreen(Prefs.SCREEN_LOAD);
} else {
setScreen(giScreenNext);
};
};
};
};
};
} else {
if (gbKeyPause){
gbKeyPause = false;
setScreen(giScreenNext);
} else {
gPlatform.updateBitmapFontSineString(gBMPFontMenu);
};
};
gbMouseClicked = false;
}
public function stop(){
if (gMusicTitle != null){
gPlatform.stopSound(gMusicTitle);
};
if (gMusicGame != null){
gPlatform.stopSound(gMusicGame);
};
}
private function processLogoClicks():Boolean{
var _local3:int;
var _local4:int;
var _local1:int = gPlatform.getMouseX();
var _local2:int = gPlatform.getMouseY();
var _local5:int = gPlatform.getImageHeight(gImgLogoLlama);
var _local6:int = (Prefs.SCREEN_HEIGHT - _local5);
_local4 = gPlatform.getImageWidth(gImgLogoLlama);
_local3 = 0;
if ((((((((_local1 > _local3)) && ((_local1 < (_local3 + _local4))))) && ((_local2 > _local6)))) && ((_local2 < Prefs.SCREEN_HEIGHT)))){
gPlatform.setColor(4278190335);
gPlatform.drawRect(_local3, _local6, (_local4 - 1), (_local5 - 1));
if (gbMouseClicked){
gbKeySelect = false;
gbMouseClicked = false;
gPlatform.openBrowser("http://www.llamasoft.co.uk");
return (true);
};
};
_local4 = gPlatform.getImageWidth(gImgLogoCheeky);
_local5 = gPlatform.getImageHeight(gImgLogoCheeky);
_local3 = (Prefs.SCREEN_WIDTH - _local4);
_local6 = (Prefs.SCREEN_HEIGHT - _local5);
if ((((((((_local1 > _local3)) && ((_local1 < (_local3 + _local4))))) && ((_local2 > _local6)))) && ((_local2 < (_local6 + _local5))))){
gPlatform.setColor(4278190335);
gPlatform.drawRect(_local3, _local6, (_local4 - 1), (_local5 - 1));
if (gbMouseClicked){
gbKeySelect = false;
gbMouseClicked = false;
gPlatform.openBrowser("http://www.cheeky.gr");
return (true);
};
};
if (!Prefs.FACEBOOK){
_local4 = gPlatform.getImageWidth(gImgLogoG5);
_local5 = gPlatform.getImageHeight(gImgLogoG5);
_local3 = (Prefs.SCREEN_WIDTH_HALF - (_local4 >> 1));
_local6 = Prefs.LOGO_START_Y;
if ((((((((_local1 > _local3)) && ((_local1 < (_local3 + _local4))))) && ((_local2 > _local6)))) && ((_local2 < (_local6 + _local5))))){
gPlatform.setColor(4278190335);
gPlatform.drawRect(_local3, _local6, (_local4 - 1), (_local5 - 1));
if (gbMouseClicked){
gbKeySelect = false;
gbMouseClicked = false;
gPlatform.openBrowser("http://apps.facebook.com/gridrunner/");
return (true);
};
};
};
return (false);
}
public function playSound(_arg1:int){
if ((((gbSFX == true)) && (!((_arg1 == Prefs.SFX_NOT_USED))))){
gPlatform.playSound(gaSFX[((_arg1 & 0xFF) - 1)], false);
};
}
public function keyChanged(_arg1:int, _arg2:Boolean){
switch (_arg1){
case Platform.KEY_LEFT:
gbKeyLeft = _arg2;
break;
case Platform.KEY_RIGHT:
gbKeyRight = _arg2;
break;
case Platform.KEY_UP:
gbKeyUp = _arg2;
break;
case Platform.KEY_DOWN:
gbKeyDown = _arg2;
break;
case Platform.KEY_SELECT:
gbKeySelect = _arg2;
if (Prefs.DESTROY_ALL_KEYEVENTS){
gbKeyLeft = false;
gbKeyRight = false;
gbKeyUp = false;
gbKeyDown = false;
};
break;
case Platform.KEY_PAUSE:
gbKeyPause = _arg2;
if (Prefs.DESTROY_ALL_KEYEVENTS){
gbKeyLeft = false;
gbKeyRight = false;
gbKeyUp = false;
gbKeyDown = false;
};
break;
};
}
public function paint(){
switch (giScreen){
case Prefs.SCREEN_LOAD:
if (giLoadStage > 1){
paintLoadingScreen();
} else {
gPlatform.cls(0);
};
break;
case Prefs.SCREEN_TITLE:
paintTitleScreen();
break;
case Prefs.SCREEN_OPTIONS_MENU:
paintOptionsMenu();
break;
case Prefs.SCREEN_MAIN_MENU:
paintMenu(null, gaStringsMainMenu);
break;
case Prefs.SCREEN_PLAY_AGAIN:
paintMenu(null, gaStringsPlayAgainMenu);
gPlatform.drawBitmapFontString(gBMPFontMenu, Text.gaszStrings[(giStrings + Text.STR_YOUR_SCORE)], Prefs.SCREEN_WIDTH_HALF, Prefs.YOUR_SCORE_Y, (Platform.TOP | Platform.HCENTER), true);
break;
case Prefs.SCREEN_PAUSE_MENU:
paintMenu(Text.gaszStrings[(giStrings + Text.STR_PAUSED)], gaStringsPauseMenu);
break;
case Prefs.SCREEN_QUIT_GAME:
paintMenu(Text.gaszStrings[(giStrings + Text.STR_QUIT_CURR_GAME)], gaStringsYesNoMenu);
break;
case Prefs.SCREEN_HIGHSCORE:
paintHighScoresScreen();
break;
case Prefs.SCREEN_CREDITS:
paintCreditsScreen();
break;
case Prefs.SCREEN_GAME:
paintMainGame();
break;
default:
paintHelpScreen();
break;
};
if (((((Prefs.USE_MOUSE) && (Prefs.BITMAP_MOUSE))) && (!((gSpriteMouse == null))))){
gPlatform.setSpriteFrame(gSpriteMouse, (gPlatform.isMousePressed()) ? 1 : 0);
gPlatform.setSpritePosition(gSpriteMouse, gPlatform.getMouseX(), gPlatform.getMouseY());
gPlatform.paintSprite(gSpriteMouse);
};
}
private function processMainMenu(){
var _local1:String;
if (processLogoClicks()){
return;
};
giMenuItemSelected = processMenu(gaStringsMainMenu.length, giMenuItemSelected);
if (((gbKeySelect) || (((gbMouseClicked) && ((gPlatform.getMouseY() > Prefs.MENU_START_Y)))))){
_local1 = gaStringsMainMenu[giMenuItemSelected];
gbKeySelect = false;
gbMouseClicked = false;
giMenuItemSelected = 0;
if (_local1 == Text.gaszStrings[(giStrings + Text.STR_START_GAME)]){
setScreen(Prefs.SCREEN_GAME);
} else {
if (_local1 == Text.gaszStrings[(giStrings + Text.STR_HELP)]){
giScreenNext = Prefs.SCREEN_MAIN_MENU;
setScreen(Prefs.SCREEN_HELP_FIRST);
} else {
if (_local1 == Text.gaszStrings[(giStrings + Text.STR_VISIT_SITE)]){
gPlatform.openBrowser("http://www.gimme5games.com");
} else {
giMenuItemSelected = 1;
gbSFX = !(gbSFX);
gaStringsMainMenu[1] = ((Text.gaszStrings[(giStrings + Text.STR_SFX)] + " ") + (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)]);
};
};
};
} else {
gPlatform.updateBitmapFontSineString(gBMPFontMenu);
};
gbMouseClicked = false;
}
private function processHighScoresScreen():void{
if (((gbMouseClicked) && ((gPlatform.getMouseY() > ((Prefs.SCREEN_HEIGHT - Prefs.FONT_SPRITE_HEIGHT) - Prefs.MENU_GAP_Y))))){
gPlatform.endHiScoreScreen();
setScreen(Prefs.SCREEN_MAIN_MENU);
};
gbKeySelect = false;
gbMouseClicked = false;
gPlatform.updateBitmapFontSineString(gBMPFontMenu);
}
public function getScreen():int{
return (giScreen);
}
public function process(){
switch (giScreen){
case Prefs.SCREEN_LOAD:
processLoadingScreen();
break;
case Prefs.SCREEN_TITLE:
processTitleScreen();
break;
case Prefs.SCREEN_MAIN_MENU:
processMainMenu();
break;
case Prefs.SCREEN_PLAY_AGAIN:
processPlayAgainMenu();
break;
case Prefs.SCREEN_OPTIONS_MENU:
processOptionsMenu();
break;
case Prefs.SCREEN_PAUSE_MENU:
processPauseMenu();
break;
case Prefs.SCREEN_QUIT_GAME:
processQuitGameMenu();
break;
case Prefs.SCREEN_CREDITS:
processCreditsScreen();
break;
case Prefs.SCREEN_HIGHSCORE:
processHighScoresScreen();
break;
case Prefs.SCREEN_GAME:
processGame();
break;
default:
processHelpScreen();
break;
};
}
public function setScreen(_arg1:int):Boolean{
var _local2:* = giScreen;
if ((((_local2 == Prefs.SCREEN_GAME)) || ((_local2 == Prefs.SCREEN_LOAD)))){
if (gbMusic){
if (((!((gMusicGame == null))) && (!((gMusicGame == undefined))))){
gPlatform.stopMusic(gMusicGame);
};
gPlatform.playMusic(gMusicTitle, true);
};
};
giScreen = _arg1;
switch (_arg1){
case Prefs.SCREEN_LOAD:
gbKeySelect = false;
gbMouseClicked = false;
break;
case Prefs.SCREEN_TITLE:
giScreenTimer = 0;
gbKeySelect = false;
gbMouseClicked = false;
break;
case Prefs.SCREEN_MAIN_MENU:
gbKeySelect = false;
gbMouseClicked = false;
gbKeyPause = false;
gaStringsMainMenu[1] = ((Text.gaszStrings[(giStrings + Text.STR_SFX)] + " ") + (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)]);
break;
case Prefs.SCREEN_PLAY_AGAIN:
gbKeySelect = false;
gbMouseClicked = false;
break;
case Prefs.SCREEN_OPTIONS_MENU:
giLocaleTmp = giLocale;
break;
case Prefs.SCREEN_HIGHSCORE:
gbKeySelect = false;
gbMouseClicked = false;
gPlatform.doHiScoreScreen(gMain.score);
break;
case Prefs.SCREEN_GAME:
if (gbMusic){
if (Prefs.PLAY_MUSIC_IN_GAME){
gPlatform.stopMusic(gMusicTitle);
gPlatform.playMusic(gMusicGame, true);
};
};
process();
break;
case Prefs.SCREEN_PAUSE_MENU:
gaStringsPauseMenu[1] = ((Text.gaszStrings[(giStrings + Text.STR_SFX)] + " ") + (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)]);
break;
case Prefs.SCREEN_CREDITS:
giScreenTimer = 0;
break;
case Prefs.SCREEN_HELP_FIRST:
break;
};
giMenuItemSelected = 0;
if (Prefs.USE_MOUSE){
gLastMouseX = (gLastMouseY = -1);
};
return (true);
}
private function processCreditsScreen(){
giScreenTimer++;
if (((((gbKeySelect) || (gbMouseClicked))) || ((giScreenTimer == Prefs.NUM_CREDITS_SCREEN_FRAMES)))){
giScreenTimer = 0;
gbMouseClicked = false;
gbKeySelect = false;
setScreen(Prefs.SCREEN_MAIN_MENU);
};
}
private function processMenu(_arg1:int, _arg2:int):int{
var _local3:int;
var _local4:int;
var _local5:int;
if (((gbKeyUp) || (gbKeyDown))){
_arg2 = (_arg2 + ((gbKeyUp)==true) ? -1 : 1);
if (Prefs.WRAP_MENU){
if (_arg2 < 0){
_arg2 = (_arg1 - 1);
} else {
if (_arg2 >= _arg1){
_arg2 = 0;
};
};
} else {
if (_arg2 < 0){
_arg2 = 0;
} else {
if (_arg2 >= _arg1){
_arg2 = (_arg1 - 1);
};
};
};
gbKeyUp = (gbKeyDown = false);
} else {
if (Prefs.USE_MOUSE){
_local3 = gPlatform.getMouseX();
_local4 = gPlatform.getMouseY();
gLastMouseX = _local3;
gLastMouseY = _local4;
if (_local4 > Prefs.MENU_START_Y){
_local5 = ((_local4 - Prefs.MENU_START_Y) / (Prefs.FONT_SPRITE_HEIGHT + (Prefs.MENU_GAP_Y >> 1)));
if (_local5 < _arg1){
_arg2 = _local5;
};
};
};
};
return (_arg2);
}
private function SaveGameData():Boolean{
var _local1:ByteArray = new ByteArray();
var _local2:* = 0;
var _local3:* = 0;
_local3 = (_local3 + (4 + 4));
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local4 = _temp1;
_local1[_local4] = ((gbSFX)==true) ? 1 : 0;
var _temp2 = _local2;
_local2 = (_local2 + 1);
var _local5 = _temp2;
_local1[_local5] = ((gbMusic)==true) ? 1 : 0;
var _temp3 = _local2;
_local2 = (_local2 + 1);
var _local6 = _temp3;
_local1[_local6] = ((gbVibrate)==true) ? 1 : 0;
var _temp4 = _local2;
_local2 = (_local2 + 1);
var _local7 = _temp4;
_local1[_local7] = giLocale;
var _temp5 = _local2;
_local2 = (_local2 + 1);
var _local8 = _temp5;
_local1[_local8] = ((gaHighScores[0] & 4278190080) >> 24);
var _temp6 = _local2;
_local2 = (_local2 + 1);
var _local9 = _temp6;
_local1[_local9] = ((gaHighScores[0] & 0xFF0000) >> 16);
var _temp7 = _local2;
_local2 = (_local2 + 1);
var _local10 = _temp7;
_local1[_local10] = ((gaHighScores[0] & 0xFF00) >> 8);
var _temp8 = _local2;
_local2 = (_local2 + 1);
var _local11 = _temp8;
_local1[_local11] = (gaHighScores[0] & 0xFF);
return (true);
}
private function processLoadingScreen(){
var _local1:Object;
var _local2:*;
gPlatform.debugMsg(("giLoadStage: " + giLoadStage));
if (giBigLumpLoadStage > 0){
switch (giBigLumpLoadStage){
case 1:
gPlatform.loadBigLump();
giBigLumpLoadStage++;
break;
case 2:
if (gPlatform.isResourceReady() != null){
giBigLumpLoadStage++;
};
break;
case 3:
gPlatform.openResource("splash.jpg", false);
gPlatform.getResourceImage();
gImgSplash = gPlatform.isResourceReady();
giBigLumpLoadStage++;
break;
case 4:
gPlatform.openResource("cheekylogo.png", false);
gPlatform.getResourceImage();
gImgLogoCheeky = gPlatform.isResourceReady();
giBigLumpLoadStage++;
break;
case 5:
gPlatform.openResource("llamasoft_classic_logo150w.png", false);
gPlatform.getResourceImage();
gImgLogoLlama = gPlatform.isResourceReady();
giBigLumpLoadStage++;
break;
case 6:
gPlatform.openResource("pwf.png", false);
gPlatform.getResourceImage();
gImgLogoG5 = gPlatform.isResourceReady();
giBigLumpLoadStage++;
break;
case 7:
gPlatform.openResource("instructions.png", false);
gPlatform.getResourceImage();
gImgInstructions = gPlatform.isResourceReady();
giBigLumpLoadStage++;
break;
case 8:
if (Prefs.FACEBOOK){
gPlatform.openResource("grart_facebook.png", false);
} else {
gPlatform.openResource("grart.png", false);
};
gPlatform.getResourceImage();
gImgMenu = gPlatform.isResourceReady();
giBigLumpLoadStage++;
break;
case 9:
if (gPlatform.isResourceReady() != null){
giBigLumpLoadStage = 0;
};
break;
};
return;
};
if (giMouseLoadStage > 0){
switch (giMouseLoadStage){
case 1:
gPlatform.openResource("mouse_pointer.png", false);
giMouseLoadStage++;
break;
case 2:
if (gPlatform.isResourceReady() != null){
gPlatform.getResourceImage();
giMouseLoadStage++;
};
break;
case 3:
gImgMouse = gPlatform.isResourceReady();
if (gImgMouse != null){
gSpriteMouse = new CheekySprite(gPlatform, gImgMouse, gPlatform.getImageWidth(gImgMouse), (gPlatform.getImageHeight(gImgMouse) / 2));
gPlatform.closeResource();
giMouseLoadStage = 0;
};
break;
};
return;
};
if (giLoadStage < Prefs.NUM_LOAD_STAGES){
giLoadStage = gMain.loadSprites();
} else {
_local1 = gPlatform.isResourceReady();
switch (giLoadStage){
case STAGE_LOAD_MUSIC:
if (Prefs.OPT_MUSIC){
gPlatform.openResource("music.lump", Prefs.LUMP_MUSIC);
giLoadStage++;
} else {
giLoadStage = STAGE_LOAD_SFX;
};
break;
case (STAGE_LOAD_MUSIC + 1):
if (_local1 == null){
return;
};
gPlatform.getResourceSound(Prefs.MUSIC_FORMAT);
giLoadStage++;
break;
case (STAGE_LOAD_MUSIC + 2):
if (_local1 == null){
return;
};
gMusicTitle = _local1;
if (Prefs.PLAY_MUSIC_IN_GAME){
gPlatform.getResourceSound(Prefs.MUSIC_FORMAT);
};
giLoadStage++;
break;
case (STAGE_LOAD_MUSIC + 3):
if (_local1 == null){
return;
};
gMusicGame = _local1;
gPlatform.closeResource();
giLoadStage++;
break;
case STAGE_LOAD_SFX:
if (Prefs.OPT_SFX){
switch (giLoadSFX){
case 0:
gPlatform.openResource("sfx.lump", Prefs.LUMP_SFX);
break;
case 1:
if (_local1 == null){
return;
};
gPlatform.getResourceSound(Prefs.SFX_FORMAT);
break;
case (Prefs.SFX_TOTAL_SFX + 2):
gPlatform.closeResource();
giLoadStage++;
break;
default:
if (_local1 == null){
return;
};
_local2 = (giLoadSFX - 2);
gPlatform.debugMsg(("iSFX=" + _local2));
if (gaSFX_ID[_local2] != Prefs.SFX_NOT_USED){
if (gaSFX_ID[_local2] > Prefs.SFX_LOAD){
gaSFX[_local2] = _local1;
if (_local2 < (Prefs.SFX_TOTAL_SFX - 1)){
gPlatform.getResourceSound(Prefs.SFX_FORMAT);
};
} else {
gaSFX[_local2] = gaSFX[(gaSFX_ID[_local2] - 1)];
};
};
};
giLoadSFX++;
} else {
giLoadStage = STAGE_LOAD_LANGUAGE;
};
break;
case STAGE_LOAD_LANGUAGE:
loadOneStringset();
gPlatform.openResource("font.png", false);
gPlatform.getResourceImage();
gImgFont = gPlatform.isResourceReady();
gPlatform.closeResource();
gBMPFontMenu = gPlatform.createBitmapFont(FONT_CHARMAP, FONT_SPRITE_WIDTHS, Prefs.FONT_SPRITE_WIDTH_SPACE, Prefs.FONT_SPRITE_WIDTH, Prefs.FONT_SPRITE_HEIGHT, gImgFont);
gPlatform.setBitmapFontSineProperties(gBMPFontMenu, Prefs.SINE_WAVE_0, Prefs.SINE_WAVE_1, Prefs.SINE_WAVE_DELAY_FRAMES);
giLoadStage++;
break;
};
};
if (giLoadStage == TOTAL_LOAD_STAGES){
gPlatform.forcePaint();
setScreen(giScreenAfterLoad);
};
}
private function paintTitleScreen(){
gPlatform.drawImage(gImgSplash, 0, 0, 0, 0);
}
public function toggleSounds():void{
gbToggleSound = !(gbToggleSound);
if (!gbToggleSound){
gPlatform.stopMusic(gMusicTitle);
gPlatform.stopMusic(gMusicGame);
} else {
gPlatform.playMusic(((giScreen == Prefs.SCREEN_GAME)) ? gMusicGame : gMusicTitle, true);
};
gbMusic = (gbSFX = gbToggleSound);
}
public function mouseClicked(){
gbMouseClicked = true;
}
private function paintMainGame(){
gPlatform.paintPixelBuffer();
if (Prefs.SOFTKEY_ICONS){
gPlatform.setSpriteFrame(gSpriteSoftkey, Prefs.SOFTKEY_SPRITE_PAUSE);
gPlatform.setSpritePosition(gSpriteSoftkey, Prefs.SOFTKEY_SPRITE_RIGHT_X, Prefs.SOFTKEY_SPRITE_Y);
gPlatform.paintSprite(gSpriteSoftkey);
};
}
private function makeByteSane(_arg1):int{
return (int(((_arg1)<0) ? (_arg1 + 0x0100) : _arg1));
}
public function loopSound(_arg1:int){
if ((((gbSFX == true)) && (!((_arg1 == Prefs.SFX_NOT_USED))))){
gPlatform.playSound(gaSFX[((_arg1 & 0xFF) - 1)], true);
};
}
private function processPauseMenu(){
var _local1:String;
if (processLogoClicks()){
return;
};
giMenuItemSelected = processMenu(gaStringsPauseMenu.length, giMenuItemSelected);
if (((gbKeySelect) || (((gbMouseClicked) && ((gPlatform.getMouseY() > Prefs.MENU_START_Y)))))){
_local1 = gaStringsPauseMenu[giMenuItemSelected];
gbKeySelect = false;
gbMouseClicked = false;
giMenuItemSelected = 0;
if (_local1 == Text.gaszStrings[(giStrings + Text.STR_CONTINUE)]){
setScreen(Prefs.SCREEN_GAME);
} else {
if (_local1 == Text.gaszStrings[(giStrings + Text.STR_QUIT_CURR_GAME)]){
setScreen(Prefs.SCREEN_QUIT_GAME);
} else {
giMenuItemSelected = 1;
gbSFX = !(gbSFX);
gaStringsPauseMenu[1] = ((Text.gaszStrings[(giStrings + Text.STR_SFX)] + " ") + (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)]);
};
};
} else {
gPlatform.updateBitmapFontSineString(gBMPFontMenu);
};
gbMouseClicked = false;
}
private function paintOptionsMenu(){
var _local3:String;
var _local4:*;
var _local6:*;
var _local1:Array = new Array((((((Prefs.OPT_LANG)==true) ? 1 : 0 + ((Prefs.OPT_MUSIC)==true) ? 1 : 0) + ((Prefs.OPT_SFX)==true) ? 1 : 0) + ((Prefs.OPT_VIBRATE)==true) ? 1 : 0));
var _local2:* = 0;
if (Prefs.OPT_LANG){
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local7 = _temp1;
_local1[_local7] = Text.gaszLocales[giLocaleTmp];
};
if (Prefs.OPT_MUSIC){
var _temp2 = _local2;
_local2 = (_local2 + 1);
_local7 = _temp2;
_local1[_local7] = (gbMusic) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)];
};
if (Prefs.OPT_SFX){
var _temp3 = _local2;
_local2 = (_local2 + 1);
_local7 = _temp3;
_local1[_local7] = (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)];
};
if (Prefs.OPT_VIBRATE){
var _temp4 = _local2;
_local2 = (_local2 + 1);
_local7 = _temp4;
_local1[_local7] = (gbVibrate) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)];
};
paintMenuBackground();
var _local5:* = Prefs.MENU_START_Y;
if (gbBitmapFont){
gPlatform.drawBitmapFontString(gBMPFontMenu, Text.gaszStrings[(giStrings + Text.STR_OPTIONS)], (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), Prefs.MENU_TITLE_Y, (Platform.TOP | Platform.HCENTER), false);
_local4 = 0;
while (_local4 < (_local2 + 1)) {
_local3 = gaStringsOptionsMenu[_local4];
if (_local4 < _local2){
_local3 = (_local3 + (" " + _local1[_local4]));
};
gPlatform.drawBitmapFontStringFull(gBMPFontMenu, _local3, (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), _local5, (Platform.TOP | Platform.HCENTER), (_local4 == giMenuItemSelected), (_local4 == giMenuItemSelected));
_local5 = (_local5 + (Prefs.FONT_SPRITE_HEIGHT + Prefs.MENU_GAP_Y));
_local4++;
};
} else {
_local6 = gPlatform.getFontHeight(gFontMenu);
gPlatform.setFont(gFontMenu);
gPlatform.drawString(Text.gaszStrings[(giStrings + Text.STR_OPTIONS)], (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), Prefs.MENU_TITLE_Y, (Platform.TOP | Platform.HCENTER), Prefs.MENU_FONT_COLOUR, Prefs.MENU_FONT_SHADOWS);
_local4 = 0;
while (_local4 < (_local2 + 1)) {
_local3 = gaStringsOptionsMenu[_local4];
if (_local4 < _local2){
_local3 = (_local3 + (" " + _local1[_local4]));
};
gPlatform.drawString(_local3, (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), _local5, (Platform.TOP | Platform.HCENTER), ((_local4 == giMenuItemSelected)) ? Prefs.MENU_FONT_COLOUR_HILITE : Prefs.MENU_FONT_COLOUR, Prefs.MENU_FONT_SHADOWS);
_local5 = (_local5 + (_local6 + Prefs.MENU_GAP_Y));
_local4++;
};
};
if (Prefs.SOFTKEY_ICONS){
gPlatform.setSpriteFrame(gSpriteSoftkey, (Prefs.REVERSE_SOFTKEYS) ? Prefs.SOFTKEY_SPRITE_CANCEL : Prefs.SOFTKEY_SPRITE_OK);
gPlatform.setSpritePosition(gSpriteSoftkey, Prefs.SOFTKEY_SPRITE_LEFT_X, Prefs.SOFTKEY_SPRITE_Y);
gPlatform.paintSprite(gSpriteSoftkey);
gPlatform.setSpriteFrame(gSpriteSoftkey, (Prefs.REVERSE_SOFTKEYS) ? Prefs.SOFTKEY_SPRITE_OK : Prefs.SOFTKEY_SPRITE_CANCEL);
gPlatform.setSpritePosition(gSpriteSoftkey, Prefs.SOFTKEY_SPRITE_RIGHT_X, Prefs.SOFTKEY_SPRITE_Y);
gPlatform.paintSprite(gSpriteSoftkey);
};
}
private function LoadGameData(){
return (true);
}
private function paintMenu(_arg1:String, _arg2:Array){
var _local3:*;
var _local4:*;
var _local5:*;
paintMenuBackground();
if (gbBitmapFont){
_local4 = Prefs.MENU_START_Y;
if (_arg1 != null){
gPlatform.drawBitmapFontString(gBMPFontMenu, _arg1, (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), Prefs.MENU_TITLE_Y, (Platform.TOP | Platform.HCENTER), false);
};
_local3 = 0;
while (_local3 < _arg2.length) {
gPlatform.drawBitmapFontStringFull(gBMPFontMenu, _arg2[_local3], (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), _local4, (Platform.TOP | Platform.HCENTER), (_local3 == giMenuItemSelected), (_local3 == giMenuItemSelected));
_local4 = (_local4 + (Prefs.FONT_SPRITE_HEIGHT + Prefs.MENU_GAP_Y));
_local3++;
};
} else {
_local5 = gPlatform.getFontHeight(gFontMenu);
_local4 = Prefs.MENU_START_Y;
gPlatform.setFont(gFontMenu);
if (_arg1 != null){
gPlatform.drawString(_arg1, (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), Prefs.MENU_TITLE_Y, (Platform.TOP | Platform.HCENTER), Prefs.MENU_FONT_COLOUR, Prefs.MENU_FONT_SHADOWS);
};
_local3 = 0;
while (_local3 < _arg2.length) {
gPlatform.drawString(_arg2[_local3], (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), _local4, (Platform.TOP | Platform.HCENTER), ((_local3 == giMenuItemSelected)) ? Prefs.MENU_FONT_COLOUR_HILITE : Prefs.MENU_FONT_COLOUR, Prefs.MENU_FONT_SHADOWS);
_local4 = (_local4 + (_local5 + Prefs.MENU_GAP_Y));
_local3++;
};
};
if (Prefs.SOFTKEY_ICONS){
gPlatform.setSpriteFrame(gSpriteSoftkey, Prefs.SOFTKEY_SPRITE_OK);
gPlatform.setSpritePosition(gSpriteSoftkey, (Prefs.REVERSE_SOFTKEYS) ? Prefs.SOFTKEY_SPRITE_RIGHT_X : Prefs.SOFTKEY_SPRITE_LEFT_X, Prefs.SOFTKEY_SPRITE_Y);
gPlatform.paintSprite(gSpriteSoftkey);
gPlatform.setSpriteFrame(gSpriteSoftkey, ((_arg2 == gaStringsPauseMenu)) ? Prefs.SOFTKEY_SPRITE_START : Prefs.SOFTKEY_SPRITE_CANCEL);
gPlatform.setSpritePosition(gSpriteSoftkey, (Prefs.REVERSE_SOFTKEYS) ? Prefs.SOFTKEY_SPRITE_LEFT_X : Prefs.SOFTKEY_SPRITE_RIGHT_X, Prefs.SOFTKEY_SPRITE_Y);
gPlatform.paintSprite(gSpriteSoftkey);
};
processLogoClicks();
}
private function paintCreditsScreen(){
var _local1:Array;
var _local2:*;
var _local3:*;
var _local4:*;
if (gbBitmapCredits){
gPlatform.drawImage(gImgCredits, 0, 0, 0, 0);
} else {
_local1 = gaStringsCredits;
gPlatform.setFont(gFontHelp);
paintMenuBackground();
_local2 = (gPlatform.getFontHeight(gFontHelp) + Prefs.HELP_GAP_Y);
_local3 = ((Prefs.SCREEN_HEIGHT - (_local2 * _local1.length)) >> 1);
_local4 = 0;
while (_local4 < _local1.length) {
gPlatform.drawString(_local1[_local4], (Prefs.SCREEN_X + Prefs.SCREEN_WIDTH_HALF), ((Prefs.SCREEN_Y + _local3) + (_local2 * _local4)), (Platform.TOP | Platform.HCENTER), Prefs.HELP_FONT_COLOUR, Prefs.HELP_FONT_SHADOWS);
_local4++;
};
};
if (Prefs.SOFTKEY_ICONS){
gPlatform.setSpriteFrame(gSpriteSoftkey, Prefs.SOFTKEY_SPRITE_OK);
gPlatform.setSpritePosition(gSpriteSoftkey, (Prefs.REVERSE_SOFTKEYS) ? Prefs.SOFTKEY_SPRITE_RIGHT_X : Prefs.SOFTKEY_SPRITE_LEFT_X, Prefs.SOFTKEY_SPRITE_Y);
gPlatform.paintSprite(gSpriteSoftkey);
};
}
private function processPlayAgainMenu(){
giMenuItemSelected = processMenu(gaStringsPlayAgainMenu.length, giMenuItemSelected);
if (((gbKeySelect) || (((gbMouseClicked) && ((gPlatform.getMouseY() > Prefs.MENU_START_Y)))))){
if (giMenuItemSelected == 0){
setScreen(Prefs.SCREEN_HIGHSCORE);
} else {
setScreen(Prefs.SCREEN_GAME);
};
giMenuItemSelected = 0;
} else {
gPlatform.updateBitmapFontSineString(gBMPFontMenu);
};
gbKeySelect = false;
gbMouseClicked = false;
}
private function processQuitGameMenu(){
if (processLogoClicks()){
return;
};
giMenuItemSelected = processMenu(gaStringsYesNoMenu.length, giMenuItemSelected);
if (((gbKeySelect) || (((gbMouseClicked) && ((gPlatform.getMouseY() > Prefs.MENU_START_Y)))))){
gbKeySelect = false;
gbMouseClicked = false;
if (giMenuItemSelected == 0){
gMain.QuitGame();
setScreen(Prefs.SCREEN_MAIN_MENU);
} else {
giMenuItemSelected = 0;
setScreen(Prefs.SCREEN_PAUSE_MENU);
};
} else {
if (gbKeyPause){
gbKeyPause = false;
giMenuItemSelected = 0;
setScreen(Prefs.SCREEN_PAUSE_MENU);
} else {
gPlatform.updateBitmapFontSineString(gBMPFontMenu);
};
};
gbMouseClicked = false;
}
private function loadOneStringset(){
var _local1:*;
if (Prefs.EXCLUDE_MENU_EXIT){
gaStringsMainMenu = [Text.gaszStrings[(giStrings + Text.STR_START_GAME)], ((Text.gaszStrings[(giStrings + Text.STR_SFX)] + " ") + (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)]), Text.gaszStrings[(giStrings + Text.STR_HELP)], Text.gaszStrings[(giStrings + Text.STR_VISIT_SITE)]];
} else {
gaStringsMainMenu = [Text.gaszStrings[(giStrings + Text.STR_START_GAME)], ((Text.gaszStrings[(giStrings + Text.STR_SFX)] + " ") + (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)]), Text.gaszStrings[(giStrings + Text.STR_HELP)], Text.gaszStrings[(giStrings + Text.STR_VISIT_SITE)]];
};
gaStringsPauseMenu = [Text.gaszStrings[(giStrings + Text.STR_CONTINUE)], ((Text.gaszStrings[(giStrings + Text.STR_SFX)] + " ") + (gbSFX) ? Text.gaszStrings[(giStrings + Text.STR_ON)] : Text.gaszStrings[(giStrings + Text.STR_OFF)]), Text.gaszStrings[(giStrings + Text.STR_QUIT_CURR_GAME)]];
gaStringsYesNoMenu = [Text.gaszStrings[(giStrings + Text.STR_YES)], Text.gaszStrings[(giStrings + Text.STR_NO)]];
gaStringsPlayAgainMenu = [Text.gaszStrings[(giStrings + Text.STR_ENTER_HISCORE)], Text.gaszStrings[(giStrings + Text.STR_PLAY_AGAIN)]];
var _local2:* = 0;
if (Prefs.OPT_LANG){
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local3 = _temp1;
gaStringsOptionsMenu[_local3] = Text.gaszStrings[(giStrings + Text.STR_LANGUAGE)];
};
if (Prefs.OPT_MUSIC){
var _temp2 = _local2;
_local2 = (_local2 + 1);
_local3 = _temp2;
gaStringsOptionsMenu[_local3] = Text.gaszStrings[(giStrings + Text.STR_MUSIC)];
};
if (Prefs.OPT_SFX){
var _temp3 = _local2;
_local2 = (_local2 + 1);
_local3 = _temp3;
gaStringsOptionsMenu[_local3] = Text.gaszStrings[(giStrings + Text.STR_SFX)];
};
if (Prefs.OPT_VIBRATE){
var _temp4 = _local2;
_local2 = (_local2 + 1);
_local3 = _temp4;
gaStringsOptionsMenu[_local3] = Text.gaszStrings[(giStrings + Text.STR_VIBRATE)];
};
gaStringsOptionsMenu[_local2] = Text.gaszStrings[(giStrings + Text.STR_EXIT)];
if (gbBitmapHelp == false){
gaStringsHelp = new Array(Text.NUM_HELP_LINES);
_local1 = 0;
while (_local1 < Text.NUM_HELP_LINES) {
gaStringsHelp[_local1] = Text.gaszStrings[((giStrings + _local1) + Text.STR_HELP_FIRST)];
_local1++;
};
gaStringsCredits = new Array(Text.NUM_CREDITS_LINES);
_local1 = 0;
while (_local1 < Text.NUM_CREDITS_LINES) {
gaStringsCredits[_local1] = Text.gaszStrings[((giStrings + _local1) + Text.STR_CREDITS_FIRST)];
_local1++;
};
};
}
private function processTitleScreen(){
giScreenTimer++;
if ((((((gbKeySelect == true)) || (gbMouseClicked))) || ((giScreenTimer == Prefs.NUM_TITLE_SCREEN_FRAMES)))){
giScreenTimer = 0;
gbKeySelect = false;
gbMouseClicked = false;
gPlatform.doMochiAd();
};
}
public function pause(){
if (gMain != null){
gbKeyPause = gMain.canPause();
};
}
}
}//package
Section 29
//Gridrunner (Gridrunner)
package {
import flash.utils.*;
import flash.geom.*;
public class Gridrunner {
private var turn_speed:int;// = 64
private var diff:int;// = 0
private var LVM_mouseX:int;
private var LVM_mouseY:int;
private var WINDYHI:int;
private var loop_prob:int;// = 0
private var SheepyZapTarget:int;// = 0
private var levelTimer:int;
private var demoMode:int;// = 0
private var activeSlot:int;// = 0
private var Sprites:Array;
private var LVM_flashp:Array;
private var wactive:int;// = 0
private var SEP:int;// = 4
private var sheepcounter:int;// = 10
private var failed:int;// = 0
private var BOLLOCKS:int;// = 0
private var bm:int;// = 0
private var HEADFREE:int;// = 8
private var WINDXHI:int;
private var unkilled:int;// = 0
private var TAILSIZE:int;// = 4
private var LVM_mode:int;
var PILLmode:int;// = 0
private var smaxY:int;// = 0
private var smaxX:int;// = 0
private var gameFinished:int;// = 0
private var isp:int;// = 0
private var stack:Array;
private var lastLevel:int;// = -1
private var nearestPillX:int;
private var nearestPillY:int;
private var WINDYLO:int;// = 0
private var icp:int;// = 0
private var INGAME:int;// = 0
public var score:int;
var XYZmode:int;// = 0
private var nomore:int;// = 0
private var BULLSPURT:int;// = 0
private var SheepyZapState:int;// = 0
private var controlp:Array;// = null
private var LVM_flash:int;// = 0
private var frames:int;// = 0
private var SheepyZapDwellTime:int;// = 0
private var goaround:int;// = 0
private var laupos:int;
private var ZAPXS:int;// = 524288
private var levelCarryOverAchieved:int;// = 0
private var XSPEED:int;// = 0x0500
private var giHeads:int;// = 0
private var WINDXLO:int;// = 0
private var quake:int;// = 0
private var FIREMODE:int;// = 65539
private var lasthiscore:int;// = 10
private var ZAPYS:int;// = 655360
private var OFFX:int;// = 0
private var OFFY:int;// = 0
private var gr:Array;
private var bouncet:int;// = 0
private var bouncez:int;// = 0
private var alaunched:int;// = 0
private var nactive:int;
private var podmap:Array;
private var gGame:Game;
private var auxfire:int;// = 0
private var LVM_yhi:int;
private var nactive_last:int;
private var ZAPZS:int;// = 128
private var SheepyZapFired:int;// = 0
private var lives:int;
private var inkling:int;// = 0
private var ScrollX:int;// = 0
private var ScrollY:int;// = 0
private var count:int;// = 0
private var gStartLifeState:int;// = 0
private var demoPC:int;// = 0
private var RanSeed:int;// = 826366246
private var DS_laser:int;// = 0
private var levelup:int;// = 0
private var demoTimer:int;// = 0
private var LastZapX:int;// = 0
private var LastZapY:int;// = 0
private var steps:Array;
private var bullfloat:int;// = 1043
private var gGameState:int;
private var demoLevels:Array;
private var lanTimer:int;// = 0
private var LVM_xhi:int;
var things:Array;
private var giDroneBase:int;// = 0
private var HEADSHIELD:int;// = -1
private var nearestPillNum:int;
private var rTmp:Rectangle;
private var DS_mode:int;// = 0
var gGRthingy:Thingie;
private var turn_rate:int;// = -1
private var levelCarryOver:int;// = 0
private var levelp:Array;// = null
private var demoLevel:int;// = 0
private var YSPEED:int;// = 0x0500
private var zapx:int;
private var zapy:int;
private var XYZ:int;// = 0
private var zapt:int;// = 0
private var AREAY:int;
private var LVM_ylo:int;// = 0
private var iLoadSpritesState:int;// = 0
private var thisLevel:int;
private var AREAX:int;
private var SPLITMODE:int;// = 528
private var LVM_drawmode:int;// = 1
private var PODSIZE:int;// = 60
private var LVM_bfill:int;// = 0
private var gaHeightTable:Array;
public var lvlscore:int;
private var cowfloat:int;// = 1043
private var ilp:int;// = 0
private var motion:int;// = 1
private var LVM_tint:int;// = 0
private var TAILSHIELD:int;// = -1
private var ZOO:int;// = 0
private var LVM_xlo:int;// = 0
private var ZOOINC:int;// = 16
private var nactive2:int;
private var SheepyZapTotalTime:int;// = 0
private var PODSHIELD:int;// = 1
private var ZOOM:int;// = 0
private var resumed:int;// = 0
private var gPlayGameState:int;
private var LVM_bgcol:int;// = 0
private var ZOOINCSHADOW:int;// = 16
private var DS_vel:int;// = 0
private var gPlatform:Platform;
private static var GAME_SHUTDOWN:int = 3;
private static var PLAYGAME_SETUP:int = 0;
private static var rezin:Array = ["#####", "# # #", "## ##", "# # #", "#####"];
private static var SIGN1:int = 115;
private static var ESHOTBASE:int = 1;
private static var drone1:int = 13;
private static var COLLIDE:int = 1;
private static var bonus:Array = ["### ### # # # # #### ", "# # # # ## # # # # # # ", "# # # # # # # # # # # # ", "### # # # ## # # ### ##### #####", "# # # # # # # # # # # ", "# # # # # # # # # # # ", "### ### # # ### #### "];
private static var NSPRITES:int = 116;
private static var BONNUM:int = 5;
private static var gaCGEN4_g_lo:Array = [96, 16, 80, 16, 0, 48, 240, 48, 0, 32, 0, 0, 0, 0];
private static var hundred:Array = [" ## #### #### ", "### ## ## ## ##", " ## ## ## ## ##", " ## ## ## ## ##", " ## ## ## ## ##", " ## ## ## ## ##", "#### #### #### "];
private static var e_Fade:int = 1;
private static var SHIP:int = 89;
private static var fire:int = 5;
private static var gaCGEN4_r_lo:Array = [128, 128, 80, 16, 16, 240, 0, 48, 0, 32, 32, 0, 48, 0];
private static var ESHOTNUM:int = 10;
private static var gaCGEN4_b_lo:Array = [192, 192, 112, 16, 32, 0, 0, 0, 128, 64, 64, 64, 32, 0];
private static var PARAM_TURN_RATE:int = 14;
private static var e_UseRand:int = 2;
private static var PARAM_HEADSHIELD:int = 2;
private static var BULLBASE:int = 90;
private static var HEADG:int = 124;
private static var PARAM_FIREMODE:int = 13;
private static var control1:Array = [PARAM_TAILSIZE, 2, 0, PARAM_TAILSIZE, 4, PARAM_XSPEED, 1360, PARAM_SEP, 3, 0, PARAM_TAILSIZE, 5, PARAM_XSPEED, 0x0600, 0, PARAM_TAILSIZE, 6, PARAM_XSPEED, 0x0700, PARAM_YSPEED, 0x0700, PARAM_SEP, 2, 0];
private static var control2:Array = [PARAM_TAILSIZE, 4, 0, PARAM_TAILSIZE, 4, PARAM_HEADSHIELD, 0, 0, PARAM_TAILSIZE, 5, PARAM_HEADSHIELD, 1, 0, PARAM_TAILSIZE, 6, PARAM_HEADSHIELD, 2, 0];
private static var control4:Array = [PARAM_TAILSIZE, 7, 0, PARAM_TAILSIZE, 7, PARAM_XSPEED, 1360, PARAM_SEP, 3, 0, PARAM_TAILSIZE, 10, PARAM_XSPEED, 0x0600, 0, PARAM_TAILSIZE, 16, PARAM_XSPEED, 0x0700, PARAM_YSPEED, 0x0700, PARAM_SEP, 2, 0];
private static var gszGR:Array = [" ######## ######## ", " ######### ######### ", "## ## ##", "## ## ##", "## ## ##", "## ## ##", "## #### ######### ", "## #### ######## ", "## ## ## ## ", "## ## ## ## ", " ######### ## ## ", " ####### ## ##"];
private static var control0:Array = [PARAM_HEADSHIELD, -1, 0, PARAM_HEADSHIELD, -1, 0, PARAM_HEADSHIELD, -1, 0, PARAM_HEADSHIELD, -1, 0];
private static var control8:Array = [PARAM_HEADSHIELD, 3, 0, PARAM_HEADSHIELD, 5, 0, PARAM_HEADSHIELD, 7, 0, PARAM_HEADSHIELD, 9, 0];
private static var control9:Array = [PARAM_HEADSHIELD, 0, PARAM_XSPEED, 0x0500, PARAM_YSPEED, 0x0500, 0, PARAM_HEADSHIELD, 1, PARAM_XSPEED, 0x0600, PARAM_YSPEED, 0x0600, 0, PARAM_HEADSHIELD, 2, PARAM_XSPEED, 0x0700, PARAM_YSPEED, 0x0700, 0, PARAM_HEADSHIELD, 3, PARAM_XSPEED, 0x0800, PARAM_YSPEED, 0x0800, 0];
private static var control3:Array = [PARAM_TAILSIZE, 7, 0, PARAM_TAILSIZE, 7, PARAM_XSPEED, 1360, PARAM_SEP, 3, 0, PARAM_TAILSIZE, 7, PARAM_XSPEED, 0x0600, 0, PARAM_TAILSIZE, 7, PARAM_XSPEED, 0x0700, PARAM_YSPEED, 0x0700, PARAM_SEP, 2, 0];
private static var GAME_OPEN:int = 0;
private static var control5:Array = [PARAM_TAILSIZE, 7, 0, PARAM_TAILSIZE, 16, PARAM_XSPEED, 1360, PARAM_SEP, 3, 0, PARAM_TAILSIZE, 24, PARAM_XSPEED, 0x0600, 0, PARAM_TAILSIZE, 32, PARAM_XSPEED, 0x0700, PARAM_YSPEED, 0x0700, PARAM_SEP, 2, 0];
private static var control6:Array = [PARAM_TAILSIZE, 2, 0, PARAM_TAILSIZE, 3, 0, PARAM_TAILSIZE, 24, PARAM_XSPEED, 0x0600, 0, PARAM_TAILSIZE, 32, PARAM_XSPEED, 0x0700, PARAM_YSPEED, 0x0700, PARAM_SEP, 2, 0];
private static var PARAM_ZAPXS:int = 9;
private static var PLAYGAME_GAME_OVER_SETUP:int = 4;
private static var control7:Array = [PARAM_HEADSHIELD, 0, 0, PARAM_HEADSHIELD, 1, 0, PARAM_HEADSHIELD, 2, 0, PARAM_HEADSHIELD, 3, 0];
private static var ice:int = 8;
private static var whitelight:int = 7;
private static var PARAM_ZAPYS:int = 10;
private static var gabmex_step:Array = [0, 0, 5, 0, 0, 0, 0, 0, 5, 0];
private static var sine:Array = [402, 804, 1206, 1608, 2010, 2412, 2814, 3215, 3617, 4018, 4420, 4821, 5222, 5622, 6023, 6423, 6823, 7223, 7623, 8022, 8421, 8819, 9218, 9616, 10013, 10410, 10807, 11204, 11600, 11995, 12390, 12785, 13179, 13573, 13966, 14359, 14751, 15142, 15533, 15923, 16313, 16702, 17091, 17479, 17866, 18253, 18638, 19024, 19408, 19792, 20175, 20557, 20938, 21319, 21699, 22078, 22456, 22833, 23210, 23586, 23960, 24334, 24707, 25079, 25450, 25820, 26189, 26557, 26925, 27291, 27656, 28020, 28383, 28745, 29105, 29465, 29824, 30181, 30538, 30893, 31247, 31600, 31952, 32302, 32651, 32999, 33346, 33692, 34036, 34379, 34721, 35061, 35400, 35738, 36074, 36409, 36743, 37075, 37406, 37736, 38064, 38390, 38716, 39039, 39362, 39682, 40002, 40319, 40636, 40950, 41263, 41575, 41885, 42194, 42501, 42806, 43110, 43412, 43712, 44011, 44308, 44603, 44897, 45189, 45480, 45768, 46055, 46340, 46624, 46906, 47186, 47464, 47740, 48015, 48288, 48558, 48828, 49095, 49360, 49624, 49886, 50146, 50403, 50660, 50914, 51166, 51416, 51665, 51911, 52155, 52398, 52639, 52877, 53114, 53348, 53581, 53811, 54040, 54266, 54491, 54713, 54933, 55152, 55368, 55582, 55794, 56004, 56212, 56417, 56621, 56822, 57022, 57219, 57414, 57606, 57797, 57986, 58172, 58356, 58538, 58718, 58895, 59070, 59243, 59414, 59583, 59749, 59913, 60075, 60235, 60392, 60547, 60700, 60850, 60998, 61144, 61288, 61429, 61568, 61705, 61839, 61971, 62101, 62228, 62353, 62475, 62596, 62714, 62829, 62942, 63053, 63162, 63268, 63371, 63473, 63571, 63668, 63762, 63854, 63943, 64030, 64115, 64197, 64276, 64354, 64428, 64501, 64571, 64638, 64703, 64766, 64826, 64884, 64939, 64992, 65043, 65091, 65136, 65179, 65220, 65258, 65294, 65327, 65358, 65386, 65412, 65436, 65457, 65475, 65491, 65505, 65516, 65524, 65531, 65534, 0xFFFF, 65534, 65531, 65524, 65516, 65505, 65491, 65475, 65457, 65436, 65412, 65386, 65358, 65327, 65294, 65258, 65220, 65179, 65136, 65091, 65043, 64992, 64939, 64884, 64826, 64766, 64703, 64638, 64571, 64501, 64428, 64353, 64276, 64197, 64114, 64030, 63943, 63854, 63762, 63668, 63571, 63473, 63371, 63268, 63161, 63053, 62942, 62829, 62713, 62596, 62475, 62353, 62228, 62100, 61971, 61839, 61704, 61568, 61429, 61288, 61144, 60998, 60850, 60700, 60547, 60392, 60234, 60075, 59913, 59749, 59583, 59414, 59243, 59070, 58895, 58717, 58538, 58356, 58172, 57985, 57797, 57606, 57414, 57219, 57021, 56822, 56621, 56417, 56211, 56004, 55794, 55582, 55368, 55151, 54933, 54713, 54491, 54266, 54040, 53811, 53581, 53348, 53113, 52877, 52638, 52398, 52155, 51911, 51664, 51416, 51166, 50913, 50659, 50403, 50145, 49885, 49624, 49360, 49095, 48827, 48558, 48287, 48015, 47740, 47464, 47185, 46905, 46624, 46340, 46055, 45768, 45479, 45189, 44897, 44603, 44308, 44011, 43712, 43411, 43109, 42806, 42500, 42193, 41885, 41575, 41263, 40950, 40635, 40319, 40001, 39682, 39361, 39039, 38715, 38390, 38063, 37735, 37406, 37075, 36743, 36409, 36074, 35738, 35400, 35061, 34720, 34379, 34036, 33691, 33346, 32999, 32651, 32302, 31951, 31600, 31247, 30893, 30537, 30181, 29824, 29465, 29105, 28744, 28382, 28019, 27655, 27290, 26924, 26557, 26189, 25820, 25450, 25079, 24707, 24334, 23960, 23585, 23210, 22833, 22456, 22078, 21699, 21319, 20938, 20557, 20174, 19791, 19408, 19023, 18638, 18252, 17866, 17478, 17091, 16702, 16313, 15923, 15533, 15142, 14750, 14358, 13965, 13572, 13179, 12785, 12390, 11995, 11599, 11203, 10807, 10410, 10013, 9615, 9217, 8819, 8420, 8021, 7622, 7223, 6823, 6423, 6022, 5622, 5221, 4820, 4419, 4018, 3616, 3215, 2813, 2411, 2009, 1607, 1205, 803, 401, 0, -402, -804, -1206, -1608, -2010, -2412, -2814, -3216, -3617, -4019, -4420, -4821, -5222, -5623, -6023, -6424, -6824, -7223, -7623, -8022, -8421, -8820, -9218, -9616, -10014, -10411, -10808, -11204, -11600, -11996, -12391, -12785, -13180, -13573, -13966, -14359, -14751, -15143, -15534, -15924, -16314, -16703, -17091, -17479, -17867, -18253, -18639, -19024, -19409, -19792, -20175, -20557, -20939, -21320, -21699, -22078, -22457, -22834, -23210, -23586, -23961, -24335, -24708, -25080, -25451, -25821, -26190, -26558, -26925, -27291, -27656, -28020, -28383, -28745, -29106, -29466, -29824, -30182, -30538, -30893, -31247, -31600, -31952, -32303, -32652, -33000, -33347, -33692, -34036, -34379, -34721, -35062, -35401, -35738, -36075, -36410, -36743, -37076, -37407, -37736, -38064, -38391, -38716, -39040, -39362, -39683, -40002, -40320, -40636, -40951, -41264, -41576, -41886, -42194, -42501, -42806, -43110, -43412, -43712, -44011, -44308, -44604, -44898, -45190, -45480, -45769, -46056, -46341, -46624, -46906, -47186, -47464, -47741, -48015, -48288, -48559, -48828, -49095, -49361, -49624, -49886, -50146, -50404, -50660, -50914, -51166, -51417, -51665, -51911, -52156, -52398, -52639, -52877, -53114, -53349, -53581, -53812, -54040, -54267, -54491, -54713, -54934, -55152, -55368, -55582, -55794, -56004, -56212, -56418, -56621, -56823, -57022, -57219, -57414, -57607, -57797, -57986, -58172, -58356, -58538, -58718, -58895, -59071, -59244, -59414, -59583, -59749, -59913, -60075, -60235, -60392, -60547, -60700, -60850, -60998, -61144, -61288, -61429, -61568, -61705, -61839, -61971, -62101, -62228, -62353, -62476, -62596, -62714, -62829, -62942, -63053, -63162, -63268, -63371, -63473, -63572, -63668, -63762, -63854, -63943, -64030, -64115, -64197, -64276, -64354, -64428, -64501, -64571, -64638, -64703, -64766, -64826, -64884, -64939, -64992, -65043, -65091, -65136, -65179, -65220, -65258, -65294, -65327, -65358, -65386, -65412, -65436, -65457, -65475, -65491, -65505, -65516, -65524, -65531, -65534, -65535, -65534, -65531, -65524, -65516, -65505, -65491, -65475, -65457, -65436, -65412, -65386, -65358, -65327, -65294, -65258, -65220, -65179, -65136, -65091, -65043, -64992, -64939, -64884, -64826, -64766, -64703, -64638, -64571, -64501, -64428, -64353, -64276, -64196, -64114, -64030, -63943, -63854, -63762, -63668, -63571, -63472, -63371, -63267, -63161, -63053, -62942, -62829, -62713, -62595, -62475, -62352, -62228, -62100, -61971, -61839, -61704, -61568, -61429, -61287, -61144, -60998, -60850, -60699, -60547, -60392, -60234, -60075, -59913, -59749, -59582, -59414, -59243, -59070, -58895, -58717, -58537, -58356, -58171, -57985, -57797, -57606, -57413, -57218, -57021, -56822, -56620, -56417, -56211, -56003, -55793, -55581, -55367, -55151, -54933, -54713, -54490, -54266, -54039, -53811, -53580, -53348, -53113, -52877, -52638, -52397, -52155, -51910, -51664, -51416, -51165, -50913, -50659, -50403, -50145, -49885, -49623, -49360, -49094, -48827, -48558, -48287, -48014, -47740, -47463, -47185, -46905, -46623, -46340, -46055, -45768, -45479, -45189, -44896, -44603, -44307, -44010, -43711, -43411, -43109, -42805, -42500, -42193, -41884, -41574, -41263, -40950, -40635, -40319, -40001, -39682, -39361, -39039, -38715, -38390, -38063, -37735, -37405, -37075, -36742, -36409, -36074, -35737, -35399, -35060, -34720, -34378, -34035, -33691, -33345, -32999, -32651, -32301, -31951, -31599, -31246, -30892, -30537, -30181, -29823, -29464, -29105, -28744, -28382, -28019, -27655, -27290, -26924, -26557, -26188, -25819, -25449, -25078, -24706, -24333, -23959, -23585, -23209, -22833, -22455, -22077, -21698, -21318, -20937, -20556, -20174, -19791, -19407, -19023, -18637, -18252, -17865, -17478, -17090, -16701, -16312, -15922, -15532, -15141, -14750, -14358, -13965, -13572, -13178, -12784, -12389, -11994, -11599, -11203, -10806, -10409, -10012, -9615, -9217, -8818, -8420, -8021, -7622, -7222, -6822, -6422, -6022, -5621, -5221, -4820, -4418, -4017, -3616, -3214, -2812, -2411, -2009, -1607, -1205, -803, -401, 1];
private static var PARAM_DS_LASER:int = 17;
private static var quub2:Array = ["#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####", "#####"];
private static var LASER:int = 4;
private static var llClear:int = 1;
private static var PLAYGAME_LIFE_LOST:int = 3;
private static var PARAM_ZAPZS:int = 11;
private static var HEADBASE:int = 78;
private static var SPECIALS_ENABLED:int = 0;
private static var PLAYGAME_PLAY:int = 2;
private static var FPP:int = 16;
private static var PARAM_TAILSHIELD:int = 3;
private static var throb:int = 0;
private static var gabmex_width:Array = [24, 18, 5, 13, 5, 27, 40, 21, 5, 19];
private static var PARAM_XSPEED:int = 6;
private static var PARAM_TURN_SPEED:int = 15;
private static var gabmex_ztwist:Array = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
private static var endingText:Array = ["llongyfarchiadau!", " ", "you may have beaten the levels", "this time around... but now it", "gets harder!", " ", "award yourself a nice cup of", "tea and some pleasant thoughts", "about oxen!", " ", "now carry on, we'll kick", "your arse eventually m'deer...", " ", " ", "shysheep salutes ewe", "with stars in her nose!", null];
private static var fhundred:Array = ["##### #### #### ", "##### ###### ######", "## ## ## ## ##", "## ## ## ## ##", "## ## ## ## ##", "## ## ## ## ##", "#### ## ## ## ##", "##### ## ## ## ##", " ## ## ## ## ##", " ## ## ## ## ##", " ## ## ## ## ##", " ## ## ## ## ##", "##### ###### ######", "#### #### #### "];
private static var BULLRESPURT:int = 2;
private static var lasermasks:Array = [4294967295, 4278124286, 4244438268, 4177066232, 4042322160, 3772834016, 3233857728, 2155905152];
private static var TAILBASE:int = (HEADBASE - MAXHEADS);
private static var gabmex_height:Array = [12, 7, 5, 7, 5, 13, 7, 7, 5, 14];
private static var PLAYGAME_GAME_OVER:int = 5;
private static var PILL:int = 88;
private static var white_throb:int = 2;
private static var bluemesh:int = 11;
private static var thou:Array = ["## ### ### ### ", " # # # # # # #", " # # # # # # #", " # # # # # # #", " # # # # # # #", " # # # # # # #", "### ### ### ### "];
private static var gabmex_def:Array = [gszGR, hundred, quub, twenty, rezin, gover, bonus, thou, quub2, fhundred];
private static var RSG_MASK = 2734686208;
private static var PARAM_SEP:int = 8;
private static var GAME_PLAY:int = 2;
private static var BULLNUM:int = 10;
private static var PARAM_DS_MODE:int = 16;
private static var PARAM_YSPEED:int = 7;
private static var theblues:int = 9;
private static var BlueFlash:Array = [0, 0x2000, 0x4000, 0x8000, 0xF000, 4294967040, 0, 4294967040, 0, 4294967040, 0, 4294967040];
private static var PLAYGAME_START_LIFE:int = 1;
private static var purplemesh:int = 12;
private static var gaCGEN4_g_hi:Array = [0xFF, 0xFF, 240, 239, 95, 0xFF, 0xFF, 0xFF, 0, 96, 0, 0, 0, 128];
private static var MAXHEADS:int = 8;
private static var reding:int = 10;
private static var exp1:Array = [0x100010, 0x100020, 0x100030, 0x100040, 0x400050, 0x400060, 0x400070, 0x400080, 0x800080, 0x800070, 0x800060, 0x800050, 0xC00040, 0xC00030, 0xC00020, 0xC00010, 1, 8, 128, 128, 0xFF];
private static var quub:Array = ["#####", "# #", "# #", "# #", "#####", "# #", " ", " ", " ", "# #", "# #", " ", " # ", " ", "# #", "# #", " ", " ", " ", "# #", "#####", "# #", "# #", "# #", "#####"];
private static var gover:Array = [" #### ### # # #####", "# # # ## ## # ", "# # # # # # # # ", "# ## ##### # # # #### ", "# # # # # # # ", " #### # # # # #####", " ", " ### # # ###### #### ", "# # # # # # #", "# # # # # # #", "# # # # #### #### ", "# # # # # # # ", " ### # ###### # #"];
private static var aControl:Array = [control0, control1, control2, control3, control4, control5, control6, control7, control8, control9];
private static var gaCGEN4_r_hi:Array = [0xFF, 0xFF, 240, 239, 127, 0xFF, 0xFF, 0xFF, 112, 32, 240, 0, 128, 128];
private static var e_UseSparkle:int = 4;
private static var deep_throb:int = 3;
private static var gaCGEN4_b:Array = [38010, 103546, 0x120000, 38010, 11796, 0, 327680, 157286, 0, 131072, 131072, 655360, 458752, 393216];
private static var gabmex_ztwistspeed:Array = [-8192, 0, 0, 0, 0, -8192, 0, 0, 0, 0];
private static var PARAM_PODSIZE:int = 12;
private static var gaCGEN4_g:Array = [41943, 192675, 0x120000, 41943, 9175, 943718, 0, 222822, 91750, 91750, 0, 0, 0, 393216];
private static var gaCGEN4_b_hi:Array = [0xFF, 0xFF, 0xFF, 239, 159, 0, 192, 0xFF, 128, 0xFF, 127, 0xFF, 95, 207];
private static var DRONEBASE:int = 12;
private static var PARAM_ZOOINC:int = 4;
private static var PARAM_HEADFREE:int = 5;
private static var PARAM_DS_VEL:int = 18;
private static var gaCGEN4_r:Array = [45875, 111411, 0x120000, 45875, 6553, 0, 0, 91750, 72089, 0, 222822, 0, 393216, 393216];
private static var PARAM_TAILSIZE:int = 1;
private static var BLACK:int = 0;
private static var twenty:Array = [" #### #### ", "## ## ## ##", " ## ## ##", " ## ## ##", " ## ## ##", " ## ## ##", "###### #### "];
private static var BONBASE:int = 110;
private static var TAILG:int = 116;
private static var GAME_SETUP:int = 1;
private static var explosions:Array = [[0, 1023, 128, 0, 15, 64], [0, 1023, 64, -64, 0, 8]];
public function Gridrunner(_arg1:Platform, _arg2:Game){
var _local3:int;
Sprites = new Array(369);
gaHeightTable = new Array(Prefs.SCREEN_HEIGHT);
LVM_mode = llClear;
LVM_xhi = (Prefs.SCREEN_WIDTH - 1);
LVM_yhi = (Prefs.SCREEN_HEIGHT - 1);
LVM_mouseX = (Prefs.DOUBLE_SCREEN) ? Prefs.SCREEN_WIDTH : Prefs.SCREEN_WIDTH_HALF;
LVM_mouseY = (Prefs.DOUBLE_SCREEN) ? Prefs.SCREEN_HEIGHT : Prefs.SCREEN_HEIGHT_HALF;
things = new Array(116);
WINDXHI = Prefs.SCREEN_WIDTH;
WINDYHI = Prefs.SCREEN_HEIGHT;
stack = new Array(16);
gr = [1, 2, 5, 3, 1, 3, 0, 0];
LVM_flashp = BlueFlash;
thisLevel = Prefs.START_LEVEL;
demoLevels = [12, 14, 15, 18, 22, 32, 39];
zapx = Prefs.SCREEN_WIDTH;
zapy = Prefs.SCREEN_HEIGHT;
AREAX = (Prefs.SCREEN_WIDTH * 2);
AREAY = (Prefs.SCREEN_HEIGHT * 2);
podmap = new Array(Prefs.NPODS);
rTmp = new Rectangle();
steps = new Array(32);
gPlayGameState = PLAYGAME_SETUP;
gGRthingy = new Thingie();
gGameState = GAME_OPEN;
super();
gPlatform = _arg1;
gGame = _arg2;
_local3 = 0;
while (_local3 < NSPRITES) {
things[_local3] = new Thingie();
things[_local3].mode = 0;
_local3++;
};
if (Prefs.USE_Y_ARRAY){
_local3 = 0;
while (_local3 < Prefs.SCREEN_HEIGHT) {
gaHeightTable[_local3] = int((_local3 * Prefs.SCREEN_WIDTH));
_local3++;
};
};
_local3 = 0;
while (_local3 < Sprites.length) {
Sprites[_local3] = new SPRITE();
_local3++;
};
}
private function killbody(_arg1:int, _arg2:int):void{
var _local3:Thingie;
_local3 = things[_arg1];
_local3.xv1 = (((things[SHIP].x1 + OFFX) - _local3.x1) >> 8);
_local3.yv1 = (((things[SHIP].y1 + OFFY) - _local3.y1) >> 7);
_local3.xv2 = 0;
_local3.yv2 = 0;
skore(20);
_local3.flags = (_local3.flags & (COLLIDE ^ -1));
_local3.zv1 = -128;
_local3.zv2 = 0;
_local3.spritenum = 131072;
_local3.spritenum2 = 131072;
_local3.mode = 5;
_local3.drawMode = 8;
_local3.ExplosionTime = 0;
_local3.expNum = _arg2;
}
private function node(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):void{
var _local8:int;
var _local9:int;
_local8 = _arg2;
while (_local8 < LVM_xhi) {
_local9 = _arg3;
while (_local9 < LVM_yhi) {
VLineFill(_arg1, _local8, (_local9 - _arg7), (_arg7 << 1));
HLineFill(_arg1, (_local8 - _arg6), _local9, (_arg6 << 1));
_local9 = (_local9 + _arg5);
};
_local8 = (_local8 + _arg4);
};
}
private function VLineFill(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
if (_arg4 < 1){
_arg4 = (_arg4 + 1);
};
rTmp.left = _arg2;
rTmp.right = rTmp.left;
rTmp.top = _arg3;
rTmp.bottom = ((rTmp.top + _arg4) + 1);
ColourFill(_arg1, rTmp);
}
private function DrawDotCross(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:int;
if ((((_arg2 < 1)) || ((_arg2 > (Prefs.SCREEN_WIDTH - 2))))){
return;
};
if ((((_arg3 > 1)) && ((_arg3 < (Prefs.SCREEN_HEIGHT - 2))))){
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
_local4 = (_local4 + (gaHeightTable[_arg3] + _arg2));
} else {
_local4 = (_local4 + (_arg2 + (_arg3 * Prefs.SCREEN_WIDTH)));
};
if (Prefs.DRAW_DOTCROSS){
if ((frames & 1) != 0){
gPlatform.buffer[(_local4 - Prefs.SCREEN_WIDTH)] = _arg1;
gPlatform.buffer[(_local4 + Prefs.SCREEN_WIDTH)] = _arg1;
} else {
gPlatform.buffer[(_local4 - 1)] = _arg1;
gPlatform.buffer[(_local4 + 1)] = _arg1;
};
} else {
gPlatform.buffer[_local4] = _arg1;
};
} else {
if (Prefs.DRAW_DOTCROSS){
if ((frames & 1) != 0){
gPlatform.drawPixel(_arg2, (_arg3 - 1), _arg1);
gPlatform.drawPixel(_arg2, (_arg3 + 1), _arg1);
} else {
gPlatform.drawPixel((_arg2 - 1), _arg3, _arg1);
gPlatform.drawPixel((_arg2 + 1), _arg3, _arg1);
};
} else {
gPlatform.drawPixel(_arg2, _arg3, _arg1);
};
};
};
}
private function grid3d_softnode(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
_arg4 = (0 - (_arg4 % _arg8));
_local14 = (((_arg1 >> 8) & 0xFF0000) / _arg7);
_local15 = ((_arg1 & 0xFF0000) / _arg7);
_local16 = (((_arg1 << 8) & 0xFF0000) / _arg7);
_local17 = 0;
_local18 = 0;
_local19 = 0;
_local13 = ((Prefs.GRID_START_Z + _arg4) + (_arg7 * _arg8));
while (_local13 > _arg8) {
_local17 = (_local17 + _local14);
if (_local17 > 0xFF0000){
_local17 = 0xFF0000;
};
_local18 = (_local18 + _local15);
if (_local18 > 0xFF0000){
_local18 = 0xFF0000;
};
_local19 = (_local19 + _local16);
if (_local19 > 0xFF0000){
_local19 = 0xFF0000;
};
_local11 = (_arg5 / _local13);
_local12 = (_arg6 / _local13);
_local9 = (((_arg2 / _local13) + Prefs.SCREEN_WIDTH_HALF) % _local11);
_local10 = (((_arg3 / _local13) + Prefs.SCREEN_HEIGHT_HALF) % _local12);
softnode(((((_local17 & 0xFF0000) << 8) | (_local18 & 0xFF0000)) | ((_local19 & 0xFF0000) >> 8)), (_local9 << 16), (_local10 << 16), (_local11 << 16), (_local12 << 16), (_local11 << 12), (_local12 << 12), 4);
_local13 = (_local13 - _arg8);
};
}
public function canPause():Boolean{
return (!((gPlayGameState == PLAYGAME_START_LIFE)));
}
private function GotYou():void{
var _local1:Thingie = things[SIGN1];
_local1.mode = 18;
_local1.counter1 = 0;
_local1.drawMode = 16;
_local1.animMode = -1;
_local1.spritenum = 0x0100;
_local1.RanSeed = ((826366247 * gPlatform.random(0x0200)) >> 9);
_local1.chunkX = 8;
_local1.chunkY = 1;
_local1.RandYMag = 64;
_local1.RandXMag = 240;
_local1.GeomXInc = 16;
_local1.GeomYInc = 0;
_local1.GeomXStep = 0;
_local1.GeomYStep = 96;
_local1.GeomXOffset = 0;
_local1.GeomYOffset = 0;
_local1.flags = 0;
_local1.Flags = 0;
}
private function bar(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
_local6 = _arg2;
while (_local6 < _arg4) {
hline(_arg1, _local6, (_arg3 - _arg1), _arg5);
_local6++;
};
}
private function FinishGameScreen():void{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
_local7 = 0;
if (Prefs.SHOW_FPS){
_local1 = gPlatform.getActualFPS().toString();
} else {
_local1 = score.toString();
};
_local2 = 0;
_local4 = 10;
_local6 = _local1.length;
while (_local2 < _local6) {
_local3 = ((94 - 48) + _local1.charCodeAt(_local2));
SetTint(ColourGenF(whitelight, (count + _local7)));
_local7 = (_local7 + 1043);
DrawCenteredObject(_local3, 0xFF, _local4, Prefs.SCORE_Y);
_local4 = (_local4 + (Sprites[_local3].xSize + 2));
_local2++;
};
_local5 = ((_local4)>Prefs.OX) ? (_local4 - Prefs.OX) : 0;
SetTint(ColourGenF(deep_throb, (count + _local7)));
DrawCenteredObject(106, 0xFF, (Prefs.OX1 + _local5), Prefs.SCORE_Y);
_local7 = (_local7 + 2084);
SetTint(ColourGenF(deep_throb, (count + _local7)));
if (Prefs.SHOW_LEVEL){
DrawCenteredObject((94 + (thisLevel / 10)), 0xFF, (Prefs.OX2 + _local5), Prefs.SCORE_Y);
DrawCenteredObject((94 + (thisLevel % 10)), 0xFF, ((Prefs.OX2 + _local5) + 16), Prefs.SCORE_Y);
} else {
DrawCenteredObject((94 + bm), 0xFF, (Prefs.OX2 + _local5), Prefs.SCORE_Y);
};
SetTint(0);
_local4 = ((lives)>Prefs.MAX_SCREEN_LIVES) ? Prefs.MAX_SCREEN_LIVES : lives;
_local3 = (Prefs.OX3 - (_local4 << 2));
_local2 = 0;
while (_local2 < _local4) {
DrawCenteredObject(358, 0xFF, (_local3 + (_local2 << 2)), Prefs.SCORE_Y);
_local2++;
};
if (SheepyZapState == 1){
SheepyZapTotalTime--;
if (SheepyZapDwellTime != 0){
SetTint(ColourGen(whitelight));
DrawCenteredObject((197 + SheepyZapDwellTime), 0xFF, (LastZapX >> 16), (LastZapY >> 16));
JaggyLine(things[SHIP].x1, (things[SHIP].y1 - (8 << 16)), LastZapX, LastZapY, 20, ColourGen(fire));
SheepyZapDwellTime--;
SetTint(0);
} else {
_local2 = SheepyZapTarget;
while (_local2 < SHIP) {
if ((((((((((things[_local2].mode == 3)) || ((things[_local2].mode == 4)))) || ((things[_local2].mode == 16)))) || ((things[_local2].mode == 17)))) && (!(((things[_local2].flags & COLLIDE) == 0))))){
if (Visible(things[_local2])){
SheepyZapTarget = _local2;
_local2 = 1000;
};
};
_local2++;
};
if (_local2 == SHIP){
if (SheepyZapTotalTime < 0){
SheepyZapState = -1;
};
SheepyZapTarget = 0;
SheepyZapDwellTime = 0;
} else {
JaggyLine(things[SHIP].x1, (things[SHIP].y1 - (8 << 16)), (things[SheepyZapTarget].x1 - OFFX), (things[SheepyZapTarget].y1 - OFFY), 20, ColourGen(whitelight));
SheepyZapDwellTime = 4;
LastZapX = (things[SheepyZapTarget].x1 - OFFX);
LastZapY = (things[SheepyZapTarget].y1 - OFFY);
};
};
};
if ((((levelup == 1)) && ((BOLLOCKS < 0)))){
DrawCenteredObject(248, 0xFF, Prefs.SCREEN_WIDTH_HALF, ((Prefs.SCREEN_HEIGHT + 20) + (BOLLOCKS << 2)));
};
if (lanTimer > 0){
lanTimer--;
};
}
private function RSG():int{
if ((RanSeed & 1) == 1){
RanSeed = ((RanSeed >> 1) ^ RSG_MASK);
} else {
RanSeed = (RanSeed >> 1);
};
return (RanSeed);
}
private function grabSprite(_arg1:int):Boolean{
var _local2:ByteArray;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
gPlatform.getResource();
_local2 = gPlatform.getResourceBytes();
if (_local2 == null){
return (false);
};
Sprites[_arg1] = new SPRITE();
Sprites[_arg1].xSize = _local2[0];
Sprites[_arg1].ySize = _local2[1];
_local3 = (Sprites[_arg1].xSize * Sprites[_arg1].ySize);
Sprites[_arg1].bits = new Array(_local3);
_local4 = 0;
while (_local4 < _local3) {
_local5 = _local2[((_local4 << 1) + 2)];
_local5 = (_local5 + (_local2[((_local4 << 1) + 3)] << 8));
_local6 = ((_local5 & (31 << 10)) >> 10);
_local7 = ((_local5 & (31 << 5)) >> 5);
_local8 = (_local5 & 31);
Sprites[_arg1].bits[_local4] = (((_local6 << 19) + (_local7 << 11)) + (_local8 << 3));
_local4++;
};
return (true);
}
private function HLineFillM(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
rTmp.left = _arg2;
rTmp.right = (rTmp.left + _arg4);
rTmp.top = _arg3;
rTmp.bottom = (rTmp.top + 1);
HFillMask(_arg1, rTmp, _arg5);
}
private function line(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
if ((((_arg1 < 0)) && ((_arg3 < 0)))){
return;
};
if ((((_arg2 < 0)) && ((_arg4 < 0)))){
return;
};
if (_arg2 > _arg4){
_local9 = _arg2;
_arg2 = _arg4;
_arg4 = _local9;
_local9 = _arg1;
_arg1 = _arg3;
_arg3 = _local9;
};
_local6 = 0;
_local7 = 0;
_local8 = Math.abs((_arg3 - _arg1));
if (Math.abs((_arg4 - _arg2)) > _local8){
_local8 = Math.abs((_arg4 - _arg2));
};
_local8 = (_local8 >> FPP);
if (_local8 != 0){
_local6 = ((_arg3 - _arg1) / _local8);
_local7 = ((_arg4 - _arg2) / _local8);
};
if (_arg2 < 0){
if (_local7 > 0){
_local10 = (-((_arg2 / _local7)) + 1);
_arg1 = (_arg1 + (_local6 * _local10));
_arg2 = (_arg2 + (_local7 * _local10));
_local8 = (_local8 - _local10);
} else {
_local8 = 0;
};
};
if (_local8 > 0){
if (_arg1 < 0){
if (_local6 > 0){
_local10 = (-((_arg1 / _local6)) + 1);
_arg1 = (_arg1 + (_local6 * _local10));
_arg2 = (_arg2 + (_local7 * _local10));
_local8 = (_local8 - _local10);
} else {
_local8 = 0;
};
};
};
if (_local8 > 0){
if (_arg4 > ((Prefs.SCREEN_HEIGHT - 1) << FPP)){
if (_local7 > 0){
_local10 = (((_arg4 - ((Prefs.SCREEN_HEIGHT - 1) << FPP)) / _local7) + 1);
_arg3 = (_arg3 - (_local6 * _local10));
_arg4 = (_arg4 - (_local7 * _local10));
_local8 = (_local8 - _local10);
} else {
_local8 = 0;
};
};
};
if (_local8 > 0){
if (_arg3 > ((Prefs.SCREEN_WIDTH - 1) << FPP)){
if (_local6 > 0){
_local10 = (((_arg3 - ((Prefs.SCREEN_WIDTH - 1) << FPP)) / _local6) + 1);
_arg3 = (_arg3 - (_local6 * _local10));
_arg4 = (_arg4 - (_local7 * _local10));
_local8 = (_local8 - _local10);
} else {
_local8 = 0;
};
};
};
if (_local8 > 0){
if (((((_arg2 >> FPP) > 0)) && (((_arg2 >> FPP) < Prefs.SCREEN_HEIGHT)))){
_local10 = 0;
while (_local10 < (_local8 + 1)) {
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
gPlatform.buffer[(gaHeightTable[(_arg2 >> FPP)] + (_arg1 >> FPP))] = _arg5;
} else {
gPlatform.buffer[(((_arg2 >> FPP) * Prefs.SCREEN_WIDTH) + (_arg1 >> FPP))] = _arg5;
};
} else {
gPlatform.drawPixel((_arg1 >> FPP), (_arg2 >> FPP), _arg5);
};
_arg1 = (_arg1 + _local6);
_arg2 = (_arg2 + _local7);
_local10++;
};
};
};
}
private function playSound(_arg1:int):void{
gGame.playSound(_arg1);
}
private function RandomLoop(_arg1:Thingie):void{
if (gPlatform.random(0x0200) < loop_prob){
_arg1.counter2 = 64;
if (gPlatform.random(8) < 4){
_arg1.counter2 = (0 - _arg1.counter2);
};
_arg1.timer = _arg1.counter1;
_arg1.counter1 = (_arg1.counter1 + _arg1.counter2);
_arg1.mode2 = ((_arg1.mode2 << 16) | 1);
};
}
private function killhead(_arg1:int, _arg2:int):void{
var _local3:Thingie;
_local3 = things[_arg1];
_local3.mode = 5;
_local3.drawMode = 8;
_local3.pointer = exp1;
_local3.xv1 = (((things[SHIP].x1 + OFFX) - _local3.x1) >> 6);
_local3.yv1 = (((things[SHIP].y1 + OFFY) - _local3.y1) >> 5);
_local3.xv2 = 0;
_local3.yv2 = 0;
_local3.zv2 = 0;
skore(100);
_local3.spritenum = 131072;
_local3.spritenum2 = 131072;
_local3.zv1 = -128;
_local3.ExplosionTime = 0;
_local3.flags = (COLLIDE ^ -1);
_local3.expNum = _arg2;
}
private function HitShip(_arg1:int, _arg2:int, _arg3:int):Boolean{
if (things[SHIP].mode == 14){
return (false);
};
var _local4 = ((things[SHIP].x1 + OFFX) >> 16);
var _local5 = ((things[SHIP].y1 + OFFY) >> 16);
if (BOLLOCKS != 0){
return (false);
};
if ((((Math.abs((_local4 - _arg1)) < _arg3)) && ((Math.abs((_local5 - _arg2)) < _arg3)))){
return (true);
};
return (false);
}
private function grid3d(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int, _arg9:int):void{
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
if ((((Prefs.DOTNODE == false)) && (((_arg9 & 0xFF) == 1)))){
return;
};
if ((((Prefs.NODE == false)) && (((_arg9 & 0xFF) == 0)))){
return;
};
_local21 = (_arg9 >> 24);
_local22 = ((_arg9 >> 16) & 0xFF);
_local23 = ((_arg9 >> 8) & 0xFF);
_arg9 = (_arg9 & 0xFF);
_arg4 = (0 - (_arg4 % _arg8));
_local15 = (((_arg1 >> 8) & 0xFF0000) / _arg7);
_local16 = ((_arg1 & 0xFF0000) / _arg7);
_local17 = (((_arg1 << 8) & 0xFF0000) / _arg7);
_local18 = 0;
_local19 = 0;
_local20 = 0;
_local14 = ((Prefs.GRID_START_Z + _arg4) + (_arg7 * _arg8));
while (_local14 > _arg8) {
_local18 = (_local18 + _local15);
if (_local18 > 0xFF0000){
_local18 = 0xFF0000;
};
_local19 = (_local19 + _local16);
if (_local19 > 0xFF0000){
_local19 = 0xFF0000;
};
_local20 = (_local20 + _local17);
if (_local20 > 0xFF0000){
_local20 = 0xFF0000;
};
_local12 = (_arg5 / _local14);
_local13 = (_arg6 / _local14);
_local10 = (((_arg2 / _local14) + Prefs.SCREEN_WIDTH_HALF) % _local12);
_local11 = (((_arg3 / _local14) + Prefs.SCREEN_HEIGHT_HALF) % _local13);
switch (_arg9){
case 0:
node(((((_local18 & 0xFF0000) << 8) | (_local19 & 0xFF0000)) | ((_local20 & 0xFF0000) >> 8)), _local10, _local11, _local12, _local13, (_local12 >> 3), (_local13 >> 3));
break;
case 1:
dotnode(((((_local18 & 0xFF0000) << 8) | (_local19 & 0xFF0000)) | ((_local20 & 0xFF0000) >> 8)), (_local10 << 16), (_local11 << 16), (_local12 << 16), (_local13 << 16), ((_local12 << 16) >> _local22), ((_local13 << 16) >> _local23), _local21);
break;
case 2:
softnode(((((_local18 & 0xFF0000) << 8) | (_local19 & 0xFF0000)) | ((_local20 & 0xFF0000) >> 8)), (_local10 << 16), (_local11 << 16), (_local12 << 16), (_local13 << 16), ((_local12 << 16) >> _local22), ((_local13 << 16) >> _local23), _local21);
break;
case 3:
softnodebox(((((_local18 & 0xFF0000) << 8) | (_local19 & 0xFF0000)) | ((_local20 & 0xFF0000) >> 8)), (_local10 << 16), (_local11 << 16), (_local12 << 16), (_local13 << 16), ((_local12 << 16) >> _local22), ((_local13 << 16) >> _local23), _local21);
break;
};
_local14 = (_local14 - _arg8);
};
}
private function Visible(_arg1:Thingie):Boolean{
var _local2:int;
var _local3:int;
_local3 = Sprites[_arg1.spritenum].xSize;
_local2 = (_arg1.x1 >> 16);
if (_local2 < WINDXLO){
if (Math.abs((_local2 - WINDXLO)) > _local3){
return (false);
};
} else {
if ((_local2 - WINDXHI) > _local3){
return (false);
};
};
_local3 = Sprites[_arg1.spritenum].ySize;
_local2 = (_arg1.y1 >> 16);
if (_local2 < WINDYLO){
if (Math.abs((_local2 - WINDYLO)) > _local3){
return (false);
};
} else {
if ((_local2 - WINDYHI) > _local3){
return (false);
};
};
return (true);
}
private function Behave(_arg1:Thingie, _arg2:int):void{
var _local3:Thingie;
var _local4:Thingie;
var _local5:PART;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
if (motion == 0){
return;
};
switch ((_arg1.mode & 0xFF)){
case 1:
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_arg1.trail_it[_local7].x = _arg1.x1;
_arg1.trail_it[_local7].y = _arg1.y1;
if (BOLLOCKS != 0){
if (levelup != 0){
BOLLOCKS--;
} else {
BOLLOCKS++;
};
};
_arg1.x2 = (LVM_mouseX << 16);
if (BOLLOCKS > 0){
_local8 = (_arg1.x2 - _arg1.x1);
_local8 = (_local8 >> 3);
_arg1.x1 = (_arg1.x1 + _local8);
if (_arg1.x1 < 0){
_arg1.x1 = 0;
};
if ((_arg1.x1 >> 16) > (Prefs.SCREEN_WIDTH - 1)){
_arg1.x1 = ((Prefs.SCREEN_WIDTH - 1) << 16);
};
return;
} else {
if (BOLLOCKS == -1){
playSound(Prefs.SFX_HUM);
_arg1.drawMode = 0;
_arg1.flags = (_arg1.flags & (128 ^ -1));
};
ZOO = (ZOO + (ZOOINC << ((things[PILL].gen1)>0) ? 4 : 0));
_arg1.y2 = (LVM_mouseY << 16);
if (((!(Prefs.LEVEL_SKIP)) && (((gGame.gbKeySelect) || (gGame.gbMouseClicked))))){
gGame.gbKeySelect = false;
gGame.gbMouseClicked = false;
if (SheepyZapState == 0){
playSound(Prefs.SFX_SHEEPIE_ZAPPER);
SheepyZapState = 1;
SheepyZapTotalTime = (50 + (bm << 5));
SheepyZapTarget = 0;
};
};
if ((((BOLLOCKS == 0)) || (!(((_arg1.flags & 128) == 0))))){
if (--BULLSPURT < 0){
BULLSPURT = BULLRESPURT;
_local6 = BULLBASE;
while (_local6 < (BULLBASE + BULLNUM)) {
_local3 = things[_local6];
if (_local3.mode == 0){
_local3.x1 = (things[SHIP].x1 + OFFX);
_local3.y1 = (things[SHIP].y1 + OFFY);
_local3.animMode = 1;
_local3.drawMode = 2;
_local3.spritenum = 7;
_local3.animData[0] = 7;
_local3.animData[2] = 1;
_local3.animData[3] = 10;
_local3.xv1 = 0;
_local3.xv2 = 0;
_local3.yv1 = -65536;
_local3.yv2 = -4096;
_local3.timer = 6;
_local3.mode = 2;
if (Prefs.BULLET_TRAIL){
_local3.checkTrail();
_local7 = 0;
while (_local7 < Prefs.TRAIL_LEN) {
_local3.trail_it[_local7].i = -1;
_local7++;
};
};
_local3.trail_p = 0;
_local6 = (_local6 + BULLNUM);
};
_local6++;
};
if (bm > 1){
_local6 = (BULLBASE + BULLNUM);
while (_local6 < (BULLBASE + (BULLNUM << 1))) {
_local3 = things[_local6];
if (_local3.mode == 0){
_local10 = (things[SHIP].trail_p - ((1 + auxfire) << 2));
_local8 = (things[SHIP].trail_it[(_local10 & (Prefs.TRAIL_LEN - 1))].x + OFFX);
_local9 = (things[SHIP].trail_it[(_local10 & (Prefs.TRAIL_LEN - 1))].y + OFFY);
_local3.x1 = _local8;
_local3.y1 = _local9;
_local3.animMode = -1;
_local3.drawMode = 15;
_local3.animData[2] = 1;
_local3.animData[3] = 10;
_local3.xv1 = 0;
_local3.xv2 = 0;
_local3.mode = 2;
_local3.trail_p = 0;
_local10 = ((bm)>3) ? 2 : 0;
if (((auxfire - 1) & 1) != 0){
_local3.yv1 = 524288;
_local3.spritenum = (108 + _local10);
_local3.yv2 = 0x2000;
} else {
_local3.yv1 = -524288;
_local3.spritenum = (107 + _local10);
_local3.yv2 = -8192;
};
_local6 = (_local6 + BULLNUM);
auxfire = ((auxfire + 1) % bm);
};
_local6++;
};
};
};
};
_local8 = (_arg1.x2 - _arg1.x1);
_local9 = (_arg1.y2 - _arg1.y1);
_local8 = (_local8 >> 3);
_local9 = (_local9 >> 3);
_arg1.x1 = (_arg1.x1 + _local8);
_arg1.y1 = (_arg1.y1 + _local9);
if (_arg1.x1 < 0){
_arg1.x1 = 0;
};
if ((_arg1.x1 >> 16) > (Prefs.SCREEN_WIDTH - 1)){
_arg1.x1 = ((Prefs.SCREEN_WIDTH - 1) << 16);
};
if (_arg1.y1 < 0){
_arg1.y1 = 0;
};
if ((_arg1.y1 >> 16) > (Prefs.SCREEN_HEIGHT - 1)){
_arg1.y1 = ((Prefs.SCREEN_HEIGHT - 1) << 16);
};
};
break;
case 2:
_local8 = ((_arg1.x1 + 524288) >> 20);
_local9 = ((_arg1.y1 + 524288) >> 20);
_local6 = 1;
if (_arg1.spritenum > 106){
_local8--;
_local6 = (_local6 + 2);
};
if (_arg1.spritenum > 108){
_local8--;
_local6 = (_local6 + 2);
};
if ((((_local9 > -1)) && ((_local9 < Prefs.NPODS_Y)))){
_local15 = (_local9 * Prefs.NPODS_X);
_local7 = 0;
while (_local7 < _local6) {
if ((((_local8 > -1)) && ((_local8 < Prefs.NPODS_X)))){
_local10 = podmap[(_local8 + _local15)];
if ((_local10 & 0xFF) == 1){
_local6 = ((_local10 >> 24) & 0xFF);
++_local6;
if (_local6 > (PODSHIELD + goaround)){
playSound(Prefs.SFX_ZAP2);
podmap[(_local8 + _local15)] = 0;
skore(50);
_arg1.mode = 12;
_arg1.ExplosionTime = 0;
_arg1.gen1 = 0x1000;
_arg1.drawMode = 12;
_arg1.icgen = whitelight;
} else {
playSound(Prefs.SFX_ZAP2);
skore(1);
podmap[(_local8 + _local15)] = ((((_local6 << 24) | (_local6 << 16)) | (_local10 & 0xFF)) | 0x0100);
if (bm < 3){
_arg1.mode = 12;
_arg1.ExplosionTime = 0;
_arg1.gen1 = 0x1000;
_arg1.drawMode = 12;
_arg1.icgen = whitelight;
};
};
};
_local8++;
};
_local7++;
};
};
if (_arg1.mode == 2){
_local6 = 0;
while (_local6 < SHIP) {
_local3 = things[_local6];
if (GotMeR(_arg1, _local6, 16)){
if (_arg1.mode != 0){
if (bm < 3){
_arg1.mode = 0;
};
};
switch (_local3.mode){
case 3:
playSound(Prefs.SFX_ZAP);
if (_local3.shield-- < 0){
makeHead(_local3, _local3.prev, _local3.mode2);
_local8 = (_local3.x1 >> 20);
_local9 = (_local3.y1 >> 20);
if ((((((((_local8 > 0)) && ((_local8 < Prefs.NPODS_X)))) && ((_local9 > 0)))) && ((_local9 < Prefs.NPODS_Y)))){
podmap[(_local8 + (_local9 * Prefs.NPODS_X))] = 16777217;
};
killhead(_local6, 1);
getsheepie();
} else {
_local3.shieldhit = 5;
};
break;
case 4:
playSound(Prefs.SFX_ZAP);
if (_local3.shield-- < 0){
makeHead(_local3, _local3.prev, _local3.mode2);
_local8 = (_local3.x1 >> 20);
_local9 = (_local3.y1 >> 20);
if ((((((((_local8 > 0)) && ((_local8 < Prefs.NPODS_X)))) && ((_local9 > 0)))) && ((_local9 < Prefs.NPODS_Y)))){
podmap[(_local8 + (_local9 * Prefs.NPODS_X))] = 16777217;
};
killbody(_local6, 3);
getsheepie();
} else {
_local3.shieldhit = 5;
};
break;
case 16:
playSound(Prefs.SFX_ZAP);
if (_local3.shield-- < 0){
_local8 = (_local3.x1 >> 20);
_local9 = (_local3.y1 >> 20);
if ((((((((_local8 > 0)) && ((_local8 < Prefs.NPODS_X)))) && ((_local9 > 0)))) && ((_local9 < Prefs.NPODS_Y)))){
podmap[(_local8 + (_local9 * Prefs.NPODS_X))] = 16777217;
};
killbody(_local6, 3);
getsheepie();
} else {
_local3.shieldhit = 5;
};
break;
case 17:
playSound(Prefs.SFX_ZAP);
if (_local3.shield-- < 0){
_local8 = (_local3.x1 >> 20);
_local9 = (_local3.y1 >> 20);
if ((((((((_local8 > 0)) && ((_local8 < Prefs.NPODS_X)))) && ((_local9 > 0)))) && ((_local9 < Prefs.NPODS_Y)))){
podmap[(_local8 + (_local9 * Prefs.NPODS_X))] = 16777217;
};
killbody(_local6, 3);
getsheepie();
} else {
_local3.shieldhit = 5;
};
break;
case 7:
_local3.mode = 9;
_local3.RanSeed = 826366247;
_local3.chunkX = 1;
_local3.chunkY = 8;
_local3.GeomXInc = 32;
_local3.GeomYInc = 0;
_local3.GeomXStep = 0;
_local3.GeomYStep = 32;
_local3.GeomXOffset = 0;
_local3.GeomYOffset = 0;
_local3.Flags = 0;
skore(5);
_local3.flags = (COLLIDE ^ -1);
_local3.drawMode = 1;
_local3.ExplosionTime = 0;
break;
case 13:
skore(100);
if (_local3.gen1 < 1){
_local3.gen2--;
playSound(Prefs.SFX_OOOH);
_local3.spritenum = 5;
};
break;
};
_local6 = SHIP;
};
_local6++;
};
if (OffScreen(_arg1)){
_arg1.mode = 0;
};
};
_arg1.xv1 = (_arg1.xv1 + _arg1.xv2);
_arg1.yv1 = (_arg1.yv1 + _arg1.yv2);
if (_arg1.drawMode != 15){
_arg1.checkTrail();
_local14 = bullfloat;
if (Prefs.BULLET_TRAIL){
_local16 = ColourGenF(throb, (bullfloat = (bullfloat + 1043)));
};
_local6 = 0;
while (_local6 < _arg1.timer) {
if (Prefs.BULLET_TRAIL){
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.i = gPlatform.random(Prefs.TRAIL_LEN);
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.xd = 0;
_local5.yd = 0;
_local5.c = _local16;
};
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
_local6++;
};
bullfloat = (_local14 + 1043);
if (Prefs.BULLET_TRAIL){
_local6 = 0;
while (_local6 < Prefs.TRAIL_LEN) {
_local5 = _arg1.trail_it[_local6];
_arg1.trail_it[_local6].i = (_local5.i - 4);
_local5.x = (_local5.x + _local5.xd);
_local5.y = (_local5.y + _local5.yd);
_local6++;
};
};
} else {
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
};
break;
case 3:
nactive++;
randomFire(_arg1);
if (Visible(_arg1)){
_arg1.invisible = 0;
} else {
_arg1.invisible++;
};
if (_arg1.invisible > 250){
_local13 = _arg2;
do {
things[_local13].mode = 0;
_local13 = things[_local13].prev;
} while (_local13 > -1);
};
_local8 = ((sine[(_arg1.counter1 & 1023)] * _arg1.xv1) >> 8);
_local9 = ((sine[((_arg1.counter1 + 0x0100) & 1023)] * _arg1.yv1) >> 8);
_arg1.x1 = (_arg1.x1 + _local8);
_arg1.y1 = (_arg1.y1 + _local9);
if ((((((((_arg1.x1 > (WINDXLO << 16))) && ((_arg1.x1 < (WINDXHI << 16))))) && ((_arg1.y1 > (WINDYLO << 16))))) && ((_arg1.y1 < (WINDYHI << 16))))){
if (Math.abs((_arg1.x1 - things[PILL].x1)) < nearestPillX){
if (Math.abs((_arg1.y1 - things[PILL].y1)) < nearestPillY){
nearestPillX = Math.abs((_arg1.x1 - things[PILL].x1));
nearestPillY = Math.abs((_arg1.y1 - things[PILL].y1));
nearestPillNum = _arg2;
};
};
};
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = _arg1.z1;
_local5.xd = _arg1.xv1;
_local5.yd = _arg1.yv1;
_local5.o = _arg1.counter1;
_local5.c = ColourGenF(throb, cowfloat);
if (HitShip((_arg1.x1 >> 16), (_arg1.y1 >> 16), 16)){
LVM_flash = 6;
KillShip(_arg1);
};
if (BOLLOCKS > 0){
killhead(_arg2, 1);
};
Superzap(_arg1, _arg2);
_arg1.counter1 = (_arg1.counter1 & 1023);
_local8 = (_arg1.x1 >> 20);
_local9 = (_arg1.y1 >> 20);
if (_local8 < 0){
_local8 = 0;
};
if (_local8 > (Prefs.NPODS_X - 1)){
_local8 = (Prefs.NPODS_X - 1);
};
if (_local9 < 0){
_local9 = 0;
};
if (_local9 > (Prefs.NPODS_Y - 1)){
_local9 = (Prefs.NPODS_Y - 1);
};
switch ((_arg1.mode2 & 0xFF)){
case 0:
if ((podmap[(_local8 + (_local9 * Prefs.NPODS_X))] & 0xFF) == 1){
if ((((_arg1.counter1 == 0x0300)) || ((_arg1.counter1 == 0x0100)))){
_arg1.mode2 = 1;
_arg1.timer = ((_arg1.counter1)==0x0300) ? 0x0100 : 0x0300;
_arg1.counter2 = ((_arg1.counter1)==0x0300) ? 64 : -64;
if ((_arg1.flags & 2) != 0){
_arg1.counter2 = -(_arg1.counter2);
};
};
};
if ((((_arg1.x1 < (WINDXLO << 16))) && (((_arg1.counter1 & 1023) == 0x0300)))){
_arg1.mode2 = 1;
_arg1.timer = 0x0100;
_arg1.counter2 = (((_arg1.flags & 2))!=0) ? -64 : 64;
};
if ((((_arg1.x1 > (WINDXHI << 16))) && (((_arg1.counter1 & 1023) == 0x0100)))){
_arg1.mode2 = 1;
_arg1.timer = 0x0300;
_arg1.counter2 = (((_arg1.flags & 2))!=0) ? 64 : -64;
};
if ((((((_arg1.y1 > (things[SHIP].y1 + OFFY))) && (((_arg1.flags & 2) == 0)))) || ((((_arg1.y1 < (things[SHIP].y1 + OFFY))) && (((_arg1.flags & 2) == 2)))))){
if ((_arg1.counter1 & 1023) < 0x0200){
_arg1.counter2 = 64;
_arg1.timer = 384;
} else {
_arg1.counter2 = -64;
_arg1.timer = 640;
};
_arg1.mode2 = 196609;
};
RandomLoop(_arg1);
break;
case 1:
_arg1.counter1 = (_arg1.counter1 + _arg1.counter2);
if (Math.abs(((_arg1.counter1 & 1023) - _arg1.timer)) < Math.abs(_arg1.counter2)){
_arg1.counter1 = _arg1.timer;
_arg1.mode2 = (_arg1.mode2 >> 16);
};
break;
case 2:
if ((((((_arg1.counter1 == 0x0200)) && ((_arg1.y1 < _arg1.gen1)))) || ((((_arg1.counter1 == 0)) && ((_arg1.y1 > _arg1.gen1)))))){
_arg1.mode2 = 1;
if (_arg1.x1 > things[SHIP].x1){
_arg1.timer = 0x0100;
_arg1.counter2 = 64;
} else {
_arg1.timer = 0x0300;
_arg1.counter2 = -64;
};
};
break;
case 3:
if (_arg1.counter1 == 128){
if (_arg1.y1 > (WINDYHI << 16)){
_arg1.timer = 384;
_arg1.mode2 = 196609;
};
if (_arg1.x1 > (WINDXHI << 16)){
_arg1.timer = 896;
_arg1.mode2 = 196609;
};
};
if (_arg1.counter1 == 384){
if (_arg1.y1 < (WINDYLO << 16)){
_arg1.timer = 128;
_arg1.mode2 = 196609;
};
if (_arg1.x1 > (WINDXHI << 16)){
_arg1.timer = 640;
_arg1.mode2 = 196609;
};
};
if (_arg1.counter1 == 640){
if (_arg1.y1 < (WINDYLO << 16)){
_arg1.timer = 896;
_arg1.mode2 = 196609;
};
if (_arg1.x1 < (WINDXLO << 16)){
_arg1.timer = 384;
_arg1.mode2 = 196609;
};
};
if (_arg1.counter1 == 896){
if (_arg1.y1 > (WINDYHI << 16)){
_arg1.timer = 640;
_arg1.mode2 = 196609;
};
if (_arg1.x1 < (WINDXLO << 16)){
_arg1.timer = 128;
_arg1.mode2 = 196609;
};
};
RandomLoop(_arg1);
break;
case 4:
if (_arg1.gen1-- < 0){
_arg1.gen1 = turn_rate;
_arg1.counter1 = (_arg1.counter1 + turnto(_arg1));
_arg1.counter1 = (_arg1.counter1 & 1023);
};
break;
case 5:
if ((podmap[(_local8 + (_local9 * Prefs.NPODS_X))] & 0xFF) == 1){
if ((((_arg1.counter1 == 0)) || ((_arg1.counter1 == 0x0200)))){
_arg1.mode2 = 327681;
_arg1.timer = ((_arg1.counter1)==0x0200) ? 0 : 0x0200;
_arg1.counter2 = ((_arg1.counter1)==0x0200) ? 64 : -64;
if ((_arg1.flags & 2) != 0){
_arg1.counter2 = -(_arg1.counter2);
};
};
};
if ((((_arg1.y1 < (WINDYLO << 16))) && (((_arg1.counter1 & 1023) == 0x0200)))){
_arg1.mode2 = 327681;
_arg1.timer = 0;
_arg1.counter2 = (((_arg1.flags & 2))!=0) ? -64 : 64;
};
if ((((_arg1.y1 > (WINDYHI << 16))) && (((_arg1.counter1 & 1023) == 0)))){
_arg1.mode2 = 327681;
_arg1.timer = 0x0200;
_arg1.counter2 = (((_arg1.flags & 2))!=0) ? 64 : -64;
};
if ((((((_arg1.x1 < (things[SHIP].x1 + OFFX))) && (((_arg1.flags & 2) == 0)))) || ((((_arg1.x1 > (things[SHIP].x1 + OFFX))) && (((_arg1.flags & 2) == 2)))))){
if ((_arg1.counter1 & 1023) < 0x0200){
_arg1.counter2 = 64;
_arg1.timer = 384;
} else {
_arg1.counter2 = -64;
_arg1.timer = 640;
};
_arg1.mode2 = 327682;
};
RandomLoop(_arg1);
break;
};
break;
case 4:
nactive++;
if (BOLLOCKS > 1){
killbody(_arg2, 3);
};
if (HitShip((_arg1.x1 >> 16), (_arg1.y1 >> 16), 16)){
LVM_flash = 6;
KillShip(_arg1);
};
Superzap(_arg1, _arg2);
if (_arg1.next != -1){
things[_arg1.next].checkTrail();
_local6 = ((things[_arg1.next].trail_p - _arg1.sep) & (Prefs.TRAIL_LEN - 1));
_local5 = things[_arg1.next].trail_it[_local6];
_arg1.x1 = _local5.x;
_arg1.y1 = _local5.y;
_arg1.z1 = _local5.z;
_arg1.xv1 = _local5.xd;
_arg1.yv1 = _local5.yd;
_arg1.counter1 = _local5.o;
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_arg1.checkTrail();
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.i = 1;
_local5.o = _arg1.counter1;
_local5.xd = _arg1.xv1;
_local5.yd = _arg1.yv1;
_local5.c = ColourGenF(throb, cowfloat);
};
break;
case 5:
_arg1.xv1 = (_arg1.xv1 + _arg1.xv2);
_arg1.yv1 = (_arg1.yv1 + _arg1.yv2);
_arg1.zv1 = (_arg1.zv1 + _arg1.zv2);
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
_arg1.z1 = (_arg1.z1 + _arg1.zv1);
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = _arg1.z1;
_local5.i = 1;
_arg1.ExplosionTime = (_arg1.ExplosionTime + 0x0800);
if (_arg1.ExplosionTime > 65536){
_arg1.mode = 0;
};
break;
case 6:
_arg1.xv1 = (_arg1.xv1 + _arg1.xv2);
_arg1.yv1 = (_arg1.yv1 + _arg1.yv2);
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
_arg1.z1 = (_arg1.z1 + _arg1.zv1);
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = _arg1.z1;
if (_arg1.z1 < _arg1.spritenum2){
_local5.i = 1;
} else {
_local5.i = 0;
if (_arg1.counter1-- < 1){
_arg1.mode = 0;
};
};
break;
case 7:
nactive++;
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
Superzap(_arg1, _arg2);
if (HitShip((_arg1.x1 >> 16), (_arg1.y1 >> 16), 16)){
LVM_flash = 6;
KillShip(_arg1);
};
if (!OnScreen(_arg1)){
_arg1.mode = 0;
};
break;
case 8:
if (Prefs.XYZAPPER){
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
_arg1.z1 = (_arg1.z1 + _arg1.zv1);
if (((((((_arg1.x1 >> 16) < WINDXLO)) && ((_arg1.xv1 < 0)))) || (((((_arg1.x1 >> 16) > WINDXHI)) && ((_arg1.xv1 > 0)))))){
_arg1.xv1 = (0 - _arg1.xv1);
bouncet = 5;
bouncez = (_arg1.z1 << 4);
};
if (((((((_arg1.y1 >> 16) < WINDYLO)) && ((_arg1.yv1 < 0)))) || (((((_arg1.y1 >> 16) > WINDYHI)) && ((_arg1.yv1 > 0)))))){
_arg1.yv1 = (0 - _arg1.yv1);
bouncet = 5;
bouncez = (_arg1.z1 << 4);
};
if ((((_arg1.z1 < 0x1000)) || ((_arg1.z1 > 0x5000)))){
_arg1.zv1 = (0 - _arg1.zv1);
};
if ((((_arg1.z1 < 0x2000)) && ((_arg1.zv1 < 0)))){
_arg1.icgen = white_throb;
_arg1.expNum = 8;
} else {
_arg1.icgen = whitelight;
_arg1.expNum = 2;
};
_local7 = inkling;
inkling = (((_arg1.z1 + (_arg1.zv1 << 5)))<0x1000) ? 1 : 0;
if ((((_local7 == 0)) && ((inkling == 1)))){
playSound(Prefs.SFX_ULP);
};
if ((((_arg1.z1 < 0x1000)) && ((BOLLOCKS == 0)))){
zapx = (_arg1.x1 >> 16);
zapy = (_arg1.y1 >> 16);
zapt = 10;
playSound(Prefs.SFX_HUM);
};
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = _arg1.z1;
};
break;
case 9:
_arg1.ExplosionTime = (_arg1.ExplosionTime + 0x0800);
if (_arg1.ExplosionTime > 65536){
_arg1.mode = 0;
};
break;
case 10:
nactive2++;
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
if ((((_arg1.x1 < (WINDXLO << 16))) || (((_arg1.x1 >> 16) > WINDYLO)))){
_arg1.xv1 = (0 - _arg1.xv1);
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
};
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
if ((((_arg1.y1 < (WINDYLO << 16))) || (((_arg1.y1 >> 16) > WINDYHI)))){
_arg1.yv1 = (0 - _arg1.yv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
};
if (_arg1.timer-- < 0){
_arg1.timer = (50 + gPlatform.random(50));
if (_arg1.xv1 == 0){
if (gPlatform.random(8) < 4){
_arg1.xv1 = _arg1.yv1;
} else {
_arg1.xv1 = (0 - _arg1.yv1);
};
_arg1.yv1 = 0;
} else {
if (gPlatform.random(8) < 4){
_arg1.yv1 = _arg1.xv1;
} else {
_arg1.yv1 = (0 - _arg1.xv1);
};
_arg1.xv1 = 0;
};
};
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = _arg1.z1;
if ((_arg1.z1 - ZOO) < 0x1200){
_local6 = 0;
_local8 = 0;
_local7 = HEADBASE;
while (_local7 < (HEADBASE + MAXHEADS)) {
if (things[_local7].mode != 0){
_local8++;
};
_local7++;
};
_local7 = 0;
while (_local7 < (HEADBASE + MAXHEADS)) {
if (things[_local7].mode == 3){
_local6++;
};
_local7++;
};
_local6 = (MAXHEADS - (_local6 + _local8));
if ((((_local6 < HEADFREE)) || ((nactive_last > wactive)))){
ZOOINC = 0;
} else {
ZOOINC = ZOOINCSHADOW;
HEADFREE++;
wactive = ((_arg1.shield >> 24) & 0xFF);
if (((!((things[PILL].mode == 0))) && ((nomore == 0)))){
wactive = (wactive + 2);
};
sequence(_arg1.shield);
alaunched++;
_arg1.mode = 11;
_arg1.mode2 = 0;
_arg1.timer = -1;
_arg1.z1 = (_arg1.z1 - ZOO);
_arg1.icgen = whitelight;
_arg1.x1 = (things[SHIP].x1 + OFFX);
_arg1.y1 = (things[SHIP].y1 + OFFY);
_local7 = 0;
while (_local7 < Prefs.TRAIL_LEN) {
_arg1.trail_it[_local7].z = -4096;
_local7++;
};
_local6 = (_arg1.shield & 496);
switch ((_arg1.shield & 15)){
case 0:
if (_local6 == 0){
_arg1.x2 = ((things[SHIP].x1 + OFFX) + ((gPlatform.random(64) - 32) << 16));
} else {
_arg1.x2 = ((WINDXLO + _local6) << 16);
};
_arg1.y2 = ((0 - 32) << 16);
break;
case 1:
if (_local6 == 0){
_arg1.x2 = ((things[SHIP].x1 + OFFX) + ((gPlatform.random(64) - 32) << 16));
} else {
_arg1.x2 = ((WINDXLO + _local6) << 16);
};
_arg1.y2 = (((Prefs.SCREEN_HEIGHT << 1) + 32) << 16);
break;
case 2:
if (_local6 == 0){
_arg1.y2 = ((things[SHIP].y1 + OFFY) + ((gPlatform.random(64) - 32) << 16));
} else {
_arg1.y2 = ((WINDYLO + _local6) << 16);
};
_arg1.x2 = ((0 - 32) << 16);
break;
case 3:
if (_local6 == 0){
_arg1.y2 = ((things[SHIP].y1 + OFFY) + ((gPlatform.random(64) - 32) << 16));
} else {
_arg1.y2 = ((WINDYLO + _local6) << 16);
};
_arg1.x2 = (((Prefs.SCREEN_WIDTH << 1) + 32) << 16);
break;
};
};
};
break;
case 11:
nactive++;
switch (_arg1.mode2){
case 0:
if (_arg1.timer-- < 1){
_arg1.mode2 = 1;
_arg1.xv1 = ((_arg1.x2 - _arg1.x1) >> 5);
_arg1.yv1 = ((_arg1.y2 - _arg1.y1) >> 5);
_arg1.expNum = 4;
_arg1.timer = 32;
};
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
break;
case 1:
if (_arg1.timer-- > 0){
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
} else {
transmute(_arg1);
NewDrone(_arg1);
};
break;
};
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = 0x1000;
break;
case 12:
_arg1.ExplosionTime = (_arg1.ExplosionTime + _arg1.gen1);
if (_arg1.ExplosionTime > 65536){
_arg1.mode = 0;
};
break;
case 13:
if (_arg1.ExplosionTime > 0){
_arg1.ExplosionTime = (_arg1.ExplosionTime - 0x0800);
} else {
if (_arg1.gen1 > 0){
_arg1.gen1--;
};
if (_arg1.gen2 < 0){
_arg1.gen2 = _arg1.gen3;
playSound(Prefs.SFX_BADASS);
LVM_flash = 12;
_arg1.gen1 = 200;
};
_arg1.yv2 = _arg1.xv2;
if (nearestPillNum > 0){
_local8 = (things[nearestPillNum].x1 - _arg1.x1);
_local9 = (things[nearestPillNum].y1 - _arg1.y1);
} else {
_local8 = ((things[SHIP].x1 + OFFX) - _arg1.x1);
_local9 = ((things[SHIP].y1 + OFFY) - _arg1.y1);
};
_local11 = (_arg1.xv2 * sgn(_local8));
_local12 = (_arg1.yv2 * sgn(_local9));
_arg1.xv1 = (_arg1.xv1 + ((sgn(_local8))==sgn(_arg1.xv1)) ? _local11 : (_local11 << 1));
_arg1.yv1 = (_arg1.yv1 + ((sgn(_local9))==sgn(_arg1.yv1)) ? _local12 : (_local12 << 1));
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
if ((((_arg1.x1 < 0)) || (((_arg1.x1 >> 16) > (Prefs.SCREEN_WIDTH << 1))))){
_arg1.xv1 = (0 - _arg1.xv1);
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
};
if ((((_arg1.y1 < 0)) || (((_arg1.y1 >> 16) > (Prefs.SCREEN_HEIGHT << 1))))){
_arg1.yv1 = (0 - _arg1.yv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
};
_local6 = 0;
while (_local6 < PILL) {
_local3 = things[_local6];
if (GotMePill(_arg1, _local6, 16)){
switch (_local3.mode){
case 3:
if (_local3.shield-- < 0){
playSound(Prefs.SFX_ZAP);
makeHead(_local3, _local3.prev, _local3.mode2);
_local3.mode = 5;
_local3.drawMode = 8;
_local3.pointer = exp1;
_local3.xv1 = (((things[SHIP].x1 + OFFX) - _local3.x1) >> 4);
_local3.yv1 = (((things[SHIP].y1 + OFFY) - _local3.y1) >> 4);
_local3.xv2 = 0;
_local3.yv2 = 0;
_local3.zv2 = 0;
_local3.spritenum = 131072;
_local3.spritenum2 = 131072;
_local3.zv1 = -128;
_local3.ExplosionTime = 0;
_local3.flags = (COLLIDE ^ -1);
skore(200);
_local3.expNum = 3;
} else {
_local3.shieldhit = 5;
};
break;
case 4:
playSound(Prefs.SFX_ZAP);
if (_local3.shield-- < 0){
makeHead(_local3, _local3.prev, _local3.mode2);
_local3.pointer = exp1;
_local3.xv1 = (((things[SHIP].x1 + OFFX) - _local3.x1) >> 4);
_local3.yv1 = (((things[SHIP].y1 + OFFY) - _local3.y1) >> 4);
_local3.xv2 = 0;
_local3.yv2 = 0;
_local3.flags = (COLLIDE ^ -1);
_local3.zv1 = -128;
_local3.zv2 = 0;
_local3.spritenum = 131072;
_local3.spritenum2 = 131072;
_local3.mode = 5;
skore(40);
_local3.drawMode = 8;
_local3.ExplosionTime = 0;
_local3.expNum = 3;
} else {
_local3.shieldhit = 5;
};
break;
case 7:
_local3.mode = 9;
_local3.RanSeed = 826366247;
_local3.chunkX = 1;
_local3.chunkY = 8;
_local3.GeomXInc = 32;
_local3.GeomYInc = 0;
_local3.GeomXStep = 0;
_local3.GeomYStep = 32;
_local3.GeomXOffset = 0;
skore(10);
_local3.GeomYOffset = 0;
_local3.Flags = 0;
_local3.flags = (COLLIDE ^ -1);
_local3.drawMode = 1;
_local3.ExplosionTime = 0;
break;
case 16:
playSound(Prefs.SFX_ZAP);
if (_local3.shield-- < 0){
_local3.pointer = exp1;
_local3.xv1 = (((things[SHIP].x1 + OFFX) - _local3.x1) >> 4);
_local3.yv1 = (((things[SHIP].y1 + OFFY) - _local3.y1) >> 4);
_local3.xv2 = 0;
_local3.yv2 = 0;
_local3.flags = (COLLIDE ^ -1);
_local3.zv1 = -128;
_local3.zv2 = 0;
_local3.spritenum = 131072;
_local3.spritenum2 = 131072;
_local3.mode = 5;
skore(40);
_local3.drawMode = 8;
_local3.ExplosionTime = 0;
_local3.expNum = 3;
} else {
_local3.shieldhit = 5;
};
break;
case 17:
playSound(Prefs.SFX_ZAP);
if (_local3.shield-- < 0){
_local3.pointer = exp1;
_local3.xv1 = (((things[SHIP].x1 + OFFX) - _local3.x1) >> 4);
_local3.yv1 = (((things[SHIP].y1 + OFFY) - _local3.y1) >> 4);
_local3.xv2 = 0;
_local3.yv2 = 0;
_local3.flags = (COLLIDE ^ -1);
_local3.zv1 = -128;
_local3.zv2 = 0;
_local3.spritenum = 131072;
_local3.spritenum2 = 131072;
_local3.mode = 5;
skore(50);
_local3.drawMode = 8;
_local3.ExplosionTime = 0;
_local3.expNum = 3;
} else {
_local3.shieldhit = 5;
};
break;
};
_local6 = SHIP;
};
_local6++;
};
};
break;
case 14:
_arg1.x1 = (_arg1.x2 + (sine[((_arg1.gen1 = (_arg1.gen1 + _arg1.gen2)) & 1023)] << 6));
_arg1.y1 = (_arg1.y2 + (sine[((_arg1.gen3 = (_arg1.gen3 + _arg1.gen4)) & 1023)] << 6));
_arg1.z1 = (((sine[(_arg1.gen1 & 1023)] + sine[(_arg1.gen3 & 1023)]) >> 6) + 0x1300);
_arg1.checkTrail();
_local7 = (_arg1.trail_p++ & (Prefs.TRAIL_LEN - 1));
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = _arg1.z1;
_local5.i = 1;
break;
case 15:
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
_arg1.spritenum = (_arg1.animData[0] + ((frames >> 1) & 1));
if (_arg1.y1 > (((Prefs.SCREEN_HEIGHT << 1) + 20) << 16)){
_arg1.mode = 0;
};
if (BOLLOCKS != 1){
if (aHitShip((_arg1.x1 >> 16), (_arg1.y1 >> 16), 16)){
_arg1.ExplosionTime = 1;
_arg1.expNum = 7;
if (BOLLOCKS > 0){
SheepieSave();
} else {
bm++;
};
_arg1.icgen = whitelight;
_arg1.drawMode = 8;
_arg1.xv1 = ((((WINDXLO + ((WINDXHI - WINDXLO) >> 1)) << 16) - _arg1.x1) >> 8);
_arg1.yv1 = ((((WINDYLO + ((WINDYHI - WINDYLO) >> 1)) << 16) - _arg1.y1) >> 7);
_arg1.z1 = 0x1000;
_arg1.xv2 = 0;
_arg1.yv2 = 0;
skore(250);
_arg1.flags = (COLLIDE ^ -1);
_arg1.zv1 = 384;
_arg1.zv2 = -32;
_arg1.spritenum = 262144;
_arg1.spritenum2 = 262144;
_arg1.mode = 5;
_local8 = ((Prefs.SFX_FLUFFY_SHEEPIE)==Prefs.SFX_NOT_USED) ? Prefs.SFX_NOT_USED : (Prefs.SFX_FLUFFY_SHEEPIE + gPlatform.random(4));
if (bm > 9){
bm = 9;
GetPill();
_arg1.expNum = 7;
playSound(Prefs.SFX_OOOH);
skore(750);
};
_arg1.checkTrail();
_local7 = 0;
while (_local7 < Prefs.TRAIL_LEN) {
_local5 = _arg1.trail_it[_local7];
_local5.x = _arg1.x1;
_local5.y = _arg1.y1;
_local5.z = _arg1.z1;
_local7++;
};
if (_arg1.animData[0] > 111){
_local8 = Prefs.SFX_SHEEPIE_JOY;
bm = (levelCarryOverAchieved + 1);
if (bm > 9){
bm = 9;
};
};
if ((((((BOLLOCKS < 0)) && (((things[SHIP].flags & 128) == 0)))) && (!((levelup == 0))))){
playSound(Prefs.SFX_SHEEP_UP);
levelCarryOver = bm;
} else {
if (BOLLOCKS == 0){
playSound(_local8);
};
BOLLOCKS = -20;
things[SHIP].drawMode = 9;
things[SHIP].flags = (things[SHIP].flags | 128);
};
};
};
break;
case 16:
nactive++;
Superzap(_arg1, _arg2);
if (_arg1.mode == 16){
_arg1.counter1 = (_arg1.counter1 + _arg1.counter2);
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
if (HitShip((_arg1.x1 >> 16), (_arg1.y1 >> 16), 16)){
LVM_flash = 6;
KillShip(_arg1);
};
switch (_arg1.mode2){
case 0:
if (!OnScreen(_arg1)){
_arg1.mode = 0;
};
break;
case 1:
if ((((_arg1.x1 < (WINDXLO << 16))) && ((_arg1.xv1 < 0)))){
_arg1.xv1 = -(_arg1.xv1);
};
if ((((_arg1.x1 > (WINDXHI << 16))) && ((_arg1.xv1 > 0)))){
_arg1.xv1 = -(_arg1.xv1);
};
if ((((_arg1.y1 < (WINDYLO << 16))) && ((_arg1.yv1 < 0)))){
_arg1.yv1 = -(_arg1.yv1);
};
if ((((_arg1.y1 > (WINDYHI << 16))) && ((_arg1.yv1 > 0)))){
_arg1.yv1 = -(_arg1.yv1);
};
break;
case 2:
_local8 = ((things[SHIP].x1 + OFFX) - _arg1.x1);
_local9 = ((things[SHIP].y1 + OFFY) - _arg1.y1);
_local11 = (_arg1.xv2 * sgn(_local8));
_local12 = (_arg1.yv2 * sgn(_local9));
_arg1.xv1 = (_arg1.xv1 + ((sgn(_local8))==sgn(_arg1.xv1)) ? _local11 : (_local11 << 1));
_arg1.yv1 = (_arg1.yv1 + ((sgn(_local9))==sgn(_arg1.yv1)) ? _local12 : (_local12 << 1));
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
if (OffSurface(_arg1)){
_arg1.mode = 0;
};
break;
};
};
break;
case 17:
nactive++;
Superzap(_arg1, _arg2);
if (_arg1.spritenum < 274){
if (_arg1.yv1 > 0){
if ((_arg1.y1 >> 16) > (Prefs.SCREEN_HEIGHT + 40)){
_arg1.mode = 0;
};
} else {
if ((_arg1.y1 >> 16) < -40){
_arg1.mode = 0;
};
};
if (gPlatform.random(0x0100) < _arg1.gen1){
_local8 = ((_arg1.x1 >> 16) + 8);
_local9 = (_arg1.y1 >> 16);
if ((((_local8 > 0)) && ((_local8 < (Prefs.SCREEN_WIDTH << 1))))){
if ((((_local9 > 0)) && ((_local9 < (Prefs.SCREEN_HEIGHT << 1))))){
podmap[((_local8 >> 4) + ((_local9 >> 4) * Prefs.NPODS_X))] = 16777217;
};
};
};
switch (_arg1.mode2){
case 1:
if (_arg1.xv1 > 0){
if (_arg1.x1 > (WINDXHI << 16)){
_arg1.xv1 = -(_arg1.xv1);
};
} else {
if (_arg1.x1 < (WINDXLO << 16)){
_arg1.xv1 = -(_arg1.xv1);
};
};
break;
case 2:
_local8 = ((things[SHIP].x1 + OFFX) - _arg1.x1);
_local11 = (_arg1.xv2 * sgn(_local8));
_arg1.xv1 = (_arg1.xv1 + ((sgn(_local8))==sgn(_arg1.xv1)) ? _local11 : (_local11 << 1));
break;
};
if ((_arg1.flags & LASER) != 0){
if (HitLaser((_arg1.y1 >> 16), 8)){
LVM_flash = 6;
KillShip(_arg1);
};
};
} else {
if (_arg1.xv1 > 0){
if ((_arg1.x1 >> 16) > ((Prefs.SCREEN_WIDTH << 1) + 40)){
_arg1.mode = 0;
};
} else {
if ((_arg1.x1 >> 16) < -40){
_arg1.mode = 0;
};
};
if (gPlatform.random(0x0100) < _arg1.gen1){
_local8 = ((_arg1.x1 >> 16) + 8);
_local9 = (_arg1.y1 >> 16);
if ((((_local8 > 0)) && ((_local8 < (Prefs.SCREEN_WIDTH << 1))))){
if ((((_local9 > 0)) && ((_local9 < (Prefs.SCREEN_HEIGHT << 1))))){
podmap[((_local8 >> 4) + ((_local9 >> 4) * Prefs.NPODS_X))] = 16777217;
};
};
};
switch (_arg1.mode2){
case 1:
if (_arg1.yv1 > 0){
if (_arg1.y1 > (WINDYHI << 16)){
_arg1.yv1 = -(_arg1.yv1);
};
} else {
if (_arg1.y1 < (WINDYLO << 16)){
_arg1.yv1 = -(_arg1.yv1);
};
};
break;
case 2:
_local9 = ((things[SHIP].y1 + OFFY) - _arg1.y1);
_local12 = (_arg1.yv2 * sgn(_local9));
_arg1.yv1 = (_arg1.yv1 + ((sgn(_local9))==sgn(_arg1.yv1)) ? _local12 : (_local12 << 1));
break;
};
};
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
break;
case 18:
_arg1.counter1++;
if (_arg1.counter1 > 100){
_arg1.mode = 0;
};
break;
case 19:
_arg1.x1 = (_arg1.x1 + _arg1.xv1);
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
if (OffScreenX(_arg1)){
if (_arg1.xv1 > 0){
_arg1.x1 = ((2 - (Sprites[_arg1.spritenum].xSize >> 1)) << 16);
} else {
_arg1.x1 = ((Prefs.SCREEN_WIDTH + (Sprites[_arg1.spritenum].xSize >> 1)) << 16);
};
};
if (OffScreenY(_arg1)){
if (_arg1.yv1 > 0){
_arg1.y1 = ((2 - (Sprites[_arg1.spritenum].ySize >> 1)) << 16);
} else {
_arg1.y1 = ((Prefs.SCREEN_HEIGHT + (Sprites[_arg1.spritenum].ySize >> 1)) << 16);
};
};
break;
};
}
private function SetTint(_arg1:int):void{
LVM_tint = _arg1;
LVM_drawmode = (LVM_drawmode & 2);
if (LVM_tint != 0){
LVM_drawmode = (LVM_drawmode | 1);
};
}
private function OffSurface(_arg1:Thingie):Boolean{
if (OnSurface(_arg1)){
return (false);
};
return (true);
}
private function doGrid(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:int;
var _local5:int;
_local3 = ((Prefs.SCREEN_WIDTH_HALF << 16) - _arg1);
OFFX = _arg1;
_local3 = ((_local3 >> 5) + (32 << 12));
_local4 = ((Prefs.SCREEN_WIDTH << 16) - _arg2);
OFFY = _arg2;
_local4 = ((_local4 >> 5) + (32 << 12));
if (Prefs.GRID_3D){
_local5 = ColourGen(bluemesh);
if (Prefs.GRID_3D_EXTRA){
grid3d(_local5, _local3, _local4, ((frames << 6) + ZOOM), (64 << 12), (64 << 12), 4, 0x0200, (((251658240 | (gr[0] << 16)) | (gr[1] << 8)) | gr[4]));
};
grid3d(_local5, _local3, _local4, ((frames << 5) + ZOOM), (64 << 12), (64 << 12), 2, 0x0200, (((67108864 | (gr[2] << 16)) | (gr[3] << 8)) | gr[5]));
};
if (Prefs.SOFTNODE){
grid3d_softnode(ColourGen(purplemesh), _local3, _local4, ZOOM, (64 << 12), (64 << 12), 4, 0x0200);
};
}
private function hline(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:int;
var _local6:int;
_arg4 = (_arg4 >> 8);
if (Prefs.PIXEL_BUFFER){
_local5 = (_arg1 + (Prefs.USE_Y_ARRAY) ? gaHeightTable[_arg2] : (_arg2 * Prefs.SCREEN_WIDTH));
_local6 = 0;
while (_local6 <= _arg3) {
var _temp1 = _local5;
_local5 = (_local5 + 1);
var _local7 = _temp1;
gPlatform.buffer[_local7] = _arg4;
_local6++;
};
} else {
_local6 = 0;
while (_local6 <= _arg3) {
gPlatform.drawPixel((_arg1 + _local6), _arg2, _arg4);
_local6++;
};
};
}
private function GotMePill(_arg1:Thingie, _arg2:int, _arg3:int):Boolean{
var _local5:int;
var _local6:int;
var _local4:Thingie = things[_arg2];
if (_local4.mode == 0){
return (false);
};
if ((_local4.flags & COLLIDE) == 0){
return (false);
};
if (_local4.mode == 5){
return (false);
};
if (_local4.drawMode == 1){
return (false);
};
_local5 = Math.abs(((_arg1.x1 >> 16) - (_local4.x1 >> 16)));
_local6 = Math.abs(((_arg1.y1 >> 16) - (_local4.y1 >> 16)));
if (_arg1.gen1 > 0){
if ((((_local5 < _arg3)) || ((_local6 < _arg3)))){
return (true);
};
return (false);
};
if (_local5 > _arg3){
return (false);
};
if (_local6 > _arg3){
return (false);
};
return (true);
}
private function plot_a(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
_local4 = (_arg1 + (Prefs.USE_Y_ARRAY) ? gaHeightTable[_arg2] : (_arg2 * Prefs.SCREEN_WIDTH));
_local5 = gPlatform.buffer[_local4];
_local6 = _arg3;
_local7 = ((_local5 & (0xFF << 16)) + (_local6 & (0xFF << 16)));
_local8 = ((_local5 & (0xFF << 8)) + (_local6 & (0xFF << 8)));
_local9 = ((_local5 & 0xFF) + (_local6 & 0xFF));
if (_local7 > (0xFF << 16)){
_local7 = (0xFF << 16);
};
if (_local8 > (0xFF << 8)){
_local8 = (0xFF << 8);
};
if (_local9 > 0xFF){
_local9 = 0xFF;
};
if (Prefs.PIXEL_BUFFER){
gPlatform.buffer[_local4] = ((_local7 + _local8) + _local9);
} else {
gPlatform.drawPixel(_arg1, _arg2, ((_local7 + _local8) + _local9));
};
}
public function loadSprites():int{
var _local1:int;
if (iLoadSpritesState == 0){
gPlatform.openResource("sprites.bin", Prefs.LUMP_GFX);
_local1 = 116;
while (_local1 < 132) {
Sprites[_local1] = new SPRITE();
_local1++;
};
iLoadSpritesState = 6;
return (6);
};
if (iLoadSpritesState < 111){
if (!grabSprite(iLoadSpritesState++)){
return (-1);
};
return (iLoadSpritesState);
};
switch (iLoadSpritesState){
case 112:
case 113:
case 135:
case 172:
case 182:
case 190:
case 198:
case 199:
case 200:
case 201:
case 248:
case 249:
case 0x0100:
case 273:
case 274:
case 275:
if (!grabSprite(iLoadSpritesState++)){
return (-1);
};
break;
case 358:
if (!grabSprite(iLoadSpritesState++)){
return (-1);
};
gPlatform.closeResource();
iLoadSpritesState = 368;
break;
default:
if (!gPlatform.skipResource()){
return (-1);
};
iLoadSpritesState++;
break;
};
return (iLoadSpritesState);
}
private function nextNME():int{
var _local2:int;
var _local3:int;
var _local5:int;
var _local1:int;
var _local4:Boolean;
if (nomore != 0){
return (-1);
};
while (_local4) {
_local1 = levelp[ilp];
if ((_local1 & 2147483648) != 0){
_local5 = ((_local1 >> 24) & 15);
_local2 = ((_local1 >> 16) & 0xFF);
switch (_local5){
case 0:
var _local6 = isp++;
stack[_local6] = ilp;
var _local7 = isp++;
stack[_local7] = _local2;
break;
case 1:
_local2 = stack[--isp];
_local3 = stack[--isp];
var _temp1 = _local2;
_local2 = (_local2 - 1);
if (_temp1 > 0){
ilp = _local3;
var _local8 = isp++;
stack[_local8] = _local3;
var _local9 = isp++;
stack[_local9] = _local2;
};
break;
case 15:
nomore = 1;
_local1 = -1;
break;
};
} else {
_local4 = false;
};
ilp++;
};
return (_local1);
}
private function sgn(_arg1:int):int{
return (((_arg1)<0) ? -1 : 1);
}
private function OffScreen(_arg1:Thingie):Boolean{
if (OnScreen(_arg1)){
return (false);
};
return (true);
}
private function FinishFrame():void{
frames++;
count = (count + 1043);
}
private function sExplodeCenteredObject(_arg1:Thingie):void{
var _local2:int;
var _local3:int;
_arg1.SourceXOffset = 0;
_arg1.SourceYOffset = 0;
_arg1.SourceXSize = Sprites[_arg1.spritenum].xSize;
_arg1.SourceYSize = Sprites[_arg1.spritenum].ySize;
_local2 = (_arg1.SourceXSize >> 1);
_local3 = (_arg1.SourceYSize >> 1);
Smash(_arg1, _arg1.ExplosionTime, 0, ((_arg1.x1 >> 16) - _local2), ((_arg1.y1 >> 16) - _local3));
}
private function EndingScreen(_arg1:Array):void{
}
private function DrawCenteredObject(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:int;
var _local6:int;
_local5 = Sprites[_arg1].xSize;
_local6 = Sprites[_arg1].ySize;
if (Prefs.SPRITE_SCALING){
SpriteScaled(_arg1, _arg2, 0, 0, (_arg3 - (_local5 >> 1)), (_arg4 - (_local6 >> 1)), _local5, _local6);
} else {
Sprite(_arg1, _arg2, 0, 0, (_arg3 - (_local5 >> 1)), (_arg4 - (_local6 >> 1)), _local5, _local6);
};
}
private function gobble(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Boolean;
if (_arg1 < 1){
return;
};
while (_local5) {
_local2 = levelp[ilp];
if ((_local2 & 2147483648) != 0){
_local3 = ((_local2 >> 16) & 0xFF);
switch (((_local2 >> 24) & 15)){
case 0:
var _local6 = isp++;
stack[_local6] = ilp;
var _local7 = isp++;
stack[_local7] = _local3;
break;
case 1:
_local3 = stack[--isp];
_local4 = stack[--isp];
var _temp1 = _local3;
_local3 = (_local3 - 1);
if (_temp1 > 0){
ilp = _local4;
var _local8 = isp++;
stack[_local8] = _local4;
var _local9 = isp++;
stack[_local9] = _local3;
};
break;
case 15:
return;
};
} else {
_arg1--;
if (_arg1 < 1){
_local5 = false;
};
};
ilp++;
};
}
private function Animate(_arg1:Thingie, _arg2:int):void{
var _local3:int;
if (_arg1.animMode == 1){
_local3 = (frames >> _arg1.animData[2]);
_arg1.spritenum = (_arg1.animData[0] + (_local3 % _arg1.animData[3]));
};
}
private function findEshot():int{
var _local1:int;
_local1 = ESHOTBASE;
while (_local1 < (ESHOTBASE + ESHOTNUM)) {
if (things[_local1].mode == 0){
return (_local1);
};
_local1++;
};
return (-1);
}
private function SetDefaults(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local3 = (_arg1 >> 4);
_local2 = (_arg1 & 15);
loop_prob = (_local2 >> 1);
PODSHIELD = (_local2 >> 2);
FIREMODE = (_local3 % 3);
FIREMODE = (FIREMODE | (((_local3)>15) ? 15 : _local3 << 18));
SPLITMODE = ((_local2 << 1) + 8);
_local4 = (((_local2 >> 2) + 3) & 3);
SPLITMODE = (SPLITMODE | (_local4 << 8));
_local4 = ((_local3)>5) ? 5 : _local3;
SPLITMODE = (SPLITMODE | (_local4 << 16));
turn_rate = -1;
turn_speed = 64;
DS_laser = 0;
DS_mode = 0;
DS_vel = 0;
}
private function dotnode(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
_local21 = (((_arg1 >> 8) & 0xFF0000) / _arg8);
_local22 = ((_arg1 & 0xFF0000) / _arg8);
_local23 = (((_arg1 << 8) & 0xFF0000) / _arg8);
_local16 = (_arg6 / _arg8);
_local17 = (_arg7 / _arg8);
_local18 = _local21;
_local19 = _local22;
_local20 = _local23;
_local9 = 0;
while (_local9 < _arg8) {
steps[_local9] = ((((_local18 & 0xFF0000) << 8) | (_local19 & 0xFF0000)) | ((_local20 & 0xFF0000) >> 8));
_local18 = (_local18 + _local21);
_local19 = (_local19 + _local22);
_local20 = (_local20 + _local23);
_local9++;
};
steps[_local9] = _arg1;
_local9 = _arg2;
while (_local9 < (LVM_xhi << 16)) {
_local10 = _arg3;
while (_local10 < (LVM_yhi << 16)) {
_local12 = (_local9 - _arg6);
_local13 = (_local9 + _arg6);
_local14 = (_local10 >> 16);
if ((((_local14 > 0)) && ((_local14 < Prefs.SCREEN_HEIGHT)))){
_local11 = 0;
while (_local11 < _arg8) {
_local15 = (_local12 >> 16);
if ((((_local15 > 0)) && ((_local15 < Prefs.SCREEN_WIDTH)))){
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
gPlatform.buffer[(gaHeightTable[_local14] + _local15)] = steps[_local11];
} else {
gPlatform.buffer[((_local14 * Prefs.SCREEN_WIDTH) + _local15)] = steps[_local11];
};
} else {
gPlatform.drawPixel(_local15, _local14, steps[_local11]);
};
};
_local15 = (_local13 >> 16);
if ((((_local15 > 0)) && ((_local15 < Prefs.SCREEN_WIDTH)))){
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
gPlatform.buffer[(gaHeightTable[_local14] + _local15)] = steps[_local11];
} else {
gPlatform.buffer[((_local14 * Prefs.SCREEN_WIDTH) + _local15)] = steps[_local11];
};
} else {
gPlatform.drawPixel(_local15, _local14, steps[_local11]);
};
};
_local12 = (_local12 + _local16);
_local13 = (_local13 - _local16);
_local11++;
};
};
_local12 = (_local10 - _arg7);
_local13 = (_local10 + _arg7);
_local14 = (_local9 >> 16);
if ((((_local14 > 0)) && ((_local14 < Prefs.SCREEN_WIDTH)))){
_local11 = 0;
while (_local11 < _arg8) {
_local15 = (_local12 >> 16);
if ((((_local15 > 0)) && ((_local15 < Prefs.SCREEN_HEIGHT)))){
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
gPlatform.buffer[(gaHeightTable[_local14] + _local15)] = steps[_local11];
} else {
gPlatform.buffer[((_local14 * Prefs.SCREEN_WIDTH) + _local15)] = steps[_local11];
};
} else {
gPlatform.drawPixel(_local15, _local14, steps[_local11]);
};
};
_local15 = (_local13 >> 16);
if ((((_local15 > 0)) && ((_local15 < Prefs.SCREEN_HEIGHT)))){
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
gPlatform.buffer[(gaHeightTable[_local14] + _local15)] = steps[_local11];
} else {
gPlatform.buffer[((_local14 * Prefs.SCREEN_WIDTH) + _local15)] = steps[_local11];
};
} else {
gPlatform.drawPixel(_local15, _local14, steps[_local11]);
};
};
_local12 = (_local12 + _local17);
_local13 = (_local13 - _local17);
_local11++;
};
};
_local10 = (_local10 + _arg5);
};
_local9 = (_local9 + _arg4);
};
}
private function aHitShip(_arg1:int, _arg2:int, _arg3:int):Boolean{
if (things[SHIP].mode == 14){
return (false);
};
var _local4 = ((things[SHIP].x1 + OFFX) >> 16);
var _local5 = ((things[SHIP].y1 + OFFY) >> 16);
if ((((Math.abs((_local4 - _arg1)) < _arg3)) && ((Math.abs((_local5 - _arg2)) < _arg3)))){
return (true);
};
return (false);
}
private function KillShip(_arg1:Thingie):void{
var _local3:int;
var _local2:Thingie = things[SHIP];
BOLLOCKS = 1;
GotYou();
if ((((Prefs.SFX_NUM_EXPLETIVES > 0)) && ((gPlatform.random(16) < 4)))){
playSound((Prefs.SFX_EXPLETIVE + gPlatform.random(Prefs.SFX_NUM_EXPLETIVES)));
};
playSound(Prefs.SFX_EXPLODE_2);
_local2.RanSeed = ((826366247 * gPlatform.random(0x0200)) >> 9);
_local2.chunkX = (gPlatform.random(8) + 1);
_local2.chunkY = (gPlatform.random(8) + 16);
_local2.RandYMag = 64;
_local2.RandXMag = 240;
_local2.GeomXInc = 32;
_local2.GeomYInc = 0;
_local2.GeomXStep = 0;
_local2.GeomYStep = 32;
_local2.GeomXOffset = 0;
_local2.GeomYOffset = 0;
_local2.flags = 0;
_local2.Flags = e_UseRand;
_local2.drawMode = 9;
_local3 = 0;
while (_local3 < Prefs.TRAIL_LEN) {
_local2.trail_it[_local3].y = _local2.y1;
_local3++;
};
_local2.trail_p = 0;
_local2.yv1 = 0;
unkilled = 0;
_local3 = 0;
while (_local3 < SHIP) {
if (things[_local3].mode == 11){
unkilled++;
};
_local3++;
};
if (_arg1 != null){
_arg1.mode = 12;
_arg1.drawMode = 12;
_arg1.ExplosionTime = 0;
_arg1.gen1 = 0x0400;
_arg1.icgen = whitelight;
};
}
private function quickGrid():int{
gPlatform.clearPixelBuffer(0);
doGrid(Prefs.SCREEN_WIDTH_HALF, Prefs.SCREEN_HEIGHT_HALF);
ZOOM = (ZOOM + (ZOOINC << 1));
FinishFrame();
return (ColourGen(throb));
}
private function WriteHST():Boolean{
return (true);
}
private function makeHead(_arg1:Thingie, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:Thingie;
var _local6:Thingie;
if (_arg1.next > 0){
things[_arg1.next].prev = -1;
};
if (_arg1.prev < 0){
return;
};
_local4 = 0;
_local5 = _arg1;
while (_local5.prev > -1) {
_local4++;
_local5 = things[_local5.prev];
};
if (((((SPLITMODE & 0xFF) > gPlatform.random(0x0100))) && ((_local4 > 1)))){
_arg2 = 0;
playSound(Prefs.SFX_ZAPHOD);
while (_arg2 == 0) {
_arg1.mode = 16;
_arg1.xv1 = ((_arg1.xv1 * (gPlatform.random(16) + 8)) << 3);
_arg1.yv1 = ((_arg1.yv1 * (gPlatform.random(16) + 8)) << 3);
_arg1.xv2 = 0x1000;
_arg1.yv2 = 0x1000;
_arg1.shield = (((SPLITMODE >> 16) & 0xFF) - 1);
_arg1.mode2 = ((SPLITMODE >> 8) & 0xFF);
_arg1.counter2 = ((gPlatform.random(16) - 8) << 5);
if (gPlatform.random(8) < 4){
_arg1.xv1 = -(_arg1.xv1);
};
if (gPlatform.random(8) < 4){
_arg1.yv1 = -(_arg1.yv1);
};
if (_arg1.mode2 == 3){
_arg1.xv1 = (((things[SHIP].x1 + OFFX) - _arg1.x1) >> 8);
_arg1.yv1 = (((things[SHIP].y1 + OFFY) - _arg1.y1) >> 7);
_arg1.xv2 = 0;
_arg1.yv2 = 0;
skore(20);
_arg1.flags = (COLLIDE ^ -1);
_arg1.zv1 = -128;
_arg1.zv2 = 0;
_arg1.spritenum = 131072;
_arg1.spritenum2 = 131072;
_arg1.mode = 5;
_arg1.drawMode = 8;
_arg1.ExplosionTime = 0;
_arg1.expNum = 3;
};
if (_arg1.prev < 0){
_arg2 = 1;
_arg1.next = -1;
} else {
_local5 = things[_arg1.prev];
_arg1.prev = -1;
_arg1.next = -1;
_arg1 = _local5;
};
};
return;
};
_local6 = things[_arg2];
if (_local6.mode == 4){
_arg3 = ((_arg3)==4) ? 4 : 0;
_local6.mode = 3;
_local6.invisible = 0;
_local6.shield = (HEADSHIELD + (goaround << 1));
_local6.shieldhit = 0;
_local6.mode2 = _arg3;
_local6.next = -1;
_local6.timer = 0;
if (_arg3 == 0){
if ((_local6.counter1 & 1023) > 0x0200){
_local6.mode2 = 1;
_local6.timer = 0x0100;
_local6.counter2 = (((_local6.flags & 2))!=0) ? -64 : 64;
} else {
_local6.mode2 = 1;
_local6.timer = 0x0300;
_local6.counter2 = (((_local6.flags & 2))!=0) ? 64 : -64;
};
} else {
_local6.counter2 = 16;
_local6.gen1 = -1;
};
_local6.spritenum = HEADG;
_local6.animData[0] = HEADG;
_local6.icgen = fire;
_local6.fireMode = FIREMODE;
_local6.flags = (_local6.flags | COLLIDE);
};
}
private function SetUpFrame():Boolean{
if (Prefs.USE_MOUSE){
LVM_mouseX = gPlatform.getMouseX();
LVM_mouseY = gPlatform.getMouseY();
if (Prefs.DOUBLE_SCREEN){
LVM_mouseX = (LVM_mouseX >> 1);
LVM_mouseY = (LVM_mouseY >> 1);
};
} else {
if (((gGame.gbKeyDown) && ((LVM_mouseY < (Prefs.SCREEN_HEIGHT - Prefs.MOVE_DY))))){
LVM_mouseY = (LVM_mouseY + Prefs.MOVE_DY);
} else {
if (((gGame.gbKeyUp) && ((LVM_mouseY > Prefs.MOVE_DY)))){
LVM_mouseY = (LVM_mouseY - Prefs.MOVE_DY);
};
};
if (((gGame.gbKeyRight) && ((LVM_mouseX < (Prefs.SCREEN_WIDTH - Prefs.MOVE_DX))))){
LVM_mouseX = (LVM_mouseX + Prefs.MOVE_DX);
} else {
if (((gGame.gbKeyLeft) && ((LVM_mouseX > Prefs.MOVE_DX)))){
LVM_mouseX = (LVM_mouseX - Prefs.MOVE_DX);
};
};
};
if (LVM_flash != 0){
LVM_bgcol = LVM_flashp[(LVM_flash-- - 1)];
};
if ((LVM_mode & llClear) != 0){
gPlatform.clearPixelBuffer(LVM_bgcol);
};
SetPlaneParams(0, 0, 0, 0, Prefs.SCREEN_WIDTH, Prefs.SCREEN_HEIGHT);
return (true);
}
private function Superzap(_arg1:Thingie, _arg2:int):void{
var _local3:int;
var _local4:int;
if (SheepyZapFired != 0){
return;
};
if (SheepyZapDwellTime != 4){
return;
};
if (_arg2 == SheepyZapTarget){
SheepyZapFired = 1;
playSound(Prefs.SFX_ZAP);
if (things[_arg2].shield-- < 0){
playSound(Prefs.SFX_SHEEPIE_ZAPPER);
things[_arg2].icgen = whitelight;
skore(500);
if (things[_arg2].mode == 3){
makeHead(things[_arg2], things[_arg2].prev, things[_arg2].mode2);
killhead(_arg2, 9);
} else {
if (things[_arg2].mode == 4){
makeHead(things[_arg2], things[_arg2].prev, things[_arg2].mode2);
};
killbody(_arg2, 9);
};
_local3 = (things[_arg2].x1 >> 20);
_local4 = (things[_arg2].y1 >> 20);
if ((((((((_local3 > 0)) && ((_local3 < Prefs.NPODS_X)))) && ((_local4 > 0)))) && ((_local4 < Prefs.NPODS_Y)))){
podmap[(_local3 + (_local4 * Prefs.NPODS_X))] = 16777217;
};
getsheepie();
} else {
things[_arg2].shieldhit = 5;
};
};
}
private function box_a(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
hline_a(_arg1, _arg2, (_arg3 - _arg1), _arg5);
vline_a(_arg1, _arg2, (_arg4 - _arg2), _arg5);
hline_a(_arg1, _arg4, (_arg3 - _arg1), _arg5);
vline_a(_arg3, _arg2, (_arg4 - _arg2), _arg5);
}
private function Sprite(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
_arg5 = (_arg5 + ScrollX);
_arg6 = (_arg6 + ScrollY);
if (_arg6 > LVM_yhi){
return;
};
if (_arg5 > LVM_xhi){
return;
};
if ((_arg6 + _arg8) < LVM_ylo){
return;
};
if ((_arg5 + _arg7) < LVM_xlo){
return;
};
var _local9:int;
var _local10:int;
var _local16:Array = Sprites[_arg1].bits;
var _local17:int = Sprites[_arg1].xSize;
if (_arg5 < LVM_xlo){
_local12 = (LVM_xlo - _arg5);
_arg5 = (_arg5 + _local12);
_arg3 = (_arg3 + _local12);
_arg7 = (_arg7 - _local12);
};
if (_arg6 < LVM_ylo){
_local12 = (LVM_ylo - _arg6);
_arg6 = (_arg6 + _local12);
_arg4 = (_arg4 + _local12);
_arg8 = (_arg8 - _local12);
};
if ((_arg5 + _arg7) > LVM_xhi){
_arg7 = (_arg7 - ((_arg5 + _arg7) - LVM_xhi));
};
if ((_arg6 + _arg8) > LVM_yhi){
_arg8 = (_arg8 - ((_arg6 + _arg8) - LVM_yhi));
};
_local15 = (Prefs.SCREEN_WIDTH - _arg7);
_local14 = (_local17 - _arg7);
_local9 = (_arg3 + (_arg4 * _local17));
if (Prefs.USE_Y_ARRAY){
_local10 = (_arg5 + gaHeightTable[_arg6]);
} else {
_local10 = (_arg5 + (_arg6 * Prefs.SCREEN_WIDTH));
};
if (_arg2 == 0){
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
if (Prefs.PIXEL_BUFFER){
var _temp1 = _local9;
_local9 = (_local9 + 1);
gPlatform.buffer[_local10] = _local16[_temp1];
} else {
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), _local16[_local9]);
};
_local10++;
_local13++;
};
_local9 = (_local9 + _local14);
_local10 = (_local10 + _local15);
_local12++;
};
return;
};
switch (LVM_drawmode){
case 0:
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp2 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp2];
if (_local11 != 0){
if (Prefs.PIXEL_BUFFER){
gPlatform.buffer[_local10] = _local11;
} else {
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), _local11);
};
};
_local10++;
_local13++;
};
_local9 = (_local9 + _local14);
_local10 = (_local10 + _local15);
_local12++;
};
break;
case 1:
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp3];
if (_local11 != 0){
if (Prefs.PIXEL_BUFFER){
gPlatform.buffer[_local10] = LVM_tint;
} else {
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), LVM_tint);
};
};
_local10++;
_local13++;
};
_local9 = (_local9 + _local14);
_local10 = (_local10 + _local15);
_local12++;
};
break;
case 2:
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp4 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp4];
if (Prefs.PIXEL_BUFFER){
gPlatform.buffer[_local10] = ((_local11)==0) ? LVM_bfill : _local11;
} else {
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), ((_local11)==0) ? LVM_bfill : _local11);
};
_local10++;
_local13++;
};
_local9 = (_local9 + _local14);
_local10 = (_local10 + _local15);
_local12++;
};
break;
case 3:
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp5 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp5];
if (Prefs.PIXEL_BUFFER){
gPlatform.buffer[_local10] = ((_local11)==0) ? LVM_bfill : LVM_tint;
} else {
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), ((_local11)==0) ? LVM_bfill : LVM_tint);
};
_local10++;
_local13++;
};
_local9 = (_local9 + _local14);
_local10 = (_local10 + _local15);
_local12++;
};
break;
};
}
private function gensprites(_arg1:int, _arg2:int):void{
var _local5:SPRITE;
var _local6:SPRITE;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local3:Array = [4, 2, 0, 6];
var _local4:Array = [3, 1, 7, 5];
if (lastLevel == thisLevel){
return;
};
_local10 = (116 + (_arg2 << 3));
gPlatform.openResource("sprites.bin", Prefs.LUMP_GFX);
_local9 = 6;
while (_local9 < _arg1) {
gPlatform.skipResource();
_local9++;
};
grabSprite((_local10 + 4));
grabSprite((_local10 + 3));
gPlatform.closeResource();
_local13 = (Sprites[(_local10 + 4)].xSize * Sprites[(_local10 + 4)].ySize);
_local14 = (Sprites[(_local10 + 3)].xSize * Sprites[(_local10 + 3)].ySize);
_local9 = 1;
while (_local9 < 4) {
_local5 = Sprites[(_local10 + _local3[_local9])];
_local6 = Sprites[(_local10 + _local3[(_local9 - 1)])];
_local5.xSize = _local6.ySize;
_local5.ySize = _local6.xSize;
_local5.bits = new Array(_local13);
_local8 = 0;
_local15 = ((_local6.ySize - 1) * _local6.xSize);
_local11 = 0;
while (_local11 < _local6.xSize) {
_local7 = (_local15 + _local11);
_local12 = 0;
while (_local12 < _local6.ySize) {
_local5.bits[_local8] = _local6.bits[_local7];
_local8++;
_local7 = (_local7 - _local6.xSize);
_local12++;
};
_local11++;
};
_local5 = Sprites[(_local10 + _local4[_local9])];
_local6 = Sprites[(_local10 + _local4[(_local9 - 1)])];
_local5.xSize = _local6.ySize;
_local5.ySize = _local6.xSize;
_local5.bits = new Array(_local14);
_local8 = 0;
_local15 = ((_local6.ySize - 1) * _local6.xSize);
_local11 = 0;
while (_local11 < _local6.xSize) {
_local7 = (_local15 + _local11);
_local12 = 0;
while (_local12 < _local6.ySize) {
_local5.bits[_local8] = _local6.bits[_local7];
_local8++;
_local7 = (_local7 - _local6.xSize);
_local12++;
};
_local11++;
};
_local9++;
};
}
private function transmute(_arg1:Thingie):void{
var _local2:Thingie;
var _local3:Thingie;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 0;
_local10 = 0;
_local11 = 0;
_local12 = 0;
_local7 = 0;
_local4 = HEADBASE;
while (_local4 < (HEADBASE + MAXHEADS)) {
_local2 = things[_local4];
if (_local2.mode == 0){
_local13 = ((_arg1.shield >> 20) & 15);
_local14 = (_arg1.shield & 15);
_local5 = 0;
_local10 = TAILBASE;
while ((((_local10 > -1)) && (!((things[_local10].mode == 0))))) {
_local10--;
};
_local8 = _local10;
HEADFREE--;
_local2.invisible = 0;
_local2.x1 = _arg1.x1;
_local2.y1 = _arg1.y1;
_local2.z1 = 0x1000;
_local2.xv1 = XSPEED;
_local2.yv1 = YSPEED;
_local2.zv1 = 0;
_local2.shield = HEADSHIELD;
_local2.shieldhit = 0;
_local2.fireMode = FIREMODE;
_local2.drawMode = 6;
_local2.animMode = -1;
_local2.spritenum = HEADG;
_local2.animData[0] = HEADG;
_local2.mode2 = 2;
_local2.flags = COLLIDE;
_local2.colourindex = 0;
_local2.icgen = fire;
switch (_local13){
case 0:
switch (_local14){
case 0:
_local2.counter1 = 0;
_local2.gen1 = ((things[SHIP].y1 + OFFY) - ((32 - gPlatform.random(32)) << 16));
break;
case 1:
_local2.counter1 = 0x0200;
_local2.gen1 = ((things[SHIP].y1 + OFFY) + ((32 - gPlatform.random(32)) << 16));
break;
case 2:
_local2.counter1 = 0x0100;
_local2.mode2 = 0;
break;
case 3:
_local2.counter1 = 0x0300;
_local2.mode2 = 0;
break;
};
break;
case 1:
_local2.flags = (_local2.flags | 2);
switch (_local14){
case 0:
_local2.counter1 = 0;
_local2.gen1 = ((things[SHIP].y1 + OFFY) - ((32 - gPlatform.random(32)) << 16));
break;
case 1:
_local2.counter1 = 0x0200;
_local2.gen1 = ((things[SHIP].y1 + OFFY) + ((32 - gPlatform.random(32)) << 16));
break;
case 2:
_local2.counter1 = 0x0100;
_local2.mode2 = 0;
break;
case 3:
_local2.counter1 = 0x0300;
_local2.mode2 = 0;
break;
};
break;
case 2:
switch (_local14){
case 0:
_local2.xv1 = DS_vel;
_local2.yv1 = 360448;
_local2.xv2 = 0x2000;
_local2.yv2 = 0;
_local2.spritenum = 135;
break;
case 1:
_local2.xv1 = DS_vel;
_local2.yv1 = -360448;
_local2.xv2 = 0x2000;
_local2.yv2 = 0;
_local2.spritenum = 273;
break;
case 2:
_local2.xv1 = 262144;
_local2.yv1 = DS_vel;
_local2.xv2 = 0;
_local2.yv2 = 0x2000;
_local2.spritenum = 275;
break;
case 3:
_local2.xv1 = -262144;
_local2.yv1 = DS_vel;
_local2.xv2 = 0;
_local2.yv2 = -8192;
_local2.spritenum = 274;
break;
};
DS_vel = -(DS_vel);
_local2.mode = 17;
_local2.gen1 = 128;
_local2.drawMode = 3;
_local2.mode2 = DS_mode;
if (DS_laser != 0){
_local2.flags = (_local2.flags | LASER);
};
_local2.checkTrail();
return;
case 3:
switch (_local14){
case 0:
_local2.counter1 = 0;
break;
case 1:
_local2.counter1 = 0x0200;
break;
case 2:
_local2.counter1 = 0x0100;
_local2.mode2 = 0;
break;
case 3:
_local2.counter1 = 0x0300;
_local2.mode2 = 0;
break;
};
_local2.gen1 = -1;
_local2.mode2 = 4;
_local2.counter2 = 16;
break;
case 4:
switch (_local14){
case 0:
_local2.counter1 = 0;
_local2.gen1 = ((things[SHIP].y1 + OFFY) - ((32 - gPlatform.random(32)) << 16));
_local2.mode2 = 5;
break;
case 1:
_local2.counter1 = 0x0200;
_local2.gen1 = ((things[SHIP].y1 + OFFY) + ((32 - gPlatform.random(32)) << 16));
_local2.mode2 = 5;
break;
case 2:
_local2.counter1 = 0x0100;
_local2.mode2 = 5;
break;
case 3:
_local2.counter1 = 0x0300;
_local2.mode2 = 5;
break;
};
break;
case 5:
_local2.flags = (_local2.flags | 2);
switch (_local14){
case 0:
_local2.counter1 = 0;
_local2.gen1 = ((things[SHIP].y1 + OFFY) - ((32 - gPlatform.random(32)) << 16));
_local2.mode2 = 5;
break;
case 1:
_local2.counter1 = 0x0200;
_local2.gen1 = ((things[SHIP].y1 + OFFY) + ((32 - gPlatform.random(32)) << 16));
_local2.mode2 = 5;
break;
case 2:
_local2.counter1 = 0x0100;
_local2.mode2 = 5;
break;
case 3:
_local2.counter1 = 0x0300;
_local2.mode2 = 5;
break;
};
break;
};
_local2.next = 0;
_local2.prev = _local8;
var _temp1 = _local5;
_local5 = (_local5 + 1);
_local2.uid = _temp1;
_local8 = _local4;
_local9 = _local4;
_local2.checkTrail();
_local6 = 0;
while (_local6 < Prefs.TRAIL_LEN) {
_local2.trail_it[_local6].x = _local2.x1;
_local2.trail_it[_local6].y = _local2.y1;
_local2.trail_it[_local6].z = _local2.z1;
_local2.trail_it[_local6].o = _local2.counter1;
_local6++;
};
_local2.trail_p = 0;
_local2.mode = 3;
_local12 = _local2.mode2;
_local4 = 1000;
} else {
_local7++;
};
_local4++;
};
if (_local7 >= MAXHEADS){
return;
};
_local11 = (_local10 - 1);
_local4 = 0;
while (_local4 < TAILSIZE) {
if (_local10 < 0){
break;
};
while ((((_local11 > -1)) && (!((things[_local11].mode == 0))))) {
_local11--;
};
_local3 = things[_local10];
_local3.flags = things[_local9].flags;
_local3.x1 = things[_local9].x1;
_local3.y1 = things[_local9].y1;
_local3.z1 = things[_local9].z1;
_local3.shield = TAILSHIELD;
_local3.shieldhit = 0;
_local3.xv1 = things[_local9].xv1;
_local3.yv1 = things[_local9].yv1;
_local3.zv1 = things[_local9].zv1;
_local3.counter1 = things[_local9].counter1;
_local3.drawMode = 6;
_local3.animMode = -1;
_local3.spritenum = TAILG;
_local3.animData[0] = TAILG;
_local3.flags = COLLIDE;
_local3.mode2 = _local12;
_local3.next = _local8;
_local8 = _local10;
_local3.prev = _local11;
_local3.sep = SEP;
var _temp2 = _local5;
_local5 = (_local5 + 1);
_local3.uid = _temp2;
_local3.colourindex = (_local5 * 1043);
_local3.icgen = deep_throb;
_local3.checkTrail();
_local6 = 0;
while (_local6 < Prefs.TRAIL_LEN) {
_local3.trail_it[_local6].x = _local3.x1;
_local3.trail_it[_local6].y = _local3.y1;
_local3.trail_it[_local6].z = _local3.z1;
_local3.trail_it[_local6].o = _local3.counter1;
_local6++;
};
_local3.trail_p = 0;
_local3.mode = 4;
var _temp3 = _local11;
_local11 = (_local11 - 1);
_local10 = _temp3;
_local4++;
};
things[_local8].prev = -1;
}
private function HitLaser(_arg1:int, _arg2:int):Boolean{
if (things[SHIP].mode == 14){
return (false);
};
var _local3 = ((things[SHIP].y1 + OFFY) >> 16);
if (BOLLOCKS != 0){
return (false);
};
if (Math.abs((_arg1 - _local3)) < _arg2){
return (true);
};
return (false);
}
public function QuitGame():void{
gGameState = GAME_SETUP;
gPlayGameState = PLAYGAME_SETUP;
}
private function ColourGenF(_arg1:int, _arg2:int):int{
var _local3:int;
var _local4:int;
var _local5:int;
_local3 = ((gaCGEN4_r_hi[_arg1] - gaCGEN4_r_lo[_arg1]) >> 1);
_local4 = ((gaCGEN4_g_hi[_arg1] - gaCGEN4_g_lo[_arg1]) >> 1);
_local5 = ((gaCGEN4_b_hi[_arg1] - gaCGEN4_b_lo[_arg1]) >> 1);
if (Prefs.COLOURGEN){
_local3 = (((_local3 * sine[(((_arg2 * gaCGEN4_r[_arg1]) >> 22) & 1023)]) >> 16) + 1);
_local4 = (((_local4 * sine[(((_arg2 * gaCGEN4_g[_arg1]) >> 22) & 1023)]) >> 16) + 1);
_local5 = (((_local5 * sine[(((_arg2 * gaCGEN4_b[_arg1]) >> 22) & 1023)]) >> 16) + 1);
_local3 = ((_local3 + gaCGEN4_r_lo[_arg1]) & 0xFF);
_local4 = ((_local4 + gaCGEN4_g_lo[_arg1]) & 0xFF);
_local5 = ((_local5 + gaCGEN4_b_lo[_arg1]) & 0xFF);
};
return ((((_local3 << 16) | (_local4 << 8)) | _local5));
}
private function OffScreenX(_arg1:Thingie):Boolean{
var _local2:int;
var _local3:int;
_local3 = Sprites[_arg1.spritenum].xSize;
_local2 = (_arg1.x1 >> 16);
if (_local2 < 0){
if (Math.abs(_local2) > _local3){
return (true);
};
} else {
if ((_local2 - Prefs.SCREEN_WIDTH) > _local3){
return (true);
};
};
return (false);
}
private function OffScreenY(_arg1:Thingie):Boolean{
var _local2:int;
var _local3:int;
_local3 = Sprites[_arg1.spritenum].ySize;
_local2 = (_arg1.y1 >> 16);
if (_local2 < 0){
if (Math.abs(_local2) > _local3){
return (true);
};
} else {
if ((_local2 - Prefs.SCREEN_HEIGHT) > _local3){
return (true);
};
};
return (false);
}
private function vline_a(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:int;
_local5 = 0;
while (_local5 <= _arg3) {
plot_a(_arg1, (_arg2 + _local5), _arg4);
_local5++;
};
}
private function HitShipCross(_arg1:int, _arg2:int, _arg3:int):Boolean{
if (things[SHIP].mode == 14){
return (false);
};
if (BOLLOCKS != 0){
return (false);
};
if (Math.abs((_arg1 - (things[SHIP].x1 >> 16))) < _arg3){
if (Math.abs((_arg2 - (things[SHIP].y1 >> 16))) < 8){
return (true);
};
};
if (Math.abs((_arg2 - (things[SHIP].y1 >> 16))) < _arg3){
if (Math.abs((_arg1 - (things[SHIP].x1 >> 16))) < 8){
return (true);
};
};
return (false);
}
private function ExplodeCenteredObject(_arg1:Thingie):void{
var _local2:int;
var _local3:int;
_arg1.SourceXOffset = 0;
_arg1.SourceYOffset = 0;
_arg1.SourceXSize = Sprites[_arg1.spritenum].xSize;
_arg1.SourceYSize = Sprites[_arg1.spritenum].ySize;
_local2 = (_arg1.SourceXSize >> 1);
_local3 = (_arg1.SourceYSize >> 1);
Smash(_arg1, _arg1.ExplosionTime, 0, (((_arg1.x1 - OFFX) >> 16) - _local2), (((_arg1.y1 - OFFY) >> 16) - _local3));
}
private function bar_a(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
_local6 = _arg2;
while (_local6 < _arg4) {
hline_a(_arg1, _local6, (_arg3 - _arg1), _arg5);
_local6++;
};
}
private function softnodebox(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:int;
_local19 = (((_arg1 >> 8) & 0xFF0000) / _arg8);
_local20 = ((_arg1 & 0xFF0000) / _arg8);
_local21 = (((_arg1 << 8) & 0xFF0000) / _arg8);
_local14 = (_arg6 / _arg8);
_local15 = (_arg7 / _arg8);
_local16 = _local19;
_local17 = _local20;
_local18 = _local21;
_local9 = 0;
while (_local9 < _arg8) {
steps[_local9] = ((((_local16 & 0xFF0000) << 8) | (_local17 & 0xFF0000)) | ((_local18 & 0xFF0000) >> 8));
_local16 = (_local16 + _local19);
_local17 = (_local17 + _local20);
_local18 = (_local18 + _local21);
_local9++;
};
steps[_local9] = _arg1;
_local9 = _arg2;
while (_local9 < (LVM_xhi << 16)) {
_local10 = _arg3;
while (_local10 < (LVM_yhi << 16)) {
_local12 = (_local9 - _arg6);
_local13 = ((_local9 + _arg6) - _local14);
_local25 = ((_local10 - _arg7) >> 16);
_local26 = ((_local10 + _arg7) >> 16);
_local27 = (_local14 >> 16);
_local11 = 0;
while (_local11 < _arg8) {
_local22 = steps[_local11];
_local23 = (_local12 >> 16);
_local24 = (_local13 >> 16);
HLineFill(_local22, _local23, _local25, _local27);
HLineFill(_local22, _local24, _local25, _local27);
HLineFill(_local22, _local23, _local26, _local27);
HLineFill(_local22, _local24, _local26, _local27);
_local12 = (_local12 + _local14);
_local13 = (_local13 - _local14);
_local11++;
};
_local12 = (_local10 - _arg7);
_local13 = ((_local10 + _arg7) - _local15);
_local25 = ((_local9 - _arg6) >> 16);
_local26 = ((_local9 + _arg6) >> 16);
_local27 = (_local15 >> 16);
_local11 = 0;
while (_local11 < _arg8) {
_local22 = steps[_local11];
_local23 = (_local12 >> 16);
_local24 = (_local13 >> 16);
VLineFill(_local22, _local25, _local23, _local27);
VLineFill(_local22, _local25, _local24, _local27);
VLineFill(_local22, _local26, _local23, _local27);
VLineFill(_local22, _local26, _local24, _local27);
_local12 = (_local12 + _local14);
_local13 = (_local13 - _local14);
_local11++;
};
_local10 = (_local10 + _arg5);
};
_local9 = (_local9 + _arg4);
};
}
private function hline_a(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:int;
_local5 = 0;
while (_local5 <= _arg3) {
plot_a((_arg1 + _local5), _arg2, _arg4);
_local5++;
};
}
private function ReadHST():Boolean{
return (true);
}
private function softnode(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
_local19 = (((_arg1 >> 8) & 0xFF0000) / _arg8);
_local20 = ((_arg1 & 0xFF0000) / _arg8);
_local21 = (((_arg1 << 8) & 0xFF0000) / _arg8);
_local14 = (_arg6 / _arg8);
_local15 = (_arg7 / _arg8);
_local16 = _local19;
_local17 = _local20;
_local18 = _local21;
_local9 = 0;
while (_local9 < _arg8) {
steps[_local9] = ((((_local16 & 0xFF0000) << 8) | (_local17 & 0xFF0000)) | ((_local18 & 0xFF0000) >> 8));
_local16 = (_local16 + _local19);
_local17 = (_local17 + _local20);
_local18 = (_local18 + _local21);
_local9++;
};
steps[_local9] = _arg1;
_local9 = _arg2;
while (_local9 < (LVM_xhi << 16)) {
_local10 = _arg3;
while (_local10 < (LVM_yhi << 16)) {
_local12 = (_local9 - _arg6);
_local13 = ((_local9 + _arg6) - _local14);
_local11 = 0;
while (_local11 < _arg8) {
HLineFill(steps[_local11], (_local12 >> 16), (_local10 >> 16), (_local14 >> 16));
HLineFill(steps[_local11], (_local13 >> 16), (_local10 >> 16), (_local14 >> 16));
_local12 = (_local12 + _local14);
_local13 = (_local13 - _local14);
_local11++;
};
_local12 = (_local10 - _arg7);
_local13 = ((_local10 + _arg7) - _local15);
_local11 = 0;
while (_local11 < _arg8) {
VLineFill(steps[_local11], (_local9 >> 16), (_local12 >> 16), (_local15 >> 16));
VLineFill(steps[_local11], (_local9 >> 16), (_local13 >> 16), (_local15 >> 16));
_local12 = (_local12 + _local14);
_local13 = (_local13 - _local14);
_local11++;
};
_local10 = (_local10 + _arg5);
};
_local9 = (_local9 + _arg4);
};
}
private function SetupGameScreen():void{
SetUpFrame();
SheepyZapFired = 0;
if (quake != 0){
SetPlaneParams((gPlatform.random(8) - 4), (gPlatform.random(8) - 4), 0, 0, Prefs.SCREEN_WIDTH, Prefs.SCREEN_HEIGHT);
quake--;
} else {
SetPlaneParams(0, 0, 0, 0, Prefs.SCREEN_WIDTH, Prefs.SCREEN_HEIGHT);
};
doGrid(things[SHIP].x1, things[SHIP].y1);
}
private function OnScreen(_arg1:Thingie):Boolean{
var _local2:int;
var _local3:int;
_local3 = Sprites[_arg1.spritenum].xSize;
_local2 = (_arg1.x1 >> 16);
if (_local2 < 0){
if (Math.abs(_local2) > _local3){
return (false);
};
} else {
if ((_local2 - AREAX) > _local3){
return (false);
};
};
_local3 = Sprites[_arg1.spritenum].ySize;
_local2 = (_arg1.y1 >> 16);
if (_local2 < (WINDYLO - 32)){
if (Math.abs(_local2) > _local3){
return (false);
};
} else {
if ((_local2 - (WINDYHI + 32)) > _local3){
return (false);
};
};
return (true);
}
private function arraycopy(_arg1:Array, _arg2:int, _arg3:Array, _arg4:int, _arg5:int):void{
var _local6:int;
while (_local6 < _arg5) {
_arg3[(_arg4 + _local6)] = _arg1[(_arg2 + _local6)];
_local6++;
};
}
private function RezShip():void{
var _local1:Thingie = things[SHIP];
_local1.RanSeed = ((826366247 * gPlatform.random(0x0200)) >> 9);
_local1.chunkX = 2;
_local1.chunkY = 2;
_local1.RandYMag = 64;
_local1.RandXMag = 240;
_local1.GeomXInc = 32;
_local1.GeomYInc = 0;
_local1.GeomXStep = 0;
_local1.GeomYStep = 32;
_local1.GeomXOffset = 0;
_local1.GeomYOffset = 0;
_local1.flags = 0;
_local1.Flags = e_UseRand;
BOLLOCKS = -50;
_local1.drawMode = 9;
}
private function SetPlaneParams(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
ScrollX = _arg1;
ScrollY = _arg2;
LVM_xlo = _arg3;
LVM_ylo = _arg4;
LVM_xhi = ((_arg5 + _arg3) - 1);
LVM_yhi = ((_arg6 + _arg4) - 1);
}
private function PlayGame():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:ByteArray;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
switch (gPlayGameState){
case PLAYGAME_SETUP:
SheepyZapState = 0;
alaunched = 0;
unkilled = 0;
demoLevel = 0;
lastLevel = -1;
gStartLifeState = 1;
giHeads = 0;
gPlayGameState = PLAYGAME_START_LIFE;
break;
case PLAYGAME_START_LIFE:
switch (gStartLifeState){
case 1:
gGame.gbKeySelect = false;
if (lastLevel != thisLevel){
_local5 = 0;
_local1 = 116;
while (_local1 < (116 + (giHeads << 3))) {
Sprites[_local1].bits = null;
_local1++;
};
_local1 = 0;
while (_local1 < NSPRITES) {
if (things[_local1].trail_it != null){
_local6 = 0;
while (_local6 < Prefs.TRAIL_LEN) {
things[_local1].trail_it[_local6] = null;
_local6++;
};
things[_local1].trail_it = null;
_local5++;
if (_local5 == 10){
_local5 = 0;
quickGR(false);
gPlatform.paintPixelBuffer();
};
};
_local1++;
};
};
gPlatform.frameLock(false);
gPlatform.setSkipFrame(true);
gStartLifeState++;
break;
case 2:
gPlatform.openResource("level.dat", Prefs.LUMP_LEVEL);
_local7 = 0;
while (_local7 < thisLevel) {
quickGR(false);
gPlatform.paintPixelBuffer();
gPlatform.skipResource();
_local7++;
};
gStartLifeState++;
break;
case 3:
quickGR(false);
gPlatform.paintPixelBuffer();
_local3 = gPlatform.getResource();
_local4 = gPlatform.getResourceBytes();
levelp = new Array((_local3 >> 2));
_local7 = 0;
while (_local7 < _local3) {
levelp[(_local7 >> 2)] = 0;
_local8 = 0;
while (_local8 < 4) {
_local9 = _local4[(_local7 + _local8)];
levelp[(_local7 >> 2)] = (levelp[(_local7 >> 2)] | (_local9 << ((3 - _local8) << 3)));
_local8++;
};
_local7 = (_local7 + 4);
};
gPlatform.closeResource();
gStartLifeState++;
break;
case 4:
lvlscore = 0;
lanTimer = 10;
_local1 = 0;
ilp = 0;
smaxX = 0;
smaxY = 0;
LVM_mouseX = Prefs.SCREEN_WIDTH_HALF;
LVM_mouseY = Prefs.SCREEN_HEIGHT_HALF;
while (levelp[ilp] != 0) {
quickGR(false);
gPlatform.paintPixelBuffer();
var _temp1 = _local1;
_local1 = (_local1 + 1);
gensprites(levelp[ilp++], _temp1);
};
giHeads = _local1;
lastLevel = thisLevel;
ilp++;
controlp = aControl[levelp[ilp++]];
icp = 0;
SetDefaults(thisLevel);
gStartLifeState++;
break;
case 5:
while (levelp[ilp] != 0) {
setLevelParam(levelp[ilp], levelp[(ilp + 1)]);
ilp = (ilp + 2);
};
gStartLifeState++;
break;
case 6:
ilp++;
bm = 1;
alaunched = (alaunched - (unkilled + 2));
isp = 0;
gobble(alaunched);
unkilled = 0;
levelup = 0;
SheepyZapDwellTime = 0;
SheepyZapTotalTime = 0;
quickGR(false);
gPlatform.paintPixelBuffer();
_local1 = 0;
while (_local1 < NSPRITES) {
things[_local1].mode = 0;
_local1++;
};
gStartLifeState++;
break;
case 7:
quickGR(false);
gPlatform.paintPixelBuffer();
_local1 = 0;
while (_local1 < Prefs.NPODS) {
podmap[_local1] = 0;
_local1++;
};
gStartLifeState++;
break;
case 8:
quickGR(false);
gPlatform.paintPixelBuffer();
wactive = 100;
nomore = 0;
ZOO = 0;
ZOOINCSHADOW = ZOOINC;
PODSIZE = (PODSIZE + (goaround << 5));
if (PODSIZE > Prefs.SCREEN_HEIGHT){
PODSIZE = Prefs.SCREEN_HEIGHT;
};
things[SHIP].x1 = (Prefs.SCREEN_WIDTH_HALF << 16);
things[SHIP].y1 = ((Prefs.SCREEN_HEIGHT - (Prefs.SCREEN_HEIGHT_HALF >> 1)) << 16);
things[SHIP].x2 = (Prefs.SCREEN_WIDTH_HALF << 16);
things[SHIP].y2 = ((Prefs.SCREEN_HEIGHT - (Prefs.SCREEN_HEIGHT_HALF >> 1)) << 16);
things[SHIP].xv1 = 0;
things[SHIP].yv1 = 0;
things[SHIP].drawMode = 0;
things[SHIP].animMode = -1;
things[SHIP].spritenum = ((358 + activeSlot) + (5 * SPECIALS_ENABLED));
things[SHIP].flags = COLLIDE;
things[SHIP].mode = 1;
things[SHIP].checkTrail();
gStartLifeState++;
break;
case 9:
quickGR(false);
gPlatform.paintPixelBuffer();
_local2 = 0;
while (_local2 < Prefs.TRAIL_LEN) {
things[SHIP].trail_it[_local2].x = things[SHIP].x1;
things[SHIP].trail_it[_local2].y = things[SHIP].y1;
_local2++;
};
RezShip();
things[PILL].mode = 0;
gStartLifeState++;
break;
case 10:
quickGR(false);
gPlatform.paintPixelBuffer();
things[XYZ].x1 = (Prefs.SCREEN_WIDTH << 16);
things[XYZ].y1 = (Prefs.SCREEN_HEIGHT << 16);
things[XYZ].z1 = 0x2000;
things[XYZ].xv1 = ZAPXS;
things[XYZ].yv1 = ZAPYS;
things[XYZ].zv1 = ZAPZS;
things[XYZ].animMode = -1;
things[XYZ].icgen = whitelight;
things[XYZ].drawMode = (Prefs.XYZAPPER) ? 8 : -1;
things[XYZ].expNum = 2;
things[XYZ].checkTrail();
gStartLifeState++;
break;
case 11:
quickGR(false);
gPlatform.paintPixelBuffer();
_local2 = 0;
while (_local2 < Prefs.TRAIL_LEN) {
things[XYZ].trail_it[_local2].x = things[XYZ].x1;
things[XYZ].trail_it[_local2].y = things[XYZ].y1;
things[XYZ].trail_it[_local2].z = things[XYZ].z1;
_local2++;
};
things[XYZ].trail_p = 0;
things[XYZ].spritenum = 524288;
things[XYZ].spritenum2 = 524288;
things[XYZ].flags = 0;
things[XYZ].mode = (Prefs.XYZAPPER) ? 8 : 0;
giDroneBase = 0;
gStartLifeState++;
break;
case 12:
if (giDroneBase >= 16){
gPlatform.frameLock(true);
gPlatform.setSkipFrame(false);
playSound(Prefs.SFX_MADREZLO);
laupos = (0x1700 + ((giDroneBase - 1) << 10));
gPlayGameState = PLAYGAME_PLAY;
giDroneBase = 0;
gStartLifeState = 1;
return;
};
_local1 = (DRONEBASE + giDroneBase);
quickGR(false);
gPlatform.paintPixelBuffer();
things[_local1].x1 = ((gPlatform.random(Prefs.SCREEN_WIDTH) + Prefs.SCREEN_WIDTH_HALF) << 16);
things[_local1].y1 = ((gPlatform.random(Prefs.SCREEN_HEIGHT) + Prefs.SCREEN_HEIGHT_HALF) << 16);
if (gPlatform.random(8) < 4){
things[_local1].xv1 = ((gPlatform.random(0x0100) - 128) << 11);
things[_local1].yv1 = 0;
} else {
things[_local1].yv1 = ((gPlatform.random(0x0100) - 128) << 11);
things[_local1].xv1 = 0;
};
things[_local1].timer = (50 + gPlatform.random(50));
things[_local1].flags = 0;
things[_local1].expNum = 0;
things[_local1].z1 = (0x1700 + ((_local1 - DRONEBASE) << 10));
things[_local1].icgen = drone1;
things[_local1].x2 = ((((_local1 & 15) << 5) + 16) << 16);
things[_local1].y2 = (Prefs.SCREEN_HEIGHT << 16);
things[_local1].checkTrail();
_local2 = 0;
while (_local2 < Prefs.TRAIL_LEN) {
things[_local1].trail_it[_local2].x = things[_local1].x1;
things[_local1].trail_it[_local2].y = things[_local1].y1;
things[_local1].trail_it[_local2].z = things[_local1].z1;
_local2++;
};
things[_local1].trail_p = 0;
things[_local1].animMode = -1;
things[_local1].drawMode = 11;
things[_local1].shield = nextNME();
if (things[_local1].shield < 0){
things[_local1].mode = 0;
giDroneBase = 16;
} else {
things[_local1].mode = 10;
};
giDroneBase++;
break;
};
break;
case PLAYGAME_PLAY:
if ((((BOLLOCKS < 100)) && ((BOLLOCKS > -100)))){
SetupGameScreen();
WINDXLO = ((OFFX >> 16) + 16);
WINDXHI = ((WINDXLO + Prefs.SCREEN_WIDTH) - 32);
WINDYLO = ((OFFY >> 16) + 16);
WINDYHI = ((WINDYLO + Prefs.SCREEN_HEIGHT) - 32);
DoThings(things);
DrawThings(0, NSPRITES);
DrawPodMap();
dozap();
FinishGameScreen();
FinishFrame();
if (((((Prefs.LEVEL_SKIP) && (gGame.gbKeySelect))) || (((((((!((nomore == 0))) && (((nactive + nactive2) == 0)))) && ((levelup == 0)))) && ((BOLLOCKS == 0)))))){
gGame.gbKeySelect = false;
BOLLOCKS = -1;
levelup = 1;
playSound(Prefs.SFX_LEVEL_UP);
LVM_flash = 12;
things[SHIP].drawMode = 9;
alaunched = 0;
};
} else {
gPlayGameState = PLAYGAME_LIFE_LOST;
};
break;
case PLAYGAME_LIFE_LOST:
SheepyZapState = 0;
gGame.gbKeySelect = false;
if (((!((levelup == 0))) && ((BOLLOCKS < 1)))){
playSound(Prefs.SFX_WARP);
if (Prefs.NUM_EOL_ZOOM_FRAMES > 0){
LVM_flash = 12;
};
lives++;
lanTimer = 20;
ZOOINC = 16;
_local1 = 0;
while (_local1 < Prefs.NUM_EOL_ZOOM_FRAMES) {
SetupGameScreen();
FinishGameScreen();
FinishFrame();
ZOOINC++;
ZOOM = (ZOOM + (ZOOINC << 1));
gPlatform.paintPixelBuffer();
gPlatform.forcePaint();
_local1++;
};
gr[0] = (gPlatform.random(4) + 3);
gr[1] = (gPlatform.random(4) + 3);
gr[2] = (gPlatform.random(4) + 3);
gr[3] = (gPlatform.random(4) + 3);
gr[4] = (gPlatform.random(3) + 1);
gr[5] = (gPlatform.random(3) + 1);
if ((((thisLevel == 49)) || ((demoLevel == demoLevels[(demoLevels.length - 1)])))){
if (Prefs.DEMO){
demoLevel = 0;
thisLevel = demoLevels[0];
} else {
thisLevel = 0;
goaround++;
};
goaround++;
} else {
if (Prefs.DEMO){
demoLevel++;
thisLevel = demoLevels[demoLevel];
} else {
thisLevel++;
if ((((((((thisLevel == 14)) || ((thisLevel == 22)))) || ((thisLevel == 32)))) || ((thisLevel == 39)))){
thisLevel++;
};
};
};
icp = 0;
playSound(Prefs.SFX_ZAPPER_RECHARGE);
} else {
if (Prefs.INFINITE_LIVES == false){
lives--;
};
if (Prefs.LEVEL_SKIP_ON_DEATH == true){
gGame.gbKeySelect = true;
};
};
if (lives < 0){
gPlayGameState = PLAYGAME_GAME_OVER_SETUP;
} else {
gPlayGameState = PLAYGAME_START_LIFE;
};
break;
case PLAYGAME_GAME_OVER_SETUP:
LVM_flash = 12;
playSound(Prefs.SFX_HAMSTER);
BOLLOCKS = 0;
things[XYZ].mode = 0;
things[PILL].mode = 0;
things[SHIP].mode = 14;
things[SHIP].x2 = ((((WINDXHI - WINDXLO) >> 1) + WINDXLO) << 16);
things[SHIP].y2 = ((((WINDXHI - WINDXLO) >> 1) + WINDXLO) << 16);
things[SHIP].x2 = (Prefs.SCREEN_WIDTH_HALF << 16);
things[SHIP].y2 = (Prefs.SCREEN_HEIGHT_HALF << 16);
things[SHIP].z1 = 0x1000;
things[SHIP].spritenum = 393216;
things[SHIP].spritenum2 = 393216;
things[SHIP].drawMode = 14;
things[SHIP].expNum = 5;
things[SHIP].icgen = whitelight;
things[SHIP].gen1 = 0;
things[SHIP].gen2 = 5;
things[SHIP].gen3 = 64;
things[SHIP].gen4 = 7;
_local2 = 0;
while (_local2 < Prefs.TRAIL_LEN) {
things[SHIP].trail_it[_local2].x = things[XYZ].x1;
things[SHIP].trail_it[_local2].y = things[XYZ].y1;
things[SHIP].trail_it[_local2].z = things[XYZ].z1;
_local2++;
};
things[XYZ].trail_p = 0;
gPlatform.updateFacebookScore(score);
gPlatform.saveFacebookHiscore(score);
gPlayGameState = PLAYGAME_GAME_OVER;
break;
case PLAYGAME_GAME_OVER:
SetupGameScreen();
WINDXLO = ((OFFX >> 16) + 16);
WINDXHI = ((WINDXLO + Prefs.SCREEN_WIDTH) - 32);
WINDYLO = ((OFFY >> 16) + 16);
WINDYHI = ((WINDYLO + Prefs.SCREEN_HEIGHT) - 32);
DoThings(things);
DrawThings(0, 100);
DrawPodMap();
FinishGameScreen();
FinishFrame();
if (((gGame.gbKeySelect) || (gGame.gbMouseClicked))){
gGame.gbKeySelect = false;
gGame.gbMouseClicked = false;
SetTint(0);
INGAME = 0;
gPlayGameState = PLAYGAME_SETUP;
gGameState = GAME_SETUP;
gGame.setScreen(Prefs.SCREEN_HIGHSCORE);
};
break;
};
}
private function NewDrone(_arg1:Thingie):void{
var _local2:int;
if (nomore != 0){
_arg1.mode = 0;
} else {
_arg1.x1 = ((gPlatform.random(Prefs.SCREEN_WIDTH) + Prefs.SCREEN_WIDTH_HALF) << 16);
_arg1.y1 = ((gPlatform.random(Prefs.SCREEN_HEIGHT) + Prefs.SCREEN_HEIGHT_HALF) << 16);
if (gPlatform.random(8) < 4){
_arg1.xv1 = ((gPlatform.random(0x0100) - 128) << 11);
_arg1.yv1 = 0;
} else {
_arg1.yv1 = ((gPlatform.random(0x0100) - 128) << 11);
_arg1.xv1 = 0;
};
_arg1.timer = (50 + gPlatform.random(50));
_arg1.flags = 0;
_arg1.expNum = 0;
_arg1.z1 = (laupos + ZOO);
_arg1.icgen = drone1;
_arg1.checkTrail();
_local2 = 0;
while (_local2 < Prefs.TRAIL_LEN) {
_arg1.trail_it[_local2].x = _arg1.x1;
_arg1.trail_it[_local2].y = _arg1.y1;
_arg1.trail_it[_local2].z = _arg1.z1;
_local2++;
};
_arg1.trail_p = 0;
_arg1.shield = nextNME();
_arg1.animMode = -1;
_arg1.drawMode = 11;
if (_arg1.shield < 0){
_arg1.mode = 0;
} else {
_arg1.mode = 10;
};
};
}
private function DrawPodMap():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
_local1 = 0;
while (_local1 < Prefs.NPODS_X) {
_local2 = 0;
while (_local2 < Prefs.NPODS_Y) {
_local5 = podmap[(_local1 + (_local2 * Prefs.NPODS_X))];
if ((_local5 & 0xFF) != 0){
switch ((_local5 & 0xFF)){
case 1:
if (HitShip((_local1 << 4), (_local2 << 4), 16)){
LVM_flash = 6;
KillShip(null);
};
_local3 = ((_local5 >> 16) & 0xFF);
DrawCenteredObject((35 + _local3), 0xFF, ((_local1 << 4) - (OFFX >> 16)), ((_local2 << 4) - (OFFY >> 16)));
if ((frames & 1) != 0){
_local4 = ((_local5 >> 24) & 0xFF);
if ((_local5 & 0x0100) != 0){
_local3--;
if (_local3 < 1){
_local4++;
if (_local4 > 7){
_local5 = 2;
_local3 = 0;
_local4 = 0;
playSound(Prefs.SFX_EXPLODE);
} else {
_local5 = (_local5 & 0xFF);
};
};
podmap[(_local1 + (_local2 * Prefs.NPODS_X))] = (((_local4 << 24) | (_local3 << 16)) | (_local5 & 0xFFFF));
} else {
_local3++;
if (_local3 == _local4){
_local5 = (_local5 | 0x0100);
};
podmap[(_local1 + (_local2 * Prefs.NPODS_X))] = (((_local4 << 24) | (_local3 << 16)) | (_local5 & 0xFFFF));
};
};
break;
case 2:
_local3 = (frames & 3);
if ((frames & 4) != 0){
_local3 = (3 - _local3);
};
_local8 = ColourGen(fire);
_local6 = ((_local1 << 4) - (OFFX >> 16));
_local7 = ((_local2 << 4) - (OFFY >> 16));
_local4 = (_local5 >> 16);
_local4 = (_local4 + 4);
if (_local4 > (PODSIZE + 32)){
podmap[(_local1 + (_local2 * Prefs.NPODS_X))] = 0;
} else {
podmap[(_local1 + (_local2 * Prefs.NPODS_X))] = ((_local5 & 0xFFFF) | (_local4 << 16));
if (_local4 > PODSIZE){
_local9 = (_local4 % (lasermasks.length - 1));
HLineFillM(_local8, (_local6 - _local4), _local7, (_local4 << 1), lasermasks[_local9]);
VLineFillM(_local8, _local6, (_local7 - _local4), (_local4 << 1), lasermasks[_local9]);
} else {
HLineFill(_local8, (_local6 - _local4), _local7, (_local4 << 1));
VLineFill(_local8, _local6, (_local7 - _local4), (_local4 << 1));
};
DrawCenteredObject((72 + _local3), 0xFF, _local6, (_local7 - _local4));
DrawCenteredObject((76 + _local3), 0xFF, _local6, (_local7 + _local4));
DrawCenteredObject((80 + _local3), 0xFF, (_local6 + _local4), _local7);
DrawCenteredObject((84 + _local3), 0xFF, (_local6 - _local4), _local7);
if (HitShipCross(_local6, _local7, _local4)){
LVM_flash = 12;
KillShip(null);
playSound(Prefs.SFX_ZAPPO);
};
};
break;
};
};
_local2++;
};
_local1++;
};
}
private function Clip(_arg1:Rectangle):Boolean{
if (_arg1.right < LVM_xlo){
return (false);
};
if (_arg1.left > LVM_xhi){
return (false);
};
if (_arg1.bottom < LVM_ylo){
return (false);
};
if (_arg1.top > LVM_yhi){
return (false);
};
if (_arg1.left < LVM_xlo){
_arg1.left = (_arg1.left + (LVM_xlo - _arg1.left));
};
if (_arg1.top < LVM_ylo){
_arg1.top = (_arg1.top + (LVM_ylo - _arg1.top));
};
if (_arg1.right > LVM_xhi){
_arg1.right = (_arg1.right - (_arg1.right - LVM_xhi));
};
if (_arg1.bottom > LVM_yhi){
_arg1.bottom = (_arg1.bottom - (_arg1.bottom - LVM_yhi));
};
return (true);
}
private function aExplodeCenteredObject(_arg1:Thingie):void{
var _local2:int;
var _local3:int;
_arg1.SourceXOffset = 0;
_arg1.SourceYOffset = 0;
_arg1.SourceXSize = Sprites[_arg1.spritenum].xSize;
_arg1.SourceYSize = Sprites[_arg1.spritenum].ySize;
_local2 = (_arg1.SourceXSize >> 1);
_local3 = (_arg1.SourceYSize >> 1);
Smash(_arg1, _arg1.ExplosionTime, 0, (_arg1.x1 - _local2), (_arg1.y1 - _local3));
}
private function VFillMask(_arg1:int, _arg2:Rectangle, _arg3:int):void{
var _local4:int;
var _local5:int;
if (!Clip(_arg2)){
return;
};
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
_local4 = (gaHeightTable[_arg2.top] + _arg2.left);
} else {
_local4 = ((_arg2.top * Prefs.SCREEN_WIDTH) + _arg2.left);
};
};
_local5 = 0;
while (_local5 < (_arg2.bottom - _arg2.top)) {
if ((_arg3 & (1 << (_local5 & 31))) != 0){
if (Prefs.PIXEL_BUFFER){
gPlatform.buffer[_local4] = _arg1;
} else {
gPlatform.drawPixel(_arg2.left, (_arg2.top + _local5), _arg1);
};
};
if (Prefs.PIXEL_BUFFER){
_local4 = (_local4 + Prefs.SCREEN_WIDTH);
};
_local5++;
};
}
private function skore(_arg1:int):void{
score = (score + (_arg1 * bm));
lvlscore = (lvlscore + (_arg1 * bm));
}
private function ColourFill(_arg1:int, _arg2:Rectangle):void{
if (!Clip(_arg2)){
return;
};
_arg2.left = (_arg2.left + ScrollX);
_arg2.right = (_arg2.right + ScrollX);
_arg2.top = (_arg2.top + ScrollY);
_arg2.bottom = (_arg2.bottom + ScrollY);
if (((Prefs.BAR_A) && (!(((_arg1 & 0xFF) == 0))))){
bar_a(_arg2.left, _arg2.top, _arg2.right, _arg2.bottom, _arg1);
} else {
bar(_arg2.left, _arg2.top, _arg2.right, _arg2.bottom, _arg1);
};
}
private function setLevelParam(_arg1:int, _arg2:int):void{
switch (_arg1){
case PARAM_TAILSIZE:
TAILSIZE = _arg2;
break;
case PARAM_HEADSHIELD:
HEADSHIELD = (_arg2 * Prefs.HITS_MULTIPLIER);
break;
case PARAM_TAILSHIELD:
TAILSHIELD = (_arg2 * Prefs.HITS_MULTIPLIER);
break;
case PARAM_ZOOINC:
ZOOINC = _arg2;
break;
case PARAM_HEADFREE:
HEADFREE = _arg2;
break;
case PARAM_XSPEED:
XSPEED = (_arg2 * Prefs.SPEED_MULTIPLIER);
break;
case PARAM_YSPEED:
YSPEED = (_arg2 * Prefs.SPEED_MULTIPLIER);
break;
case PARAM_SEP:
SEP = _arg2;
break;
case PARAM_ZAPXS:
ZAPXS = _arg2;
break;
case PARAM_ZAPYS:
ZAPYS = _arg2;
break;
case PARAM_ZAPZS:
ZAPZS = _arg2;
break;
case PARAM_PODSIZE:
PODSIZE = _arg2;
break;
case PARAM_FIREMODE:
FIREMODE = _arg2;
break;
case PARAM_TURN_RATE:
turn_rate = _arg2;
break;
case PARAM_TURN_SPEED:
turn_speed = (_arg2 * Prefs.SPEED_MULTIPLIER);
break;
case PARAM_DS_MODE:
DS_mode = _arg2;
break;
case PARAM_DS_LASER:
DS_laser = _arg2;
break;
case PARAM_DS_VEL:
DS_vel = (_arg2 * Prefs.SPEED_MULTIPLIER);
break;
};
}
private function HFillMask(_arg1:int, _arg2:Rectangle, _arg3:int):void{
var _local4:int;
var _local5:int;
if (!Clip(_arg2)){
return;
};
if (Prefs.USE_Y_ARRAY){
_local4 = (gaHeightTable[_arg2.top] + _arg2.left);
} else {
_local4 = ((_arg2.top * Prefs.SCREEN_WIDTH) + _arg2.left);
};
_local5 = 0;
while (_local5 < (_arg2.right - _arg2.left)) {
if ((_arg3 & (1 << (_local5 & 31))) != 0){
if (Prefs.PIXEL_BUFFER){
gPlatform.buffer[(_local4 + _local5)] = _arg1;
} else {
gPlatform.drawPixel((_arg2.left + _local5), _arg2.top, _arg1);
};
};
_local5++;
};
}
private function SpriteScaled(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local20:int;
var _local21:int;
_arg5 = (_arg5 + ScrollX);
_arg6 = (_arg6 + ScrollY);
if (_arg6 > LVM_yhi){
return;
};
if (_arg5 > LVM_xhi){
return;
};
if ((_arg6 + _arg8) < LVM_ylo){
return;
};
if ((_arg5 + _arg7) < LVM_xlo){
return;
};
var _local9:int;
var _local10:int;
var _local16:Array = Sprites[_arg1].bits;
var _local17:int = Sprites[_arg1].xSize;
if (_arg5 < LVM_xlo){
_local12 = (LVM_xlo - _arg5);
_arg5 = (_arg5 + _local12);
_arg3 = (_arg3 + _local12);
_arg7 = (_arg7 - _local12);
};
if (_arg6 < LVM_ylo){
_local12 = (LVM_ylo - _arg6);
_arg6 = (_arg6 + _local12);
_arg4 = (_arg4 + _local12);
_arg8 = (_arg8 - _local12);
};
var _local18:int = (_arg7 + ((_arg7 + 1) >> 1));
var _local19:int = (_arg8 + ((_arg8 + 1) >> 1));
if ((_arg5 + _local18) > LVM_xhi){
_arg7 = (_arg7 - ((_arg5 + _local18) - LVM_xhi));
};
if ((_arg6 + _local19) > LVM_yhi){
_arg8 = (_arg8 - ((_arg6 + _local19) - LVM_yhi));
};
_local15 = (Prefs.SCREEN_WIDTH - _arg7);
_local14 = (_local17 - _arg7);
_local9 = (_arg3 + (_arg4 * _local17));
if (Prefs.USE_Y_ARRAY){
_local10 = (_arg5 + gaHeightTable[_arg6]);
} else {
_local10 = (_arg5 + (_arg6 * Prefs.SCREEN_WIDTH));
};
if (_arg2 == 0){
if (Prefs.PIXEL_BUFFER){
_local12 = 0;
while (_local12 < _arg8) {
_local21 = _local10;
_local20 = _local15;
_local13 = 0;
while (_local13 < _arg7) {
var _temp1 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp1];
gPlatform.buffer[_local10] = _local11;
if ((_local13 & 2) == 2){
_local10++;
_local20--;
gPlatform.buffer[_local10] = _local11;
};
_local10++;
_local13++;
};
_local10 = (_local10 + _local20);
if (((((_local12 & 2) == 2)) && ((_local12 < (_arg8 - 1))))){
arraycopy(gPlatform.buffer, _local21, gPlatform.buffer, _local10, _local18);
_local10 = (_local10 + Prefs.SCREEN_WIDTH);
};
_local9 = (_local9 + _local14);
_local12++;
};
} else {
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp2 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp2];
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), (_arg6 + _local12), _local11);
gPlatform.drawPixel((_arg5 + _local13), ((_arg6 + _local12) + 1), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), ((_arg6 + _local12) + 1), _local11);
_local13 = (_local13 + 2);
};
_local9 = (_local9 + _local14);
_local12 = (_local12 + 2);
};
};
return;
};
switch (LVM_drawmode){
case 0:
if (Prefs.PIXEL_BUFFER){
_local12 = 0;
while (_local12 < _arg8) {
_local21 = _local10;
_local20 = _local15;
_local13 = 0;
while (_local13 < _arg7) {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp3];
if (_local11 != 0){
gPlatform.buffer[_local10] = _local11;
};
if ((_local13 & 2) == 2){
_local10++;
_local20--;
if (_local11 != 0){
gPlatform.buffer[_local10] = _local11;
};
};
_local10++;
_local13++;
};
_local10 = (_local10 + _local20);
if (((((_local12 & 2) == 2)) && ((_local12 < (_arg8 - 1))))){
arraycopy(gPlatform.buffer, _local21, gPlatform.buffer, _local10, _local18);
_local10 = (_local10 + Prefs.SCREEN_WIDTH);
};
_local9 = (_local9 + _local14);
_local12++;
};
} else {
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp4 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp4];
if (_local11 != 0){
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), (_arg6 + _local12), _local11);
gPlatform.drawPixel((_arg5 + _local13), ((_arg6 + _local12) + 1), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), ((_arg6 + _local12) + 1), _local11);
};
_local13 = (_local13 + 2);
};
_local9 = (_local9 + _local14);
_local12 = (_local12 + 2);
};
};
break;
case 1:
if (Prefs.PIXEL_BUFFER){
_local12 = 0;
while (_local12 < _arg8) {
_local21 = _local10;
_local20 = _local15;
_local13 = 0;
while (_local13 < _arg7) {
var _temp5 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp5];
if (_local11 != 0){
gPlatform.buffer[_local10] = LVM_tint;
};
if ((_local13 & 2) == 2){
_local10++;
_local20--;
if (_local11 != 0){
gPlatform.buffer[_local10] = LVM_tint;
};
};
_local10++;
_local13++;
};
_local10 = (_local10 + _local20);
if (((((_local12 & 2) == 2)) && ((_local12 < (_arg8 - 1))))){
arraycopy(gPlatform.buffer, _local21, gPlatform.buffer, _local10, _local18);
_local10 = (_local10 + Prefs.SCREEN_WIDTH);
};
_local9 = (_local9 + _local14);
_local12++;
};
} else {
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp6 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp6];
if (_local11 != 0){
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), LVM_tint);
gPlatform.drawPixel(((_arg5 + _local13) + 1), (_arg6 + _local12), LVM_tint);
gPlatform.drawPixel((_arg5 + _local13), ((_arg6 + _local12) + 1), LVM_tint);
gPlatform.drawPixel(((_arg5 + _local13) + 1), ((_arg6 + _local12) + 1), LVM_tint);
};
_local13 = (_local13 + 2);
};
_local9 = (_local9 + _local14);
_local12 = (_local12 + 2);
};
};
break;
case 2:
if (Prefs.PIXEL_BUFFER){
_local12 = 0;
while (_local12 < _arg8) {
_local21 = _local10;
_local20 = _local15;
_local13 = 0;
while (_local13 < _arg7) {
var _temp7 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp7];
if (_local11 == 0){
gPlatform.buffer[_local10] = LVM_bfill;
} else {
gPlatform.buffer[_local10] = _local11;
};
if ((_local13 & 2) == 2){
_local10++;
_local20--;
if (_local11 == 0){
gPlatform.buffer[_local10] = LVM_bfill;
} else {
gPlatform.buffer[_local10] = _local11;
};
};
_local10++;
_local13++;
};
_local10 = (_local10 + _local20);
if (((((_local12 & 2) == 2)) && ((_local12 < (_arg8 - 1))))){
arraycopy(gPlatform.buffer, _local21, gPlatform.buffer, _local10, _local18);
_local10 = (_local10 + Prefs.SCREEN_WIDTH);
};
_local9 = (_local9 + _local14);
_local12++;
};
} else {
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp8 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp8];
if (_local11 == 0){
_local11 = LVM_bfill;
};
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), (_arg6 + _local12), _local11);
gPlatform.drawPixel((_arg5 + _local13), ((_arg6 + _local12) + 1), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), ((_arg6 + _local12) + 1), _local11);
_local13 = (_local13 + 2);
};
_local9 = (_local9 + _local14);
_local12 = (_local12 + 2);
};
};
break;
case 3:
if (Prefs.PIXEL_BUFFER){
_local12 = 0;
while (_local12 < _arg8) {
_local21 = _local10;
_local20 = _local15;
_local13 = 0;
while (_local13 < _arg7) {
var _temp9 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp9];
if (_local11 == 0){
gPlatform.buffer[_local10] = LVM_bfill;
} else {
gPlatform.buffer[_local10] = LVM_tint;
};
if ((_local13 & 2) == 2){
_local10++;
_local20--;
if (_local11 == 0){
gPlatform.buffer[_local10] = LVM_bfill;
} else {
gPlatform.buffer[_local10] = LVM_tint;
};
};
_local10++;
_local13++;
};
_local10 = (_local10 + _local20);
if (((((_local12 & 2) == 2)) && ((_local12 < (_arg8 - 1))))){
arraycopy(gPlatform.buffer, _local21, gPlatform.buffer, _local10, _local18);
_local10 = (_local10 + Prefs.SCREEN_WIDTH);
};
_local9 = (_local9 + _local14);
_local12++;
};
} else {
_local12 = 0;
while (_local12 < _arg8) {
_local13 = 0;
while (_local13 < _arg7) {
var _temp10 = _local9;
_local9 = (_local9 + 1);
_local11 = _local16[_temp10];
if (_local11 == 0){
_local11 = LVM_bfill;
} else {
_local11 = LVM_tint;
};
gPlatform.drawPixel((_arg5 + _local13), (_arg6 + _local12), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), (_arg6 + _local12), _local11);
gPlatform.drawPixel((_arg5 + _local13), ((_arg6 + _local12) + 1), _local11);
gPlatform.drawPixel(((_arg5 + _local13) + 1), ((_arg6 + _local12) + 1), _local11);
_local13 = (_local13 + 2);
};
_local9 = (_local9 + _local14);
_local12 = (_local12 + 2);
};
};
break;
};
}
private function randomFire(_arg1:Thingie):void{
var _local2:Thingie;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
_local8 = (_arg1.fireMode >> 16);
if (gPlatform.random(0x0100) > _local8){
return;
};
_local3 = findEshot();
if (_local3 < 0){
return;
};
_local2 = things[_local3];
_local6 = (things[SHIP].x1 + OFFX);
_local7 = (things[SHIP].y1 + OFFY);
_local4 = (((_arg1.flags & 2))!=0) ? 172 : 64;
_local5 = (((_arg1.flags & 2))!=0) ? -393216 : 393216;
_local2.x1 = _arg1.x1;
_local2.y1 = _arg1.y1;
_local2.xv1 = 0;
_local2.yv1 = _local5;
_local2.spritenum = _local4;
_local2.animData[0] = _local4;
_local2.shieldhit = 0;
_local2.animMode = -1;
_local2.drawMode = 10;
_local2.flags = COLLIDE;
_local2.shield = -1;
_local2.mode = 7;
switch ((_arg1.fireMode & 0xFF)){
case 2:
_local5 = (((_local7 - _arg1.y1))>0) ? 393216 : -393216;
_local4 = (((_local7 - _arg1.y1))>0) ? 64 : 172;
_local2.yv1 = _local5;
_local2.spritenum = _local4;
_local2.animData[0] = _local4;
break;
case 3:
if (Math.abs((_local6 - _arg1.x1)) < Math.abs((_local7 - _arg1.y1))){
_local5 = (((_local7 - _arg1.y1))>0) ? 393216 : -393216;
_local4 = (((_local7 - _arg1.y1))>0) ? 64 : 172;
_local2.yv1 = _local5;
} else {
_local5 = (((_local6 - _arg1.x1))>0) ? 589824 : -589824;
_local4 = (((_local6 - _arg1.x1))>0) ? 190 : 182;
_local2.xv1 = _local5;
_local2.yv1 = 0;
};
_local2.spritenum = _local4;
_local2.animData[0] = _local4;
break;
};
}
private function getsheepie():void{
var _local1:Thingie;
var _local2:int;
var _local3:int;
if (sheepcounter-- > 0){
return;
};
sheepcounter = 10;
_local3 = ((levelCarryOver)>0) ? 112 : 104;
if (levelCarryOver != 0){
levelCarryOverAchieved = levelCarryOver;
levelCarryOver = 0;
};
_local2 = BONBASE;
while (_local2 < (BONBASE + BONNUM)) {
_local1 = things[_local2];
if (_local1.mode == 0){
_local1.x1 = ((gPlatform.random(Prefs.SCREEN_WIDTH) + WINDXLO) << 16);
_local1.y1 = (-16 << 16);
_local1.xv1 = 0;
_local1.yv1 = 131072;
_local1.animData[0] = _local3;
_local1.drawMode = 3;
_local1.spritenum = _local1.animData[0];
_local1.animMode = -1;
_local1.mode = 15;
_local1.flags = 0;
playSound(Prefs.SFX_BAA);
_local2 = (BONBASE + BONNUM);
break;
};
_local2++;
};
}
private function GetPill():void{
var _local1:Thingie = things[PILL];
if (_local1.mode == 0){
_local1.x1 = (Prefs.SCREEN_WIDTH << 16);
_local1.y1 = (Prefs.SCREEN_HEIGHT << 16);
_local1.xv1 = 0;
_local1.yv1 = 0;
_local1.xv2 = 0xC000;
_local1.yv2 = 0xC000;
_local1.gen1 = 0;
_local1.gen2 = (40 + (thisLevel << 1));
_local1.gen3 = (40 + (thisLevel << 1));
_local1.spritenum = 0;
_local1.drawMode = 13;
_local1.animMode = -1;
_local1.flags = COLLIDE;
_local1.mode = 13;
_local1.ExplosionTime = 65536;
_local1.mode = 13;
HEADFREE = (HEADFREE - 2);
ZOOINC = (ZOOINC << 1);
ZOOINCSHADOW = (ZOOINCSHADOW << 1);
};
}
private function SheepieSave():void{
var _local1:Thingie = things[SIGN1];
playSound(Prefs.SFX_SHEEPIE_ILY);
_local1.mode = 18;
_local1.counter1 = 0;
_local1.drawMode = 16;
_local1.animMode = -1;
_local1.spritenum = 249;
_local1.RanSeed = ((826366247 * gPlatform.random(0x0200)) >> 9);
_local1.chunkX = 2;
_local1.chunkY = 2;
_local1.RandYMag = 64;
_local1.RandXMag = 240;
_local1.GeomXInc = 32;
_local1.GeomYInc = 0;
_local1.GeomXStep = 0;
_local1.GeomYStep = 32;
_local1.GeomXOffset = 0;
_local1.GeomYOffset = 0;
_local1.flags = 0;
_local1.Flags = e_UseRand;
}
private function Smash(_arg1:Thingie, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:int;
var _local28:int;
var _local29:int;
_local17 = _arg1.SourceXSize;
_local18 = _arg1.SourceYSize;
_local15 = _arg1.chunkX;
_local16 = _arg1.chunkY;
_local19 = _arg1.SourceXOffset;
_local20 = _arg1.SourceYOffset;
_local26 = 0;
_local27 = 0;
if ((_arg1.Flags & e_Fade) != 0){
_arg3 = ((_arg3 * _arg2) >> 16);
};
_arg3 = (0xFFFF - (_arg3 & 0xFFFF));
_local23 = _arg1.RanSeed;
_local29 = ((65536 - _arg2) >> 8);
_local29 = (((65536 - _arg2) >> 8) * _local29);
_local29 = (_local29 >> 2);
_local11 = (_arg1.GeomXInc * _arg2);
_local13 = (_arg1.GeomXStep * _arg2);
_local6 = ((_local11 * _local17) / _local15);
_local21 = ((-32768 + _arg1.GeomXOffset) * (_local6 >> 16));
_local6 = ((_local13 * _local18) / _local16);
_local21 = (_local21 + ((-32768 + _arg1.GeomXOffset) * (_local6 >> 16)));
_local12 = (_arg1.GeomYInc * _arg2);
_local14 = (_arg1.GeomYStep * _arg2);
_local6 = ((_local12 * _local17) / _local15);
_local22 = ((-32768 + _arg1.GeomYOffset) * (_local6 >> 16));
_local6 = ((_local14 * _local18) / _local16);
_local22 = (_local22 + ((-32768 + _arg1.GeomYOffset) * (_local6 >> 16)));
do {
_local6 = _local15;
_local17 = (_local17 - _local6);
if (_local17 < 0){
_local6 = (_local6 + _local17);
};
_local8 = _local18;
_local9 = _arg5;
_local10 = _local20;
_local24 = _local21;
_local25 = _local22;
do {
if ((_arg1.Flags & e_UseRand) != 0){
_local23 = (((_local23 & 1))!=0) ? ((_local23 >> 1) ^ RSG_MASK) : (_local23 >> 1);
_local26 = ((((_local23 >> 16) * _arg1.RandXMag) >> 16) * _arg2);
_local23 = (((_local23 & 1))!=0) ? ((_local23 >> 1) ^ RSG_MASK) : (_local23 >> 1);
_local27 = ((((_local23 >> 16) * _arg1.RandYMag) >> 16) * _arg2);
};
if ((_arg1.Flags & e_UseSparkle) != 0){
_local23 = (((_local23 & 1))!=0) ? ((_local23 >> 1) ^ RSG_MASK) : (_local23 >> 1);
_local28 = (((_local23 >> 16) * _local29) >> 12);
if (_local28 < 0x3000){
_local28 = _arg3;
};
} else {
_local28 = _arg3;
};
_local24 = (_local24 + _local13);
_local25 = (_local25 + _local14);
_local7 = _local16;
_local8 = (_local8 - _local7);
if (_local8 < 0){
_local7 = (_local7 + _local8);
};
if (Prefs.SPRITE_SCALING){
SpriteScaled(_arg1.spritenum, _arg3, _local19, _local10, (_arg4 + ((_local24 + _local26) >> 16)), (_local9 + ((_local25 + _local27) >> 16)), _local6, _local7);
} else {
Sprite(_arg1.spritenum, _arg3, _local19, _local10, (_arg4 + ((_local24 + _local26) >> 16)), (_local9 + ((_local25 + _local27) >> 16)), _local6, _local7);
};
_local9 = (_local9 + _local16);
_local10 = (_local10 + _local16);
} while (_local8 > 0);
_arg4 = (_arg4 + _local15);
_local19 = (_local19 + _local15);
_local21 = (_local21 + _local11);
_local22 = (_local22 + _local12);
} while (_local17 > 0);
}
public function main():void{
var _local1:int;
switch (gGameState){
case GAME_OPEN:
ReadHST();
gGameState = GAME_SETUP;
break;
case GAME_SETUP:
_local1 = 0;
while (_local1 < NSPRITES) {
things[_local1] = new Thingie();
things[_local1].mode = 0;
_local1++;
};
ScrollX = 0;
ScrollY = 0;
frames = 0;
wactive = 0;
LVM_bgcol = 0;
LVM_mode = llClear;
LVM_xlo = 0;
LVM_xhi = (Prefs.SCREEN_WIDTH - 1);
LVM_ylo = 0;
LVM_yhi = (Prefs.SCREEN_HEIGHT - 1);
LVM_mouseX = (Prefs.DOUBLE_SCREEN) ? Prefs.SCREEN_WIDTH : Prefs.SCREEN_WIDTH_HALF;
LVM_mouseY = (Prefs.DOUBLE_SCREEN) ? Prefs.SCREEN_HEIGHT : Prefs.SCREEN_HEIGHT_HALF;
LVM_drawmode = 1;
count = 0;
LVM_tint = 0;
LVM_bfill = 0;
BOLLOCKS = 0;
INGAME = 0;
BULLSPURT = 0;
ZOO = 0;
ZOOM = 0;
ZOOINCSHADOW = 16;
WINDXLO = 0;
WINDXHI = Prefs.SCREEN_WIDTH;
WINDYLO = 0;
WINDYHI = Prefs.SCREEN_HEIGHT;
levelCarryOver = 0;
levelCarryOverAchieved = 0;
TAILSIZE = 4;
HEADSHIELD = -1;
TAILSHIELD = -1;
ZOOINC = 16;
HEADFREE = 8;
XSPEED = 0x0500;
YSPEED = 0x0500;
SEP = 4;
ZAPXS = 524288;
ZAPYS = 655360;
ZAPZS = 128;
PODSIZE = 60;
FIREMODE = 65539;
turn_rate = -1;
turn_speed = 64;
DS_mode = 0;
DS_laser = 0;
DS_vel = 0;
PODSHIELD = 1;
SPLITMODE = 528;
loop_prob = 0;
lanTimer = 0;
goaround = 0;
sheepcounter = 10;
activeSlot = 0;
SheepyZapState = 0;
SheepyZapTarget = 0;
SheepyZapFired = 0;
SheepyZapDwellTime = 0;
SheepyZapTotalTime = 0;
LastZapX = 0;
LastZapY = 0;
alaunched = 0;
unkilled = 0;
levelup = 0;
bm = 0;
motion = 1;
lasthiscore = 10;
resumed = 0;
quake = 0;
gameFinished = 0;
thisLevel = Prefs.START_LEVEL;
lastLevel = -1;
demoLevel = 0;
demoMode = 0;
demoPC = 0;
demoTimer = 0;
failed = 0;
diff = 0;
auxfire = 0;
zapx = Prefs.SCREEN_WIDTH;
zapy = Prefs.SCREEN_HEIGHT;
zapt = 0;
inkling = 0;
bouncet = 0;
bouncez = 0;
nomore = 0;
smaxX = 0;
smaxY = 0;
bullfloat = 1043;
cowfloat = 1043;
OFFX = 0;
OFFY = 0;
AREAX = (Prefs.SCREEN_WIDTH * 2);
AREAY = (Prefs.SCREEN_HEIGHT * 2);
XYZ = 0;
lives = 3;
score = 0;
goaround = 0;
if (Prefs.DEMO){
thisLevel = demoLevels[0];
} else {
thisLevel = Prefs.START_LEVEL;
};
INGAME = 1;
gGameState = GAME_PLAY;
break;
case GAME_PLAY:
PlayGame();
if (INGAME == 0){
gGameState = GAME_SETUP;
};
break;
case GAME_SHUTDOWN:
Unbleat();
break;
};
}
private function sequence(_arg1:int):void{
var _local2:int;
_local2 = ((_arg1 >> 16) & 15);
if (_local2 == 0){
return;
};
while (_local2 > 1) {
while (controlp[icp] != 0) {
icp++;
};
if (icp < (controlp.length - 1)){
icp++;
};
_local2--;
};
if (controlp[icp] == 0){
return;
};
while (controlp[icp] != 0) {
setLevelParam(controlp[icp], controlp[(icp + 1)]);
icp = (icp + 2);
};
}
private function turnto(_arg1:Thingie):int{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = sgn(((things[SHIP].x1 + OFFX) - _arg1.x1));
_local3 = sgn(((things[SHIP].y1 + OFFY) - _arg1.y1));
if (_local2 > 0){
if (_local3 > 0){
_local4 = 1;
} else {
_local4 = 3;
};
} else {
if (_local3 > 0){
_local4 = 7;
} else {
_local4 = 5;
};
};
_local2 = turn_speed;
_local3 = (_local4 - ((_arg1.counter1 & 1023) >> 7));
if (Math.abs(_local3) > 3){
_local2 = -(_local2);
};
if (_local3 > 0){
return (_local2);
};
return (-(_local2));
}
private function DrawThings(_arg1:int, _arg2:int):void{
var _local3:int;
nearestPillNum = -1;
nearestPillX = 268369920;
nearestPillY = 268369920;
_local3 = _arg1;
while (_local3 < _arg2) {
if (things[_local3].mode != 0){
DrawThing(things[_local3]);
};
_local3++;
};
}
private function ColourGen(_arg1:int):int{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = ((gaCGEN4_r_hi[_arg1] - gaCGEN4_r_lo[_arg1]) >> 1);
_local3 = ((gaCGEN4_g_hi[_arg1] - gaCGEN4_g_lo[_arg1]) >> 1);
_local4 = ((gaCGEN4_b_hi[_arg1] - gaCGEN4_b_lo[_arg1]) >> 1);
if (Prefs.COLOURGEN){
_local2 = (((_local2 * sine[(((count * gaCGEN4_r[_arg1]) >> 22) & 1023)]) >> 16) + 1);
_local3 = (((_local3 * sine[(((count * gaCGEN4_g[_arg1]) >> 22) & 1023)]) >> 16) + 1);
_local4 = (((_local4 * sine[(((count * gaCGEN4_b[_arg1]) >> 22) & 1023)]) >> 16) + 1);
_local2 = ((_local2 + gaCGEN4_r_lo[_arg1]) & 0xFF);
_local3 = ((_local3 + gaCGEN4_g_lo[_arg1]) & 0xFF);
_local4 = ((_local4 + gaCGEN4_b_lo[_arg1]) & 0xFF);
};
return ((((_local2 << 24) | (_local3 << 16)) | (_local4 << 8)));
}
public function quickGR(_arg1:Boolean):int{
return (quickGrid());
}
private function OnSurface(_arg1:Thingie):Boolean{
var _local2:int;
var _local3:int;
_local3 = Sprites[_arg1.spritenum].xSize;
_local2 = (_arg1.x1 >> 16);
if (_local2 < 0){
if (Math.abs(_local2) > _local3){
return (false);
};
} else {
if ((_local2 - (Prefs.SCREEN_WIDTH << 1)) > _local3){
return (false);
};
};
_local3 = Sprites[_arg1.spritenum].ySize;
_local2 = (_arg1.y1 >> 16);
if (_local2 < 0){
if (Math.abs(_local2) > _local3){
return (false);
};
} else {
if ((_local2 - (Prefs.SCREEN_HEIGHT << 1)) > _local3){
return (false);
};
};
return (true);
}
private function vline(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:int;
var _local6:int;
_arg4 = (_arg4 >> 8);
if (Prefs.PIXEL_BUFFER){
_local5 = (_arg1 + (Prefs.USE_Y_ARRAY) ? gaHeightTable[_arg2] : (_arg2 * Prefs.SCREEN_WIDTH));
_local6 = 0;
while (_local6 <= _arg3) {
gPlatform.buffer[_local5] = _arg4;
_local5 = (_local5 + Prefs.SCREEN_WIDTH);
_local6++;
};
} else {
_local6 = 0;
while (_local6 <= _arg3) {
gPlatform.drawPixel(_arg1, (_arg2 + _local6), _arg4);
_local6++;
};
};
}
private function VLineFillM(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
if (_arg4 < 1){
_arg4 = (_arg4 + 1);
};
rTmp.left = _arg2;
rTmp.right = rTmp.left;
rTmp.top = _arg3;
rTmp.bottom = ((rTmp.top + _arg4) + 1);
VFillMask(_arg1, rTmp, _arg5);
}
private function Unbleat():void{
}
private function box(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
hline(_arg1, _arg2, (_arg3 - _arg1), _arg5);
vline(_arg1, _arg2, (_arg4 - _arg2), _arg5);
hline(_arg1, _arg4, (_arg3 - _arg1), _arg5);
vline(_arg3, _arg2, (_arg4 - _arg2), _arg5);
}
private function GotMeR(_arg1:Thingie, _arg2:int, _arg3:int):Boolean{
var _local5:int;
var _local4:Thingie = things[_arg2];
if (_local4.mode == 0){
return (false);
};
if ((_local4.flags & COLLIDE) == 0){
return (false);
};
if (_local4.mode == 5){
return (false);
};
if (_local4.drawMode == 1){
return (false);
};
_local5 = Math.abs(((_arg1.x1 >> 16) - (_local4.x1 >> 16)));
if (_local5 > _arg3){
return (false);
};
_local5 = Math.abs(((_arg1.y1 >> 16) - (_local4.y1 >> 16)));
if (_local5 > _arg3){
return (false);
};
return (true);
}
private function DrawThing(_arg1:Thingie):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:int;
var _local28:String;
var _local29:Array;
var _local8:int;
switch (_arg1.drawMode){
case 0:
_local13 = (_arg1.trail_p - (bm << 2));
_local26 = count;
_local2 = 0;
while (_local2 < bm) {
if (_local2 == (bm - 1)){
SetTint(0);
DrawCenteredObject(_arg1.spritenum, 0xFFFF, (_arg1.x1 >> 16), (_arg1.y1 >> 16));
} else {
_local26 = (_local26 + 2086);
SetTint(ColourGenF(whitelight, _local26));
DrawCenteredObject(_arg1.spritenum, 0xFF, (_arg1.trail_it[(_local13 & (Prefs.TRAIL_LEN - 1))].x >> 16), (_arg1.trail_it[(_local13 & (Prefs.TRAIL_LEN - 1))].y >> 16));
_local13 = (_local13 + 4);
};
_local2++;
};
SetTint(0);
break;
case 1:
ExplodeCenteredObject(_arg1);
break;
case 2:
DrawCenteredObject(_arg1.spritenum, 0xFFFF, ((_arg1.x1 - OFFX) >> 16), ((_arg1.y1 - OFFY) >> 16));
_local2 = 0;
while (_local2 < Prefs.TRAIL_LEN) {
if (_arg1.trail_it[_local2].i > 0){
_local7 = ((_arg1.trail_it[_local2].y - OFFY) >> 16);
if ((((_local7 > 0)) && ((_local7 < Prefs.SCREEN_HEIGHT)))){
_local6 = ((_arg1.trail_it[_local2].x - OFFX) >> 16);
if ((((_local6 > 0)) && ((_local6 < Prefs.SCREEN_WIDTH)))){
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
gPlatform.buffer[(gaHeightTable[_local7] + _local6)] = _arg1.trail_it[_local2].c;
} else {
gPlatform.buffer[((_local7 * Prefs.SCREEN_WIDTH) + _local6)] = _arg1.trail_it[_local2].c;
};
} else {
gPlatform.drawPixel(_local6, _local7, _arg1.trail_it[_local2].c);
};
};
};
};
_local2++;
};
break;
case 3:
if ((_arg1.flags & LASER) != 0){
_local12 = ColourGen(fire);
_local6 = ((_arg1.x1 - OFFX) >> 16);
_local7 = ((_arg1.y1 - OFFY) >> 16);
HLineFillM(_local12, 0, _local7, Prefs.SCREEN_WIDTH, RSG());
};
if (_arg1.shieldhit != 0){
_arg1.shieldhit--;
SetTint(ColourGen(fire));
};
DrawCenteredObject(_arg1.spritenum, 0xFFFF, ((_arg1.x1 - OFFX) >> 16), ((_arg1.y1 - OFFY) >> 16));
SetTint(0);
break;
case 4:
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local6 = ((_arg1.x1 - OFFX) >> 16);
_local13 = (((_arg1.counter1 & 16383))<0x0200) ? -1 : 1;
_local7 = ((_arg1.y1 - OFFY) >> 16);
_local12 = ((frames >> 2) % 10);
DrawCenteredObject((_local12 + 7), 0xFF, _local6, _local7);
_local11 = 1;
while (_local11 < 8) {
_local3 = ((0 - (_arg1.x1 >> 13)) + ((_local11 * _local13) << 4));
_local26 = (_local26 + 9387);
_local27 = ColourGenF(_arg1.icgen, _local26);
_local2 = 0;
while (_local2 < 4) {
_local14 = ((_local11 * _arg1.xv1) >> 10);
_local9 = ((_local14 * sine[(_local3 & 1023)]) >> 16);
_local14 = ((_local11 * _arg1.yv1) >> 10);
_local10 = ((_local14 * sine[((_local3 + 0x0100) & 1023)]) >> 16);
_local3 = (_local3 + 0x0100);
DrawDotCross(_local27, (_local6 + _local9), (_local7 + _local10));
_local2++;
};
_local11 = (_local11 + 2);
};
break;
case 5:
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local29 = _arg1.pointer;
_local4 = 0;
_local11 = 0x0100;
_local15 = (_arg1.trail_p - _local29[17]);
_local5 = _local29[16];
while (_local5 < _local29[17]) {
_local6 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].x - OFFX) >> 16);
_local7 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].y - OFFY) >> 16);
_local15++;
_local26 = (_local26 + 4172);
_local27 = ColourGenF(_arg1.icgen, _local26);
_local4 = (_local4 + _local29[19]);
_local2 = 0;
while (_local2 < 16) {
_local13 = (((_local29[_local2] & 0xFFFF) * _local11) >> 8);
_local3 = ((_local29[_local2] >> 16) + _local4);
_local14 = ((_local13 * _arg1.ExplosionTime) >> 16);
_local9 = ((_local14 * sine[(_local3 & 1023)]) >> 16);
_local10 = ((_local14 * sine[((_local3 + 0x0100) & 1023)]) >> 16);
if ((_local29[20] & 1) != 0){
DrawDotCross(_local27, (_local6 + _local9), (_local7 + _local10));
};
if ((_local29[20] & 2) != 0){
DrawDotCross(_local27, (_local6 - _local9), (_local7 + _local10));
};
if ((_local29[20] & 4) != 0){
DrawDotCross(_local27, (_local6 - _local9), (_local7 - _local10));
};
if ((_local29[20] & 8) != 0){
DrawDotCross(_local27, (_local6 + _local9), (_local7 - _local10));
};
if ((_local29[20] & 16) != 0){
DrawDotCross(_local27, (_local6 + _local10), (_local7 + _local9));
};
if ((_local29[20] & 32) != 0){
DrawDotCross(_local27, (_local6 - _local10), (_local7 + _local9));
};
if ((_local29[20] & 64) != 0){
DrawDotCross(_local27, (_local6 - _local10), (_local7 - _local9));
};
if ((_local29[20] & 128) != 0){
DrawDotCross(_local27, (_local6 + _local10), (_local7 - _local9));
};
_local2++;
};
_local11 = (_local11 * _local29[18]);
_local11 = (_local11 >> 8);
_local5++;
};
break;
case 6:
if (_arg1.shieldhit != 0){
_arg1.shieldhit--;
SetTint(ColourGen(fire));
};
DrawCenteredObject((_arg1.animData[0] + ((_arg1.counter1 >> 7) & 7)), 0xFFFF, ((_arg1.x1 - OFFX) >> 16), ((_arg1.y1 - OFFY) >> 16));
SetTint(0);
break;
case 7:
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local13 = (_arg1.ExplosionTime / 8);
_local11 = _local13;
_local15 = (_arg1.trail_p - 1);
_local20 = (frames << 3);
_local12 = 0;
while (_local12 < 32) {
if (_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].i == 1){
_local6 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].x - OFFX) - (Prefs.SCREEN_WIDTH_HALF << 16));
_local7 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].y - OFFY) - (Prefs.SCREEN_HEIGHT_HALF << 16));
_local8 = _arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].z;
_local11 = 65536;
_local26 = (_local26 + 1043);
_local27 = ColourGenF(_arg1.icgen, _local26);
_local2 = explosions[_arg1.expNum][0];
while (_local2 < explosions[_arg1.expNum][1]) {
_local4 = (sine[((_local2 + _local20) & 1023)] * (_local11 >> 12));
_local5 = (sine[(((_local2 + 0x0100) + _local20) & 1023)] * (_local11 >> 13));
_local3 = explosions[_arg1.expNum][3];
while (_local3 < explosions[_arg1.expNum][4]) {
_local18 = sine[((_local3 + 0x0100) & 1023)];
_local19 = sine[((_local3 + 0x0200) & 1023)];
_local16 = ((((0 - _local18) >> 8) * _local4) >> 8);
_local17 = (((_local19 >> 8) * _local11) >> 11);
_local17 = (_local17 + (_local8 << 4));
_local17 = (_local8 << 4);
if (_local17 > 0){
_local9 = ((_local16 + _local6) / _local17);
_local10 = ((_local7 + _local5) / _local17);
DrawDotCross(_local27, (_local9 + Prefs.SCREEN_WIDTH_HALF), (_local10 + Prefs.SCREEN_HEIGHT_HALF));
};
_local3 = (_local3 + explosions[_arg1.expNum][5]);
};
_local2 = (_local2 + explosions[_arg1.expNum][2]);
};
};
_local15--;
_local8 = (_local8 + (_local13 >> 3));
_local20 = (_local20 + 48);
_local11 = (_local11 + _local13);
_local12++;
};
break;
case 8:
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local15 = ((_arg1.trail_p - Prefs.gabmex_layers[_arg1.expNum]) - 1);
_local8 = _arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].z;
_local11 = (((_local8 * gabmex_ztwistspeed[_arg1.expNum]) >> 16) + 0x0300);
_local12 = 0;
while (_local12 < Prefs.gabmex_layers[_arg1.expNum]) {
_local8 = _arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].z;
_local25 = (sine[(_local11 & 1023)] >> 8);
_local24 = (sine[((_local11 + 0x0100) & 1023)] >> 8);
_local11 = (_local11 + gabmex_ztwist[_arg1.expNum]);
_local6 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].x - OFFX) - (Prefs.SCREEN_WIDTH_HALF << 16));
_local7 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].y - OFFY) - (Prefs.SCREEN_HEIGHT_HALF << 16));
_local21 = _arg1.spritenum;
_local22 = _arg1.spritenum2;
_local15++;
_local8 = (_local8 << 4);
_local23 = ((gabmex_height[_arg1.expNum] * _local22) >> 1);
_local26 = (_local26 + 1043);
_local27 = ColourGenF(_arg1.icgen, _local26);
if (_local8 > 0){
_local3 = 0;
while (_local3 < gabmex_height[_arg1.expNum]) {
_local16 = ((0 - (gabmex_height[_arg1.expNum] * _local21)) >> 1);
_local28 = gabmex_def[_arg1.expNum][(_local3 + (_local12 * gabmex_step[_arg1.expNum]))];
_local2 = 0;
while (_local2 < gabmex_width[_arg1.expNum]) {
if (_local28.charAt(_local2) == "#"){
_local9 = (((-(_local16) * _local25) >> 8) + ((_local23 * _local24) >> 8));
_local10 = (((_local16 * _local24) >> 8) + ((_local23 * _local25) >> 8));
_local9 = ((_local6 + _local9) / _local8);
_local10 = ((_local7 + _local10) / _local8);
DrawDotCross(_local27, (_local9 + Prefs.SCREEN_WIDTH_HALF), (_local10 + Prefs.SCREEN_HEIGHT_HALF));
};
_local16 = (_local16 + _local21);
_local2++;
};
_local23 = (_local23 - _local22);
_local3++;
};
};
_local12++;
};
break;
case 9:
if (BOLLOCKS < 0){
SetTint(ColourGen(white_throb));
if (Prefs.DRAW_OUTLINE_SHIP){
DrawCenteredObject(111, 0xFF, (_arg1.x1 >> 16), (_arg1.y1 >> 16));
} else {
DrawCenteredObject(358, 0xFF, (_arg1.x1 >> 16), (_arg1.y1 >> 16));
};
SetTint(0);
_local16 = _arg1.x1;
_local23 = _arg1.y1;
_local2 = 1;
while (_local2 < 8) {
_arg1.ExplosionTime = ((0 - (BOLLOCKS * _local2)) << 10);
_arg1.x1 = _arg1.trail_it[((_arg1.trail_p - (_local2 << 2)) & (Prefs.TRAIL_LEN - 1))].x;
_arg1.y1 = _arg1.trail_it[((_arg1.trail_p - (_local2 << 2)) & (Prefs.TRAIL_LEN - 1))].y;
_arg1.GeomXInc = 32;
_arg1.GeomYInc = 0;
_arg1.GeomXStep = 0;
_arg1.chunkX = 2;
_arg1.chunkY = 2;
_arg1.RandYMag = 64;
_arg1.RandXMag = 240;
_arg1.GeomYStep = 32;
_arg1.GeomXOffset = 0;
_arg1.GeomYOffset = 0;
sExplodeCenteredObject(_arg1);
_local2++;
};
_arg1.x1 = _local16;
_arg1.y1 = _local23;
} else {
_arg1.ExplosionTime = (BOLLOCKS << 8);
_arg1.checkTrail();
_arg1.trail_it[(_arg1.trail_p & (Prefs.TRAIL_LEN - 1))].y = _arg1.y1;
_local2 = 1;
while (_local2 < 8) {
_arg1.y1 = _arg1.trail_it[((_arg1.trail_p - _local2) & (Prefs.TRAIL_LEN - 1))].y;
_arg1.GeomXInc = (_local2 << 4);
_arg1.GeomYStep = (_local2 << 3);
_arg1.GeomXStep = ((_local2 - 3) << 5);
sExplodeCenteredObject(_arg1);
_local2++;
};
_local2 = 1;
while (_local2 < 8) {
_arg1.y1 = _arg1.trail_it[((_arg1.trail_p - _local2) & (Prefs.TRAIL_LEN - 1))].y;
_arg1.GeomXInc = (0 - (_local2 << 5));
_arg1.GeomYStep = (0 - (_local2 << 4));
_arg1.GeomXStep = (0 - ((_local2 - 3) << 3));
sExplodeCenteredObject(_arg1);
_local2++;
};
_arg1.trail_p++;
_arg1.y1 = (_arg1.y1 + _arg1.yv1);
_arg1.yv1 = (_arg1.yv1 + 0x8000);
};
break;
case 10:
DrawCenteredObject(_arg1.animData[0], 0xFFFF, ((_arg1.x1 - OFFX) >> 16), ((_arg1.y1 - OFFY) >> 16));
break;
case 11:
if (_arg1.expNum == 0){
if (Prefs.BACKGROUND_LINES){
_local27 = ColourGen(_arg1.icgen);
if (_arg1.mode == 10){
_local8 = ((_arg1.z1 - ZOO) << 4);
} else {
_local8 = (_arg1.z1 << 4);
};
_local8 = 196608;
_local2 = 0;
while (_local2 < Prefs.TRAIL_LEN) {
_local7 = ((((_arg1.trail_it[_local2].y - OFFY) - (Prefs.SCREEN_HEIGHT_HALF << 16)) / _local8) + Prefs.SCREEN_HEIGHT_HALF);
if ((((_local7 > 0)) && ((_local7 < Prefs.SCREEN_HEIGHT)))){
_local6 = ((((_arg1.trail_it[_local2].x - OFFX) - (Prefs.SCREEN_WIDTH_HALF << 16)) / _local8) + Prefs.SCREEN_WIDTH_HALF);
if ((((_local6 > 0)) && ((_local6 < Prefs.SCREEN_WIDTH)))){
if (Prefs.PIXEL_BUFFER){
if (Prefs.USE_Y_ARRAY){
gPlatform.buffer[(gaHeightTable[_local7] + _local6)] = _local27;
} else {
gPlatform.buffer[((_local7 * Prefs.SCREEN_WIDTH) + _local6)] = _local27;
};
} else {
gPlatform.drawPixel(_local6, _local7, _local27);
};
};
};
_local2++;
};
};
} else {
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local15 = _arg1.trail_p;
_local8 = _arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].z;
_local11 = (((_local8 * gabmex_ztwistspeed[_arg1.expNum]) >> 16) + 0x0300);
_local21 = (_arg1.timer << 16);
_local22 = _local21;
_local12 = 0;
while (_local12 < Prefs.gabmex_layers[_arg1.expNum]) {
_local8 = _arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].z;
_local11 = (((_local8 * gabmex_ztwistspeed[_arg1.expNum]) >> 16) + 0x0300);
_local25 = (sine[(_local11 & 1023)] >> 11);
_local24 = (sine[((_local11 + 0x0100) & 1023)] >> 11);
_local6 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].x - OFFX) - (Prefs.SCREEN_WIDTH_HALF << 16));
_local7 = ((_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].y - OFFY) - (Prefs.SCREEN_HEIGHT_HALF << 16));
_local15--;
_local8 = (_local8 << 4);
_local23 = ((gabmex_height[_arg1.expNum] * _local22) >> 1);
_local26 = (_local26 + 1043);
_local27 = ColourGenF(_arg1.icgen, _local26);
if (_local8 > 0){
_local3 = 0;
while (_local3 < gabmex_height[_arg1.expNum]) {
_local16 = ((0 - (gabmex_height[_arg1.expNum] * _local21)) >> 1);
_local28 = gabmex_def[_arg1.expNum][(_local3 + (_local12 * gabmex_step[_arg1.expNum]))];
_local2 = 0;
while (_local2 < gabmex_width[_arg1.expNum]) {
if (_local28.charAt(_local2) == "#"){
_local9 = (((-(_local16) * _local25) >> 8) + ((_local23 * _local24) >> 8));
_local10 = (((_local16 * _local24) >> 8) + ((_local23 * _local25) >> 8));
_local9 = ((_local6 + _local9) / _local8);
_local10 = ((_local7 + _local10) / _local8);
DrawDotCross(_local27, (_local9 + Prefs.SCREEN_WIDTH_HALF), (_local10 + Prefs.SCREEN_HEIGHT_HALF));
};
_local16 = (_local16 + _local21);
_local2++;
};
_local23 = (_local23 - _local22);
_local3++;
};
};
_local21 = (_local21 + 131072);
_local22 = (_local22 + 131072);
_local12++;
};
};
break;
case 12:
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local27 = ColourGenF(_arg1.icgen, _local26);
_local6 = ((_arg1.x1 - OFFX) >> 16);
_local7 = ((_arg1.y1 - OFFY) >> 16);
_local11 = (_arg1.ExplosionTime >> 8);
_local3 = 0;
_local2 = 0;
while (_local2 < 64) {
_local9 = ((_local11 * sine[(_local3 & 1023)]) >> 16);
_local10 = ((_local11 * sine[((_local3 + 0x0100) & 1023)]) >> 16);
_local3 = (_local3 + 16);
DrawDotCross(_local27, (_local6 + _local9), (_local7 + _local10));
_local2++;
};
break;
case 13:
if (_arg1.ExplosionTime > 0){
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local27 = ColourGenF(whitelight, _local26);
_local6 = ((_arg1.x1 - OFFX) >> 16);
_local7 = ((_arg1.y1 - OFFY) >> 16);
_local11 = (_arg1.ExplosionTime >> 8);
_local3 = 0;
_local8 = 0;
while (_local8 < 4) {
_local2 = 0;
while (_local2 < 64) {
_local9 = ((_local11 * sine[(_local3 & 1023)]) >> 16);
_local10 = ((_local11 * sine[((_local3 + 0x0100) & 1023)]) >> 16);
_local3 = (_local3 + 16);
DrawDotCross(_local27, (_local6 + _local9), (_local7 + _local10));
_local2++;
};
_local11 = (_local11 + 8);
_local26 = (_local26 + 2086);
_local8++;
};
} else {
if (_arg1.gen1 > 0){
_local3 = (frames & 7);
_local12 = ColourGen(whitelight);
_local6 = ((_arg1.x1 - OFFX) >> 16);
_local7 = ((_arg1.y1 - OFFY) >> 16);
HLineFillM(_local12, 0, _local7, Prefs.SCREEN_WIDTH, (4278255360 >> _local3));
VLineFillM(_local12, _local6, 0, Prefs.SCREEN_HEIGHT, (4278255360 >> _local3));
};
_local12 = (frames & 3);
if ((frames & 4) != 0){
_local12 = (3 - _local12);
};
DrawCenteredObject((92 + ((_arg1.spritenum)>0) ? 1 : 0), 0xFFFF, ((_arg1.x1 - OFFX) >> 16), ((_arg1.y1 - OFFY) >> 16));
if (_arg1.spritenum != 0){
_arg1.spritenum--;
};
};
break;
case 14:
_local26 = (_arg1.colourindex = (_arg1.colourindex + 1043));
_local15 = ((_arg1.trail_p - Prefs.gabmex_layers[_arg1.expNum]) - 1);
_local8 = _arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].z;
_local11 = (((_local8 * gabmex_ztwistspeed[_arg1.expNum]) >> 16) + 0x0100);
_local12 = 0;
while (_local12 < Prefs.gabmex_layers[_arg1.expNum]) {
_local8 = _arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].z;
_local11 = (((_local8 * gabmex_ztwistspeed[_arg1.expNum]) >> 16) + 0x0100);
_local25 = (sine[(_local11 & 1023)] >> 8);
_local24 = (sine[((_local11 + 0x0100) & 1023)] >> 8);
_local6 = (_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].x - (Prefs.SCREEN_WIDTH_HALF << 16));
_local7 = (_arg1.trail_it[(_local15 & (Prefs.TRAIL_LEN - 1))].y - (Prefs.SCREEN_HEIGHT_HALF << 16));
_local21 = _arg1.spritenum;
_local22 = _arg1.spritenum2;
_local15++;
_local8 = (_local8 << 4);
_local23 = ((gabmex_height[_arg1.expNum] * _local22) >> 1);
_local26 = (_local26 + 1043);
_local27 = ColourGenF(_arg1.icgen, _local26);
if (_local8 > 0){
_local3 = 0;
while (_local3 < gabmex_height[_arg1.expNum]) {
_local16 = ((0 - (gabmex_height[_arg1.expNum] * _local21)) >> 1);
_local28 = gabmex_def[_arg1.expNum][(_local3 + (_local12 * gabmex_step[_arg1.expNum]))];
_local2 = 0;
while (_local2 < gabmex_width[_arg1.expNum]) {
if (_local28.charAt(_local2) == "#"){
_local9 = (((-(_local16) * _local25) >> 8) + ((_local23 * _local24) >> 8));
_local10 = (((_local16 * _local24) >> 8) + ((_local23 * _local25) >> 8));
_local9 = ((_local6 + _local9) / _local8);
_local10 = ((_local7 + _local10) / _local8);
DrawDotCross(_local27, (_local9 + Prefs.SCREEN_WIDTH_HALF), (_local10 + Prefs.SCREEN_HEIGHT_HALF));
};
_local16 = (_local16 + _local21);
_local2++;
};
_local23 = (_local23 - _local22);
_local3++;
};
};
_local12++;
};
break;
case 15:
SetTint(ColourGen(whitelight));
DrawCenteredObject(_arg1.spritenum, 0xFFFF, ((_arg1.x1 - OFFX) >> 16), ((_arg1.y1 - OFFY) >> 16));
SetTint(0);
break;
case 16:
_arg1.x1 = Prefs.SCREEN_WIDTH_HALF;
_arg1.y1 = ((Prefs.SCREEN_HEIGHT + 20) - (_arg1.counter1 << 2));
_local10 = 0;
_local9 = 0;
if (_arg1.y1 < Prefs.SCREEN_HEIGHT_HALF){
_local10 = (Prefs.SCREEN_HEIGHT_HALF - _arg1.y1);
_arg1.y1 = Prefs.SCREEN_HEIGHT_HALF;
_local9 = ((_local10)<8) ? _local10 : 8;
_local2 = 1;
while (_local2 < _local9) {
_arg1.ExplosionTime = ((0 - (_local10 * _local2)) << 9);
aExplodeCenteredObject(_arg1);
_local2++;
};
} else {
DrawCenteredObject(_arg1.spritenum, 0xFF, _arg1.x1, _arg1.y1);
};
break;
};
}
private function JaggyLine(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
_local7 = ((_arg3 - _arg1) / _arg5);
_local8 = ((_arg4 - _arg2) / _arg5);
_local10 = _arg1;
_local11 = _arg2;
_local9 = 0;
while (_local9 < _arg5) {
_arg1 = (_arg1 + _local7);
_arg2 = (_arg2 + _local8);
_local12 = ((gPlatform.random(16) - 8) << 16);
_local13 = ((gPlatform.random(16) - 8) << 16);
line(_local10, _local11, (_arg1 + _local12), (_arg2 + _local13), _arg6);
_local10 = (_arg1 + _local12);
_local11 = (_arg2 + _local13);
_local9++;
};
}
private function dozap():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Thingie;
var _local12:int;
var _local13:int;
_local2 = (((frames >> 1) & 3) + 48);
_local9 = Sprites[_local2].xSize;
_local10 = Sprites[(_local2 + 4)].ySize;
_local3 = (OFFX >> 16);
_local4 = (OFFY >> 16);
if (zapt != 0){
zapt--;
_local1 = 0;
while (_local1 < (Prefs.SCREEN_WIDTH << 1)) {
DrawCenteredObject(_local2, 0xFF, (_local1 - _local3), (zapy - _local4));
_local1 = (_local1 + _local9);
};
_local2 = (_local2 + 4);
_local1 = 0;
while (_local1 < (Prefs.SCREEN_HEIGHT << 1)) {
DrawCenteredObject(_local2, 0xFF, (zapx - _local3), (_local1 - _local4));
_local1 = (_local1 + _local10);
};
if (HitShipCross((zapx - _local3), (zapy - _local4), Prefs.SCREEN_HEIGHT)){
LVM_flash = 12;
KillShip(null);
playSound(Prefs.SFX_ZAPPO);
};
};
if (bouncet != 0){
bouncet--;
};
if (inkling != 0){
_local11 = things[XYZ];
if (_local11.zv1 > 0){
return;
};
_local1 = 0;
_local5 = _local11.x1;
_local6 = _local11.y1;
_local7 = _local11.xv1;
_local8 = _local11.yv1;
while ((_local11.z1 + (_local1 * _local11.zv1)) > 0x1000) {
_local1++;
_local5 = (_local5 + _local7);
if (((((_local5 >> 16) > WINDXHI)) || (((_local5 >> 16) < WINDXLO)))){
_local7 = (0 - _local7);
_local5 = (_local5 + _local7);
};
_local6 = (_local6 + _local8);
if (((((_local6 >> 16) > WINDYHI)) || (((_local6 >> 16) < WINDYLO)))){
_local8 = (0 - _local8);
_local6 = (_local6 + _local8);
};
};
_local5 = ((_local5 >> 16) - _local3);
_local6 = ((_local6 >> 16) - _local4);
_local12 = ColourGen(fire);
_local13 = (_local1 << 1);
VLineFillM(_local12, (_local5 - _local13), 0, Prefs.SCREEN_HEIGHT, RSG());
VLineFillM(_local12, (_local5 + _local13), 0, Prefs.SCREEN_HEIGHT, RSG());
HLineFillM(_local12, 0, (_local6 - _local13), Prefs.SCREEN_WIDTH, RSG());
HLineFillM(_local12, 0, (_local6 + _local13), Prefs.SCREEN_WIDTH, RSG());
};
}
private function DoThings(_arg1:Array):Boolean{
var _local2:int;
nactive_last = nactive;
nactive = 0;
nactive2 = 0;
nearestPillNum = -1;
nearestPillX = 268369920;
nearestPillY = 268369920;
_local2 = 0;
while (_local2 < NSPRITES) {
if (_arg1[_local2].mode != 0){
Animate(_arg1[_local2], _local2);
Behave(_arg1[_local2], _local2);
};
_local2++;
};
if (nactive != 0){
return (true);
};
return (false);
}
private function HLineFill(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
rTmp.left = _arg2;
rTmp.right = (rTmp.left + _arg4);
rTmp.top = _arg3;
rTmp.bottom = (rTmp.top + 1);
ColourFill(_arg1, rTmp);
}
}
}//package
Section 30
//PART (PART)
package {
public class PART {
var c:int;
var i:int;
var yd:int;
var xd:int;
var o:int;
var y:int;
var z:int;
var x:int;
}
}//package
Section 31
//Platform (Platform)
package {
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import com.morpheme.g5.*;
import flash.net.*;
import flash.display.*;
import mx.core.*;
import flash.media.*;
import flash.ui.*;
public dynamic class Platform extends G5Game {
private var gMouseDownX:int;
private var gMouseDownY:int;
private var gConn:LocalConnection;
private var gbDebug:Boolean;
private var gbMousePressed:Boolean;
public var buffer:Array;
private var gbPaint:Boolean;// = true
private var gbResLump:Boolean;
private var levdat:Class;
private var giRes:int;
private var gaSoundObj:Array;
private var gaszResTextLines:Array;
private var RES_SOUND;// = 3
private var gResBytesTmp:ByteArray;
private var gSwfLoader:Loader;
private var gnByte;
private var gMinterBitmap:Bitmap;
private var gszRes:String;
private var gRes:Object;
private var gbBodge:Boolean;
private var RES_IMAGE;// = 2
private var gbDoneMochi:Boolean;// = false
private var oaf:MovieClipLoaderAsset;
private var gszSaveName:String;
private var gStage;
private var gMinterRect:Rectangle;
private var gLumpSprites:ByteArray;
private var gStageBitmap:Bitmap;
private var gaSoundChannel:Array;
private var biglumpSWF:Class;
private var giszResTextLine;
private var gGame:Game;// = null
private var giResFile;
private var gaByte:Array;
private var gFPS:int;// = 0
private var gColour;// = 0
private var gBigLumpContent;
private var giBodge:int;
private var gszFolder:String;
private var sprbin:Class;
private var gLumpLevels:ByteArray;
private var RES_LUMP;// = 1
private var gszResFile:Array;
private var gszAppName:String;
private var RES_TEXT;// = 4
private var gResType;
private var gMouseX:int;
private var gMouseY:int;
private var RES_RAW;// = 5
private var gRoot;
private var gFixedMath:FixedMath;
public static var WAVE = 1;
public static var RIGHT = 8;
public static var SPRITE_FLIP_HORIZ = 0x2000;
public static var KEY_LEFT = 3;
public static var PROP_SOUND_UPDATE_FRAME = 11;
public static var KEY_RIGHT = 4;
public static var SCALE_SHIFT:int = 10;
public static var PROP_FULLSCREEN_BORDER_LEFT = 106;
public static var PI_1DOT5:int = 4826;
public static var PROP_SAVEPROPS = 12;
public static var LEFT = 4;
public static var DEFAULTMATHSCALE:int = 0x0400;
public static var MIDI = 0;
public static var SIZE_SMALL = 0;
public static var DOTTED = 1;
public static var BOTTOM = 32;
public static var PROP_APPNAME = 13;
public static var PROP_QUICK_AALINE = 5;
public static var VCENTER = 2;
public static var PROP_FULLSCREEN_BORDER_IMAGE_TOP = 115;
public static var BEEP = 3;
public static var PROP_GAME_SCREEN_HEIGHT = 124;
public static var PROP_WINDOWED_BORDER_IMAGE_LEFT = 113;
public static var PROP_FULLSCREEN_SCREEN_WIDTH = 121;
public static var TOP = 16;
public static var PROP_WINDOWED_SCREEN_HEIGHT = 120;
public static var PROP_FULL_SCREEN = 8;
public static var PROP_FULLSCREEN_SCREEN_HEIGHT = 122;
public static var PROP_WINDOWED_BORDER_BOTTOM = 101;
public static var PROP_FULLSCREEN_BORDER_RIGHT = 107;
public static var SIZE_LARGE = 2;
public static var PROP_WINDOWED_BORDER_IMAGE = 108;
public static var PROP_BORDER_COLOUR = 110;
public static var PROP_FULLSCREEN_BORDER_IMAGE_LEFT = 117;
public static var OGG = 6;
public static var TONE = 2;
public static var STYLE_BOLD = 2;
public static var PROP_WINDOWED_BORDER_TOP = 100;
public static var SIZE_MEDIUM = 1;
public static var STYLE_PLAIN = 1;
public static var PROP_FULLSCREEN_BORDER_BOTTOM = 105;
public static var PROP_WINDOWED_BORDER_IMAGE_RIGHT = 114;
public static var PROP_PATH = 3;
public static var STYLE_UNDERLINED = 8;
private static var GAME_ID:Number = 33;
public static var SOLID = 0;
public static var PROP_FULLSCREEN_BORDER_IMAGE_RIGHT = 118;
public static var PROP_WINDOWED_BORDER_IMAGE_BOTTOM = 112;
public static var PROP_FULLSCREEN_BORDER_IMAGE = 109;
public static var PROP_GAME_SCREEN_WIDTH = 123;
public static var PROP_SFX_PREFETCH_ONCE = 7;
public static var KEY_UP = 1;
public static var HCENTER = 1;
public static var STYLE_ITALIC = 4;
public static var PROP_SCREEN_X = 9;
public static var KEY_DOWN = 2;
public static var AMR = 4;
public static var PROP_HIDE_MOUSE = 14;
public static var MMF = 5;
public static var PROP_SCREEN_Y = 10;
public static var PROP_WINDOWED_BORDER_IMAGE_TOP = 111;
public static var PROP_MOUSE_CLICK_MS = 6;
public static var PROP_DOUBLE_SCREEN = 4;
public static var KEY_PGDN = 8;
public static var SPRITE_FLIP_VERT = 0x4000;
public static var PROP_FULLSCREEN_BORDER_TOP = 104;
public static var PROP_USE_MOUSE = 1;
public static var KEY_PGUP = 7;
public static var PROP_PROTECT = 2;
public static var KEY_PAUSE = 6;
public static var PROP_FULLSCREEN_BORDER_IMAGE_BOTTOM = 116;
public static var FACE_PROPORTIONAL = 1;
public static var PROP_SAVENAME = 15;
public static var PROP_WINDOWED_SCREEN_WIDTH = 119;
public static var KEY_RESTART = 9;
public static var PROP_WINDOWED_BORDER_LEFT = 102;
public static var PI:int = 3217;
public static var KEY_SELECT = 5;
public static var PROP_WINDOWED_BORDER_RIGHT = 103;
public function Platform(_arg1:Number, _arg2:Number){
biglumpSWF = Platform_biglumpSWF;
sprbin = Platform_sprbin;
levdat = Platform_levdat;
gaSoundObj = new Array(32);
gaSoundChannel = new Array(32);
gRoot = root;
gConn = new LocalConnection();
gLumpSprites = new sprbin();
gLumpLevels = new levdat();
oaf = new biglumpSWF();
Loader(oaf.getChildAt(0)).contentLoaderInfo.addEventListener(Event.INIT, swfListener);
super(GAME_ID, _arg1, _arg2, this, Prefs.DEBUG);
}
public function fillRect(_arg1, _arg2, _arg3, _arg4){
}
public function isMousePressed():Boolean{
return (gbMousePressed);
}
public function setSpritePosition(_arg1:Object, _arg2, _arg3){
CheekySprite(_arg1).setPosition(_arg2, _arg3);
}
public function getResourceRAW(){
getResource();
}
override public function toggleSound():void{
gGame.toggleSounds();
}
public function setPropertyInt(_arg1, _arg2){
}
public function setColor(_arg1){
gColour = _arg1;
}
public function rand():Number{
return (gFixedMath.rand());
}
public function updateBitmapFontSineString(_arg1:Object){
BitmapFont(_arg1).updateSineString();
}
public function stopSound(_arg1:Object){
stopMusic(_arg1);
}
public function debugMsg(_arg1:String){
if (gbDebug){
trace(_arg1);
};
}
public function translateKey(_arg1:KeyboardEvent):Number{
switch (_arg1.keyCode){
case Keyboard.LEFT:
return (Platform.KEY_LEFT);
case Keyboard.RIGHT:
return (Platform.KEY_RIGHT);
case Keyboard.UP:
return (Platform.KEY_UP);
case Keyboard.DOWN:
return (Platform.KEY_DOWN);
case Keyboard.SPACE:
case Keyboard.ENTER:
return (Platform.KEY_SELECT);
case Keyboard.PAGE_DOWN:
return (Platform.KEY_PGDN);
case Keyboard.PAGE_UP:
return (Platform.KEY_PGUP);
case Keyboard.ESCAPE:
case Keyboard.TAB:
return (Platform.KEY_PAUSE);
case "r":
case "R":
return (Platform.KEY_RESTART);
};
switch (String.fromCharCode(_arg1.charCode)){
case "P":
case "p":
case "Q":
case "q":
return (Platform.KEY_PAUSE);
case "r":
case "R":
return (Platform.KEY_RESTART);
};
return (-1);
}
public function aaLine(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
}
public function getFontStringWidth(_arg1:Object, _arg2:String):Number{
return (0);
}
public function playSound(_arg1:Object, _arg2:Boolean){
playMusic(_arg1, _arg2);
}
public function closeResource(){
gbBodge = false;
giBodge = 0;
}
public function createBitmapFont(_arg1:Array, _arg2:Array, _arg3, _arg4, _arg5, _arg6:Object):Object{
return (Object(new BitmapFont(this, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6)));
}
public function forcePaint(){
paintPixelBuffer();
}
public function loadBigLump():void{
gResType = RES_LUMP;
if (Prefs.EMBEDDED_BIGLUMP){
} else {
gSwfLoader = new Loader();
gSwfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, resLoadComplete);
gSwfLoader.load(new URLRequest("biglump.swf"));
};
}
public function getFontHeight(_arg1:Object):int{
return (16);
}
public function getResourceImage(){
var _local1:Object;
var _local2:BitmapData;
var _local3:Loader;
gResType = RES_IMAGE;
if (((Prefs.BIG_LUMP) || (gbResLump))){
if (Prefs.EMBEDDED_BIGLUMP){
_local1 = gBigLumpContent.loaderInfo.applicationDomain.getDefinition((((Prefs.BIG_LUMP) && (!(gbResLump)))) ? String(gRes) : gaszResTextLines[giszResTextLine++]);
} else {
_local1 = gSwfLoader.contentLoaderInfo.applicationDomain.getDefinition((((Prefs.BIG_LUMP) && (!(gbResLump)))) ? String(gRes) : gaszResTextLines[giszResTextLine++]);
};
_local2 = new _local1(null, null);
gRes = Object(_local2);
} else {
gRes = null;
_local3 = new Loader();
_local3.contentLoaderInfo.addEventListener(Event.COMPLETE, resLoadComplete);
_local3.load(new URLRequest((gbResLump) ? gszResFile[giResFile++] : gszRes));
};
}
public function frameLock(_arg1:Boolean){
}
public function getSpriteNumFrames(_arg1:Object):Number{
return (CheekySprite(_arg1).getNumFrames());
}
public function getSpriteImage(_arg1:Object):Object{
return (CheekySprite(_arg1).getImage());
}
public function drawBitmapFontStringFull(_arg1:Object, _arg2:String, _arg3, _arg4, _arg5, _arg6:Boolean, _arg7:Boolean){
BitmapFont(_arg1).drawStringFull(_arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
}
public function setSpriteRotation(_arg1:Object, _arg2){
CheekySprite(_arg1).setRotation(_arg2);
}
public function drawBits(_arg1:Array, _arg2, _arg3, _arg4, _arg5){
}
public function getResourceTextLine(_arg1:Boolean):String{
var _local2:*;
var _local3:*;
var _local4:*;
while (true) {
_local2 = gaszResTextLines[giszResTextLine++];
_local3 = _local2.length;
if ((((_local3 > 0)) && (!((_local2.charAt(0) == ";"))))){
if (_arg1){
_local4 = 0;
while (_local4 < _local3) {
if (_local2.charAt(_local4) != " "){
return (_local2);
};
_local4++;
};
} else {
return (_local2);
};
};
};
return (_local2);
}
public function abs(_arg1):Number{
return (gFixedMath.abs(_arg1));
}
public function drawString(_arg1:String, _arg2, _arg3, _arg4, _arg5, _arg6:Boolean){
}
public function openResource(_arg1:String, _arg2:Boolean):Boolean{
giResFile = 0;
gRes = null;
giRes = 0;
gszRes = (Prefs.BIG_LUMP) ? _arg1 : (gszFolder + _arg1);
gbResLump = _arg2;
if (_arg2){
if (Prefs.BIG_LUMP){
if ((((_arg1 == "sprites.bin")) || ((_arg1 == "level.dat")))){
gbBodge = true;
giBodge = 0;
} else {
gbBodge = false;
gRes = 1;
if (Prefs.EMBEDDED_BIGLUMP){
gaszResTextLines = gRoot[_arg1.substring(0, _arg1.lastIndexOf("."))].text.split("\r");
} else {
gaszResTextLines = gBigLumpContent[_arg1.substring(0, _arg1.lastIndexOf("."))].text.split("\r");
};
giszResTextLine = 0;
};
return (true);
};
gResType = RES_LUMP;
gSwfLoader = new Loader();
gSwfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, resLoadComplete);
gSwfLoader.load(new URLRequest(gszRes));
} else {
gRes = gszRes;
};
return (true);
}
public function getSpriteFrame(_arg1:Object):Number{
return (CheekySprite(_arg1).getFrame());
}
public function doMochiAd():void{
if (!gbDoneMochi){
gbDoneMochi = true;
gbPaint = false;
exitTitleScreen();
};
}
public function drawImage(_arg1:Object, _arg2:int, _arg3:int, _arg4:int, _arg5:int){
var _local6:BitmapData = BitmapData(_arg1);
gStageBitmap.bitmapData.copyPixels(_local6, new Rectangle(0, 0, _local6.width, _local6.height), new Point(_arg2, _arg3), null, null, true);
}
public function hideMouse(){
Mouse.hide();
}
public function run(_arg1:Event):void{
if (gbPaint){
gGame.process();
gGame.paint();
};
}
public function enableDebug(_arg1:Boolean){
gbDebug = _arg1;
}
public function setStrokeStyle(_arg1){
}
public function setBitmapFontCharWidths(_arg1:Object, _arg2:Array){
BitmapFont(_arg1).setCharWidths(_arg2);
}
public function setPixelBuffer(_arg1:Boolean){
}
public function setSpriteVisible(_arg1:Object, _arg2:Boolean){
CheekySprite(_arg1).setVisible(_arg2);
}
public function skipResource():Boolean{
if (((gbResLump) || (gbBodge))){
getResource();
} else {
giResFile++;
};
return (true);
}
public function getPropertyInt(_arg1):Number{
return (1);
}
public function nextSpriteFrame(_arg1:Object){
CheekySprite(_arg1).nextFrame();
}
public function onKeyUp(_arg1:KeyboardEvent):void{
gGame.keyChanged(translateKey(_arg1), false);
}
public function getTranslateX():Number{
return (0);
}
public function getTranslateY():Number{
return (0);
}
public function endHiScoreScreen():void{
exitHiScoresScreen();
}
public function onKeyDown(_arg1:KeyboardEvent):void{
gGame.keyChanged(translateKey(_arg1), true);
}
public function random(_arg1):Number{
return (gFixedMath.random(_arg1));
}
public function startVibrate(_arg1, _arg2){
}
public function getResourceText(){
var _local1:Loader;
if (gbResLump){
} else {
gRes = null;
gResType = RES_TEXT;
_local1 = new Loader();
_local1.contentLoaderInfo.addEventListener(Event.COMPLETE, resLoadComplete);
_local1.load(new URLRequest((gbResLump) ? (gszFolder + gszResFile[giResFile++]) : gszRes));
};
}
public function paintSprite(_arg1:Object){
CheekySprite(_arg1).paint();
}
public function getPropertyBool(_arg1):Boolean{
return (true);
}
public function sin(_arg1):Number{
return (gFixedMath.sin(_arg1));
}
public function getAngleXY(_arg1, _arg2):Number{
return (gFixedMath.getAngleXY(_arg1, _arg2));
}
public function createSprite(_arg1:Object, _arg2, _arg3):Object{
return (Object(new CheekySprite(this, _arg1, _arg2, _arg3)));
}
public function setSkipFrame(_arg1:Boolean){
}
public function angleToTableIndex(_arg1):Number{
return (gFixedMath.angleToTableIndex(_arg1));
}
function onMouseMove(_arg1:MouseEvent):void{
gMouseX = (_arg1.stageX >> 1);
gMouseY = (_arg1.stageY >> 1);
}
private function resLoadComplete(_arg1:Event):void{
var _local2:int;
var _local3:URLLoader;
switch (gResType){
case RES_IMAGE:
gRes = Object(_arg1.target.content.bitmapData);
debugMsg(("IMAGE: " + gRes));
break;
case RES_TEXT:
_local3 = URLLoader(_arg1.target);
gRes = Object(_local3.data);
gaszResTextLines = _local3.data.split("\r\n");
giszResTextLine = 0;
debugMsg(("TEXT: " + gRes));
break;
case RES_SOUND:
if (gbResLump){
gaszResTextLines = _arg1.target.content.filelist.text.split("\r");
giszResTextLine = 0;
};
gRes = Object(_arg1.target);
debugMsg(("SND: " + gRes));
break;
case RES_LUMP:
if (Prefs.BIG_LUMP){
gBigLumpContent = _arg1.target.content;
} else {
gaszResTextLines = _arg1.target.content.filelist.text.split("\r");
};
giszResTextLine = 0;
gRes = Object(_arg1.target);
break;
case RES_RAW:
gRes = Object(_arg1.target);
break;
};
}
public function getStringWidth(_arg1:String):Number{
return (0);
}
public function stopVibrate(){
}
public function aaCircle(_arg1, _arg2, _arg3, _arg4, _arg5){
}
public function setWindowed(){
}
public function doHiScoreScreen(_arg1:int):void{
if (Prefs.FACEBOOK){
gGame.setScreen(Prefs.SCREEN_MAIN_MENU);
} else {
initHiScores(0, false, _arg1, _arg1.toString(), "points scored", 100, 50);
};
}
public function srand(_arg1){
}
public function sqrt(_arg1):Number{
return (gFixedMath.sqrt(_arg1));
}
public function getImageWidth(_arg1:Object):Number{
return (_arg1.width);
}
override public function initGame():void{
if (Prefs.USE_PATH){
gszFolder = root.loaderInfo.loaderURL;
gszFolder = gszFolder.substring(0, (gszFolder.lastIndexOf("/") + 1));
};
gStage = stage;
stage.frameRate = Prefs.FPS;
stage.stageWidth = Prefs.SCREEN_WIDTH;
stage.stageHeight = Prefs.SCREEN_HEIGHT;
stage.quality = StageQuality.LOW;
gStageBitmap = new Bitmap();
gStageBitmap.bitmapData = new BitmapData((stage.stageWidth >> 1), (stage.stageHeight >> 1));
gStageBitmap.x = 0;
gStageBitmap.y = 0;
gStageBitmap.width = stage.stageWidth;
gStageBitmap.height = stage.stageHeight;
gStage.addChildAt(gStageBitmap, 0);
gMinterBitmap = new Bitmap();
gMinterBitmap.bitmapData = new BitmapData((stage.stageWidth >> 1), (stage.stageHeight >> 1));
gMinterRect = new Rectangle(0, 0, (stage.stageWidth >> 1), (stage.stageHeight >> 1));
if (Prefs.PIXEL_BUFFER){
buffer = new Array((stage.stageWidth * stage.stageHeight));
};
gGame = new Game();
gGame.init(this);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseClicked);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
gFixedMath = new FixedMath();
stage.addEventListener(Event.ENTER_FRAME, run);
}
public function drawBitmapFontSineString(_arg1:Object, _arg2:String, _arg3, _arg4, _arg5, _arg6:Boolean){
BitmapFont(_arg1).drawSineString(_arg2, _arg3, _arg4, _arg5, _arg6);
}
public function paintPixelBuffer(){
gStageBitmap.bitmapData.copyPixels(gMinterBitmap.bitmapData, gMinterRect, new Point(0, 0), null, null, true);
}
public function drawImageToImage(_arg1:Object, _arg2:Object, _arg3, _arg4){
_arg1.bitmapData.copyPixels(_arg2, new Rectangle(0, 0, _arg2.width, _arg2.height), new Point(_arg3, _arg4), null, null, true);
}
public function cls(_arg1){
}
public function isResourceReady():Object{
return (gRes);
}
public function getImageHeight(_arg1:Object):Number{
return (_arg1.height);
}
public function setFPS(_arg1){
}
public function drawBitmapFontString(_arg1:Object, _arg2:String, _arg3, _arg4, _arg5, _arg6:Boolean){
BitmapFont(_arg1).drawString(_arg2, _arg3, _arg4, _arg5, _arg6);
}
private function soundHandler(_arg1:Event):void{
debugMsg(("soundHandler: " + _arg1));
var _local2:SoundChannel = (_arg1.target as SoundChannel);
var _local3:* = 0;
while (_local3 < gaSoundObj.length) {
if (gaSoundChannel[_local3] == _local2){
gaSoundObj[_local3] = undefined;
gaSoundChannel[_local3] = undefined;
return;
};
_local3++;
};
}
public function getPropertyString(_arg1):String{
return ("");
}
public function onMouseUp(_arg1:MouseEvent):void{
gbMousePressed = false;
}
public function stopMusic(_arg1:Object){
var _local2 = -1;
var _local3:Sound = (_arg1 as Sound);
if ((((_arg1 == null)) || ((_local3 == null)))){
return;
};
var _local4:* = 0;
while (_local4 < gaSoundObj.length) {
if (gaSoundObj[_local4] == _local3){
gaSoundChannel[_local4].stop();
gaSoundObj[_local4] = (gaSoundChannel[_local4] = undefined);
return;
};
_local4++;
};
}
public function setPropertyImage(_arg1, _arg2:Object){
}
public function updateFacebookScore(_arg1:int):void{
if (Prefs.FACEBOOK){
gConn.send("myConnection", "listUpdate", _arg1);
};
}
public function setSoundVolume(_arg1:Object, _arg2){
}
public function onMouseClicked(_arg1:MouseEvent):void{
if (gGame != null){
gGame.mouseClicked();
};
}
public function getMouseX():Number{
return (gMouseX);
}
public function drawRect(_arg1, _arg2, _arg3, _arg4){
var _local5:Rectangle = new Rectangle(_arg1, _arg2, _arg3, 1);
var _local6:Rectangle = new Rectangle(_arg1, ((_arg2 + _arg4) - 1), _arg3, 1);
var _local7:Rectangle = new Rectangle(_arg1, _arg2, 1, _arg4);
var _local8:Rectangle = new Rectangle(((_arg1 + _arg3) - 1), _arg2, 1, _arg4);
gStageBitmap.bitmapData.fillRect(_local5, gColour);
gStageBitmap.bitmapData.fillRect(_local6, gColour);
gStageBitmap.bitmapData.fillRect(_local7, gColour);
gStageBitmap.bitmapData.fillRect(_local8, gColour);
}
public function getMouseY():Number{
return (gMouseY);
}
public function translate(_arg1, _arg2){
}
private function swfListener(_arg1:Event):void{
gBigLumpContent = (gRes = (gRoot = _arg1.target.content));
}
public function setPropertyString(_arg1:int, _arg2:String){
switch (_arg1){
case PROP_APPNAME:
gszAppName = _arg2;
break;
case PROP_SAVENAME:
gszSaveName = _arg2;
break;
};
}
public function getRoot():Object{
return (gRoot);
}
public function createBeep(_arg1, _arg2):Object{
return (null);
}
public function saveFacebookHiscore(_arg1:int):void{
if (Prefs.FACEBOOK){
gConn.send("myConnection", "saveHiscore", _arg1);
};
}
public function drawLine(_arg1, _arg2, _arg3, _arg4){
}
public function playMusic(_arg1:Object, _arg2:Boolean){
var _local3 = -1;
var _local4:int;
var _local5:Sound = (_arg1 as Sound);
if (_arg1 == null){
return;
};
var _local6:* = 0;
while (_local6 < gaSoundObj.length) {
if (gaSoundObj[_local6] == _local5){
_local4++;
if (_local4 == 2){
return;
};
};
if (gaSoundObj[_local6] == undefined){
_local3 = _local6;
break;
};
_local6++;
};
if (_local3 != -1){
gaSoundObj[_local3] = _local5;
gaSoundChannel[_local3] = _local5.play(0, (_arg2) ? 1000 : 1);
gaSoundChannel[_local3].addEventListener(Event.SOUND_COMPLETE, soundHandler);
};
}
public function drawRegion(_arg1:Object, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int, _arg9:int){
var _local10:BitmapData = BitmapData(_arg1);
gStageBitmap.bitmapData.copyPixels(_local10, new Rectangle(_arg2, _arg3, _arg4, _arg5), new Point(_arg6, _arg7), null, null, true);
}
public function saveGameData(_arg1:ByteArray):Boolean{
var _local2:SharedObject = SharedObject.getLocal(gszSaveName);
_local2.data.gamedata = _arg1;
_local2.flush();
return (true);
}
public function getResourceBytes():ByteArray{
if (((((Prefs.BIG_LUMP) || (gbResLump))) || (gbBodge))){
return ((gRes as ByteArray));
};
return ((gRes.data as ByteArray));
}
public function prevSpriteFrame(_arg1:Object){
CheekySprite(_arg1).prevFrame();
}
public function openBrowser(_arg1:String):void{
var _local2:URLRequest = new URLRequest(_arg1);
navigateToURL(_local2, "_blank");
}
public function getGameID():int{
return (2);
}
public function getResource():int{
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:ByteArray;
var _local6:String;
var _local7:String;
var _local8:URLLoader;
if (Prefs.BIG_LUMP){
_local1 = new ByteArray();
_local2 = 0;
if (gbBodge){
_local4 = 0;
_local5 = ((gszRes)=="sprites.bin") ? gLumpSprites : gLumpLevels;
_local3 = 0;
while (_local3 < 4) {
_local4 = (_local4 + (int(_local5[(_local3 + giBodge)]) << (_local3 * 8)));
_local3++;
};
giBodge = (giBodge + 4);
_local3 = 0;
while (_local3 < _local4) {
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local9 = _temp1;
_local1[_local9] = _local5[(_local3 + giBodge)];
_local3++;
};
giBodge = (giBodge + _local3);
gRes = Object(_local1);
return (_local4);
} else {
if (Prefs.EMBEDDED_BIGLUMP){
_local6 = gRoot[gszRes.substring(0, gszRes.lastIndexOf("."))].text;
} else {
_local6 = gBigLumpContent[gszRes.substring(0, gszRes.lastIndexOf("."))].text;
};
_local3 = 0;
while (_local3 < _local6.length) {
_local7 = ("0x" + _local6.substr(_local3, 2));
var _temp2 = _local2;
_local2 = (_local2 + 1);
_local9 = _temp2;
_local1[_local9] = _local7.valueOf();
_local3 = (_local3 + 2);
};
gRes = Object(_local1);
return (_local2);
};
//unresolved jump
};
gRes = null;
gResType = RES_RAW;
_local8 = new URLLoader();
_local8.dataFormat = URLLoaderDataFormat.BINARY;
_local8.addEventListener(Event.COMPLETE, resLoadComplete);
_local8.load(new URLRequest((gbResLump) ? (gszFolder + gszResFile[giResFile++]) : gszRes));
return (0);
}
public function cos(_arg1):Number{
return (gFixedMath.cos(_arg1));
}
override public function showMenuScreen():void{
gbPaint = true;
gGame.setScreen(Prefs.SCREEN_MAIN_MENU);
}
public function getTimer():Number{
return (getTimer());
}
public function atan(_arg1):Number{
return (gFixedMath.atan(_arg1));
}
public function tan(_arg1):Number{
return (gFixedMath.tan(_arg1));
}
public function drawPixel(_arg1:int, _arg2:int, _arg3:int){
gMinterBitmap.bitmapData.setPixel32(_arg1, _arg2, (4278190080 | uint(_arg3)));
}
public function getPlatformLocale():String{
return ("en");
}
override public function showTitleScreen():void{
while (gGame.getScreen() != Prefs.SCREEN_TITLE) {
gGame.process();
};
gGame.setScreen(Prefs.SCREEN_TITLE);
}
public function loadGameData(_arg1:int):ByteArray{
var _local2:SharedObject = SharedObject.getLocal(gszSaveName);
if (_local2.size == 0){
return (null);
};
return ((_local2.data.gamedata as ByteArray));
}
public function getActualFPS():int{
return (gFPS);
}
public function setSpriteFrameSequence(_arg1:Object, _arg2:Array){
CheekySprite(_arg1).setFrameSequence(_arg2);
}
public function onMouseDown(_arg1:MouseEvent):void{
gbMousePressed = true;
gMouseDownX = (_arg1.stageX >> 1);
gMouseDownY = (_arg1.stageY >> 1);
}
public function setBitmapFontCharSpacing(_arg1:Object, _arg2){
BitmapFont(_arg1).setCharSpacing(_arg2);
}
public function setFont(_arg1:Object){
}
public function setSpriteImage(_arg1:Object, _arg2:Object, _arg3, _arg4){
CheekySprite(_arg1).setImage(_arg2, _arg3, _arg4);
}
public function setSpriteAlpha(_arg1:Object, _arg2){
CheekySprite(_arg1).setAlpha(_arg2);
}
public function clearPixelBuffer(_arg1){
if (Prefs.PIXEL_BUFFER){
buffer = new Array((stage.stageWidth * stage.stageHeight));
} else {
gMinterBitmap.bitmapData.fillRect(gMinterRect, (4278190080 | _arg1));
};
}
public function setFullScreen(){
}
public function setScreenClip(_arg1:Boolean){
}
public function setBitmapFontSineProperties(_arg1:Object, _arg2, _arg3, _arg4){
BitmapFont(_arg1).setSineProperties(_arg2, _arg3, _arg4);
}
public function setPropertyBool(_arg1, _arg2:Boolean){
switch (_arg1){
case PROP_USE_MOUSE:
gStage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
gStage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
gStage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
break;
};
}
public function setBitmapFontCharMap(_arg1:Object, _arg2:Array){
BitmapFont(_arg1).setCharMap(_arg2);
}
public function getResourceSound(_arg1){
var _local2:Object;
var _local3:Sound;
var _local4:Sound;
gResType = RES_SOUND;
if (((Prefs.BIG_LUMP) || (gbResLump))){
if (Prefs.EMBEDDED_BIGLUMP){
_local2 = gBigLumpContent.loaderInfo.applicationDomain.getDefinition((((Prefs.BIG_LUMP) && (!(gbResLump)))) ? String(gRes) : gaszResTextLines[giszResTextLine++]);
} else {
_local2 = gSwfLoader.contentLoaderInfo.applicationDomain.getDefinition((((Prefs.BIG_LUMP) && (!(gbResLump)))) ? String(gRes) : gaszResTextLines[giszResTextLine++]);
};
_local3 = new (_local2);
gRes = Object(_local3);
} else {
gRes = null;
_local4 = new Sound();
_local4.addEventListener(Event.COMPLETE, resLoadComplete);
_local4.load(new URLRequest((gbResLump) ? gszResFile[giResFile++] : gszRes));
};
}
public function setSpriteFrame(_arg1:Object, _arg2){
CheekySprite(_arg1).setFrame(_arg2);
}
public function getSpriteX(_arg1:Object):int{
return (CheekySprite(_arg1).getX());
}
public function getSpriteY(_arg1:Object):int{
return (CheekySprite(_arg1).getY());
}
}
}//package
Section 32
//Platform_biglumpSWF (Platform_biglumpSWF)
package {
import flash.utils.*;
import mx.core.*;
public class Platform_biglumpSWF extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function Platform_biglumpSWF(){
dataClass = Platform_biglumpSWF_dataClass;
super();
initialWidth = (0x3200 / 20);
initialHeight = (9600 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 33
//Platform_biglumpSWF_dataClass (Platform_biglumpSWF_dataClass)
package {
import mx.core.*;
public class Platform_biglumpSWF_dataClass extends ByteArrayAsset {
}
}//package
Section 34
//Platform_levdat (Platform_levdat)
package {
import mx.core.*;
public class Platform_levdat extends ByteArrayAsset {
}
}//package
Section 35
//Platform_sprbin (Platform_sprbin)
package {
import mx.core.*;
public class Platform_sprbin extends ByteArrayAsset {
}
}//package
Section 36
//Prefs (Prefs)
package {
public class Prefs {
public static var OPT_VIBRATE_ON = false;
public static var FONT_SPRITE_WIDTH_DOT = 8;
public static var HELP_FILL_COLOUR = 0;
public static var SOFTKEY_ICONS = false;
public static var SCREEN_MAIN_MENU = 3;
public static var SCREEN_WIDTH = 240;
public static var USE_PATH = false;
public static var OPT_LANG = false;
public static var TRAIL_LEN = 16;
public static var PAINT_LEVEL = true;
public static var HITS_MULTIPLIER = 1.2;
public static var SCREEN_PLAY_AGAIN = 10;
public static var NPODS = (NPODS_X * NPODS_Y);
public static var MENU_FILL_COLOUR_HILITE = 0xFF0000;
public static var SFX_NUM_EXPLETIVES = 0;
public static var DIGIT_SPRITE_HEIGHT = 32;
public static var DIDI_DIGIT_SPRITE_WIDTH = 8;
public static var WRAP_MENU = true;
public static var PIXEL_BUFFER = false;
public static var DIDI_DIGIT_SPRITE_HEIGHT = 10;
public static var SFX_KUNG = (7 + SFX_LOAD);
public static var SOFTKEY_SPRITE_CANCEL = 0;
public static var MEEZ = false;
public static var BITMAP_HELP = true;
public static var SFX_ZAPPER_RECHARGE = (30 + SFX_LOAD);
public static var SCREEN_HEIGHT = 320;
public static var SFX_FLUFFY_SHEEPIE = (20 + SFX_LOAD);
public static var SFX_NOT_USED = -1;
public static var BULLET_TRAIL = true;
public static var SOFTKEY_SPRITE_START = 0;
public static var LUMP_TXT = true;
public static var PRE_ALLOC_TRAIL = false;
public static var MENU_FONT_STYLE = Platform.STYLE_BOLD;
public static var FONT_SPRITE_WIDTH_SPACE = 4;
public static var SHOW_FPS = false;
public static var TITLE_FILL_COLOUR = 0;
public static var SOFTKEY_SPRITE_Y = 0;
public static var BACKGROUND_LINES = false;
public static var SFX_LOAD = 0x0100;
public static var XYZAPPER = true;
public static var DOUBLE_SCREEN = false;
public static var SCREEN_TITLE = 2;
public static var OPT_SFX = true;
public static var NUM_CREDITS_SCREEN_FRAMES = (FPS * 8);
public static var MENU_START_Y = (FACEBOOK) ? 200 : 132;
;
public static var PLAY_MUSIC_IN_GAME = true;
public static var FPS = 30;
public static var SPEED_MULTIPLIER = 1.5;
public static var MENU_FONT_COLOUR = 0xFFFFFF;
public static var SCREEN_WIDTH_HALF = 120;
public static var SFX_EXPLODE_2 = (11 + SFX_LOAD);
public static var BIG_LUMP = true;
public static var BITMAP_FONT_FOR_ALL_LANGS = true;
public static var LUMP_MUSIC = true;
public static var NPODS_X = (SCREEN_WIDTH >> 3);
public static var NPODS_Y = (SCREEN_HEIGHT >> 3);
public static var SCREEN_HEIGHT_HALF = 160;
public static var SFX_BOLLOCKS = SFX_NOT_USED;
public static var LOGO_START_Y = 188;
public static var SFX_BAA = (19 + SFX_LOAD);
public static var SFX_FORMAT = Platform.WAVE;
public static var EMBEDDED_BIGLUMP = true;
public static var LEVEL_SKIP_ON_DEATH = false;
public static var SCREEN_LOAD = 0;
public static var SFX_FUCK = SFX_NOT_USED;
public static var START_LEVEL = 0;
public static var SOFTNODE = true;
public static var SET_CLIP = false;
public static var MENU_TITLE_Y = 30;
public static var DRAW_DOTCROSS = false;
public static var BORDER_COLOUR = 0;
public static var SCREEN_X = 0;
public static var SCREEN_Y = 0;
public static var gabmex_layers:Array = [4, 2, 2, 2, 2, 6, 2, 3, 2, 2];
public static var HISCORE_COLOUR_HILITE = 0xFFFFFF;
public static var OPT_MUSIC = false;
public static var SINE_WAVE_DELAY_FRAMES = 3;
public static var BITMAP_FONT = true;
public static var SFX_CUNT = SFX_NOT_USED;
public static var HELP_FONT_STYLE = Platform.STYLE_BOLD;
public static var SFX_HAMSTER = (16 + SFX_LOAD);
public static var BITMAP_CREDITS = true;
public static var SFX_ZAPPO = (12 + SFX_LOAD);
public static var SFX_EXPLODE_1 = (10 + SFX_LOAD);
public static var SFX_TOTAL_SFX = 31;
public static var BITMAP_MOUSE = false;
public static var LEVEL_SKIP = false;
public static var GRID_3D_EXTRA = false;
public static var LOGO_GAP_Y = 12;
public static var SFX_BADASS = (15 + SFX_LOAD);
public static var LUMP_GFX = true;
public static var DIGIT_SPRITE_WIDTH = 26;
public static var FONT_SPRITE_WIDTH = 8;
public static var MOCHIADS = true;
public static var SFX_ITS_FLOSSIE = (23 + SFX_LOAD);
public static var SFX_ULP = (25 + SFX_LOAD);
public static var YOUR_SCORE_Y = 420;
public static var SCREEN_HELP_FIRST = 11;
public static var SFX_EXPLETIVE = 0;
public static var SCORE_Y = (SCREEN_HEIGHT - 10);
public static var SFX_FIRE = SFX_NOT_USED;
public static var SFX_SHIT = SFX_NOT_USED;
public static var SOFTKEY_SPRITE_WIDTH = 0;
public static var DEMO = false;
public static var OX = 106;
public static var COLOURGEN = true;
public static var MENU_FONT_COLOUR_HILITE = 0xF000F0;
public static var LOADING_BAR_HEIGHT = 25;
public static var REVERSE_SOFTKEYS = false;
public static var SCREEN_HIGHSCORE = 8;
public static var NODE = false;
public static var SOFTKEY_SPRITE_PAUSE = 0;
public static var PLAY_AGAIN_SCORE_Y = 460;
public static var SFX_HUM = (8 + SFX_LOAD);
public static var NUM_HIGHSCORE_SCREEN_FRAMES = (FPS * 8);
public static var SFX_SHEEPIE_ILY = (28 + SFX_LOAD);
public static var GRID_3D = true;
public static var MENU_FONT_SHADOWS = false;
public static var LOADING_BAR_Y = ((SCREEN_HEIGHT - LOADING_BAR_HEIGHT) - 50);
public static var MENU_GAP_Y = 8;
public static var DEBUG = false;
public static var LOADING_BAR_X = 150;
public static var SFX_SHEEPIE_JOY = (29 + SFX_LOAD);
public static var SFX_WARP = (18 + SFX_LOAD);
public static var LUMP_LEVEL = true;
public static var LUMP_TILES = false;
public static var SINE_WAVE_0 = 1;
public static var SINE_WAVE_1 = 2;
public static var SINE_WAVE_2 = 2;
public static var FONT_SPRITE_WIDTH_B = 8;
public static var FONT_SPRITE_WIDTH_D = 8;
public static var FONT_SPRITE_WIDTH_E = 8;
public static var FONT_SPRITE_WIDTH_F = 8;
public static var FONT_SPRITE_WIDTH_H = 8;
public static var FONT_SPRITE_WIDTH_I = 8;
public static var FONT_SPRITE_WIDTH_C = 8;
public static var FONT_SPRITE_WIDTH_K = 8;
public static var FONT_SPRITE_WIDTH_L = 8;
public static var FONT_SPRITE_WIDTH_O = 8;
public static var FONT_SPRITE_WIDTH_P = 8;
public static var FONT_SPRITE_WIDTH_J = 8;
public static var MAX_SCREEN_LIVES = 8;
public static var FONT_SPRITE_WIDTH_S = 8;
public static var FONT_SPRITE_WIDTH_N = 8;
public static var HELP_FONT_SIZE = Platform.SIZE_LARGE;
public static var FONT_SPRITE_WIDTH_W = 8;
public static var FONT_SPRITE_WIDTH_X = 8;
public static var PRELOAD_ALL_STRINGSETS = false;
public static var FONT_SPRITE_WIDTH_Z = 8;
public static var FONT_SPRITE_WIDTH_T = 8;
public static var FONT_SPRITE_WIDTH_M = 8;
public static var FONT_SPRITE_WIDTH_V = 8;
public static var FONT_SPRITE_WIDTH_G = 8;
public static var FONT_SPRITE_WIDTH_Q = 8;
public static var FONT_SPRITE_WIDTH_A = 8;
public static var FONT_SPRITE_WIDTH_U = 8;
public static var FONT_SPRITE_WIDTH_Y = 8;
public static var FONT_SPRITE_WIDTH_R = 8;
public static var ANIM_EXIT = true;
public static var SKIP_FRAME = false;
public static var SFX_ZAPHOD = (26 + SFX_LOAD);
public static var LUMP_SFX = true;
public static var MUSIC_VOLUME = 25;
public static var HELP_GAP_Y = 4;
public static var LOADING_BAR_COLOUR = 4278242304;
public static var OPT_MUSIC_ON = false;
public static var USE_QUICK_AALINE = true;
public static var DIGIT_WIDTH_0 = 26;
public static var DIGIT_WIDTH_1 = 16;
public static var DIGIT_WIDTH_2 = 26;
public static var DIGIT_WIDTH_4 = 23;
public static var DOTNODE = false;
public static var DIGIT_WIDTH_8 = 26;
public static var DIGIT_WIDTH_9 = 26;
public static var PROTECT = false;
public static var SCREEN_NAG = 1;
public static var DIGIT_WIDTH_5 = 22;
public static var DIGIT_WIDTH_7 = 21;
public static var SFX_SHEEP_UP = (24 + SFX_LOAD);
public static var DIGIT_WIDTH_6 = 23;
public static var NUM_HIGHSCORES = 1;
public static var DIGIT_WIDTH_3 = 23;
public static var FACEBOOK = false;
public static var OPT_MUSIC_SFX_EXCLUSIVE = false;
public static var NUM_LIVES = (DEMO) ? 1 : 3;
;
public static var SFX_ZAP2 = (5 + SFX_LOAD);
public static var SFX_EXPLODE = (9 + SFX_LOAD);
public static var SFX_LOVELY_SHEEPIE = (22 + SFX_LOAD);
public static var BAR_A = false;
public static var SOFTKEY_SPRITE_HEIGHT = 0;
public static var INFINITE_LIVES = false;
public static var PAINT_TITLE = false;
public static var SOFTKEY_SPRITE_RIGHT_X = 0;
public static var SHOW_ALL_ENEMIES = false;
public static var PAINT_HISCORE = false;
public static var MENU_FONT_SIZE = Platform.SIZE_LARGE;
public static var SFX_LOOK_A_SHEEPIE = (21 + SFX_LOAD);
public static var SFX_SHEEPIE_ZAPPER = (27 + SFX_LOAD);
public static var OPT_SFX_ON = true;
public static var BITMAP_TITLE = true;
public static var SFX_ZAP = (31 + SFX_LOAD);
public static var FACEBOOK_UPDATE_FRAME = (FPS * 8);
public static var DESTROY_ALL_KEYEVENTS = false;
public static var NUM_NAG_SCREEN_FRAMES = (FPS * 5);
public static var PAINT_BORDER = false;
public static var SFX_OOOH = (14 + SFX_LOAD);
public static var DRAW_OUTLINE_SHIP = true;
public static var NUM_LOAD_STAGES = 368;
public static var OX1 = 124;
public static var OX2 = 140;
public static var OX3 = (SCREEN_WIDTH - 10);
public static var MUSIC_FORMAT = Platform.MIDI;
public static var SCREEN_OPTIONS_MENU = 6;
public static var HELP_FONT_SHADOWS = true;
public static var NUM_HELP_PAGES = 1;
public static var SHOW_LEVEL = false;
public static var OPT_VIBRATE = false;
public static var GRID_START_Z = 0x1000;
public static var SCREEN_CREDITS = 7;
public static var SOFTKEY_SPRITE_OK = 0;
public static var USE_MOUSE = true;
public static var EXCLUDE_MENU_EXIT = false;
public static var HISCORE_COLOUR = 0xF0F0F0;
public static var SFX_MADREZLO = (13 + SFX_LOAD);
public static var HELP_FONT_COLOUR = 0xFFFFFF;
public static var NUM_TITLE_SCREEN_FRAMES = (FPS * 3);
public static var MOVE_DX = 12;
public static var CREDITS_FILL_COLOUR = 0;
public static var MOVE_DY = 14;
public static var SCREEN_QUIT_GAME = 5;
public static var SCREEN_PAUSE_MENU = 4;
public static var NUM_EOL_ZOOM_FRAMES = 0;
public static var SCREEN_GAME = 9;
public static var SPRITE_SCALING = false;
public static var SOFTKEY_SPRITE_LEFT_X = 0;
public static var FONT_SPRITE_HEIGHT = 7;
public static var SFX_LEVEL_UP = (17 + SFX_LOAD);
public static var USE_Y_ARRAY = false;
}
}//package
Section 37
//SampleGamePreloader (SampleGamePreloader)
package {
import com.morpheme.g5.*;
public dynamic class SampleGamePreloader extends G5Preloader {
public function SampleGamePreloader(){
super("Platform", 480, 640);
}
}
}//package
Section 38
//SPRITE (SPRITE)
package {
public class SPRITE {
public var bits:Array;
public var xSize:int;
public var ySize:int;
}
}//package
Section 39
//Text (Text)
package {
public class Text {
public static var STR_HELP_FIRST = 21;
public static var gaszStrings:Array = ["Yes", "No", "Quit Game", "Paused", "Continue", "You Scored", "New Game", "Options", "Instructions", "Credits", "Back to Menu", "Select", "Back", "Pause", "High Scores", "Enter Hiscore", "gimme5games.com", "SFX", "Play Again", "On", "Off", "Help", "Move Blobbit using 2,4,6,8 or thumbpad", "Rescue the Blobbit Babies then head for Exit", "Avoid the Vernimb, Count Grabula and Sir Cooler!", "", "", "Credits", "Code: Mark Ripley", "GFX: Stoo Cambridge", "SFX: Mat Howlett", "www.cheeky.gr", "Ja", "Nein", "Abbrechen", "Unterbr", "Weiter", "Wiederanlauf", "Neus Spiel", "Optionen", "Hilfe", "Credits", "Verl", "Wahlen", "Zuruck", "Pause", "Highscores", "", "Musik", "SFX", "Vibration", "An", "Aus", "Hilfe", "Verschieben Sie Blobbit mit 2.4.6.8 oder Daumenauflage", "Retten Sie die Blobbit Babys vorangehen dann fur Ausgang", "Vermeiden Sie das Vernimb, Count Grabula und Sir Cooler!", "", "", "Credits", "Code: Mark Ripley", "GFX: Stoo Cambridge", "SFX: Mat Howlett", "www.cheeky.gr", "Si", "No", "Abandonar", "Pausa", "Continuar", "Relanzar", "Neuva Partida", "Opciones", "Ayuda", "Creditos", "Salir", "Selec", "Atras", "Pausa", "Mejores Puntos", "", "Musica", "Sonido", "Vibracion", "Activar", "Desactiv", "Ayuda", "Mueva Blobbit usando 2.4.6.8 o el cojin del pulgar", "Rescate a bebes de Blobbit entonces dirigen hacia salida", "Evite el Vernimb, Count Grabula y Sir Cooler!", "", "", "Creditos", "Code: Mark Ripley", "GFX: Stoo Cambridge", "SFX: Mat Howlett", "www.cheeky.gr", "Oui", "Non", "Quitter Partie", "Pause", "Continuer", "Relancement", "Nouvelle Partie", "Options", "Aide", "Credits", "Quitter", "Select", "Retour", "Pause", "Meilleurs Scores", "", "Musique", "SFX", "Vibration", "On", "Off", "Aide", "Deplacez Blobbit en utilisant 2.4.6.8 ou garniture de pouce", "Sauvez les bebes de Blobbit se dirigent alors pour la sortie", "Evitez le Vernimb, Count Grabula et Sir Cooler!", "", "", "Credits", "Code: Mark Ripley", "GFX: Stoo Cambridge", "SFX: Mat Howlett", "www.cheeky.gr", "Si", "No", "Esci dal Gioco", "In Pausa", "Continua", "Riavviamento", "Nuova Partita", "Opzioni", "Guida", "Ringraz", "Esci", "Seleziona", "Indietro", "Pausa", "Punteggi Alti", "", "Musica", "SFX", "Vibra", "On", "Off", "Guida", "Sposti Blobbit usando 2.4.6.8 o il rilievo del pollice", "Salvi i bambini di Blobbit allora dirigono per l'uscita", "Eviti il Vernimb, Count Grabula e Sir Cooler!", "", "", "Ringraz", "Code: Mark Ripley", "GFX: Stoo Cambridge", "SFX: Mat Howlett", "www.cheeky.gr", "Ja", "Nee", "Spel Verlaten", "Pauze", "Doorspelen", "Doe Over", "Niew Spel", "Opties", "Help", "Credits", "Verlaten", "Selecteren", "Terug", "Pauze", "Hoogste Punten", "", "Muziek", "SFX", "Trilfunctie", "Aan", "Uit", "Help", "Beweging Blobbit 2.4.6.8 gebruiken of duimstootkussen die", "Red de Babys Blobbit dan leiden voor Uitgang", "Vermijd Vernimb, Count Grabula en de Sir Cooler!", "", "", "Credits", "Code: Mark Ripley", "GFX: Stoo Cambridge", "SFX: Mat Howlett", "www.cheeky.gr", "Sim", "Nao", "Sair do Jogo", "Em Pausa", "Continuar", "Reinicio", "Novo Jogo", "Opcoes", "Ajuda", "Creditos", "Sair", "Seleccionar", "Voltar", "Pausa", "Melhores Pontos", "", "Musica", "SFX", "Vibrar", "Activ", "Desactiv", "Ajuda", "Mova Blobbit usando 2.4.6.8 ou almofada do polegar", "Salve os bebes de Blobbit dirigem entao para a saida", "Evite o Vernimb, Count Grabula e Sir Cooler!", "", "", "Creditos", "Code: Mark Ripley", "GFX: Stoo Cambridge", "SFX: Mat Howlett", "www.cheeky.gr"];
public static var STR_ON = 19;
public static var STR_EXIT = 10;
public static var STR_CONTINUE = 4;
public static var STR_YES = 0;
public static var NUM_STRS = 32;
public static var STR_PAUSED = 3;
public static var STR_VIBRATE = 18;
public static var STR_NO = 1;
public static var STR_BACKUP = 12;
public static var STR_HIGHSCORES = 14;
public static var STR_HELP = 8;
public static var STR_PAUSE = 13;
public static var LOCALES:Array = ["en", "de", "es", "fr", "it", "nl", "pt"];
public static var STR_START_GAME = 6;
public static var STR_SFX = 17;
public static var STR_OFF = 20;
public static var STR_LANGUAGE = 15;
public static var NUM_CREDITS_LINES = 5;
public static var STR_VISIT_SITE = 16;
public static var STR_OPTIONS = 7;
public static var STR_CREDITS = 9;
public static var STR_YOUR_SCORE = 5;
public static var STR_MUSIC = 16;
public static var gaszLocales:Array = ["English", "Deutsch", "Espanol", "Francais", "Italiano", "Nederlands", "Portugues"];
public static var NUM_HELP_LINES = 6;
public static var STR_ENTER_HISCORE = 15;
public static var STR_QUIT_CURR_GAME = 2;
public static var STR_PLAY_AGAIN = 18;
public static var STR_CREDITS_FIRST = 27;
public static var STR_RESTART_LEVEL = 5;
public static var NUM_LOCALES = 7;
public static var STR_SELECT = 11;
public static var STR_GAME_MENU_FIRST = 6;
public static var STR_SAVENAME:String = "Gridrunner";
public static var STR_OPTIONS_MENU_FIRST = 15;
}
}//package
Section 40
//Thingie (Thingie)
package {
public class Thingie {
var xv1:int;
var trail_it:Array;// = null
var drawMode:int;
var RanSeed:int;
var SourceXSize:int;
var GeomYInc:int;
var expNum:int;
var GeomXOffset:int;
var prev:int;
var pointer:Array;
var timer:int;
var uid:int;
var animMode:int;
var animData:Array;
var sep:int;
var ExplosionTime:int;
var Flags:int;
var GeomXStep:int;
var shield:int;
var zv1:int;
var zv2:int;
var trail_p:int;
var GeomYOffset:int;
var colourindex:int;
var flags:int;
var SourceXOffset:int;
var shieldhit:int;
var chunkX:int;
var chunkY:int;
var timer2:int;
var SourceYSize:int;
var spritenum:int;
var mode:int;
var RandXMag:int;
var invisible:int;
var spritenum2:int;
var yv1:int;
var yv2:int;
var SourceYOffset:int;
var x1:int;
var x2:int;
var counter2:int;
var GeomXInc:int;
var counter1:int;
var ExplosionType:int;
var y1:int;
var y2:int;
var gen1:int;
var gen2:int;
var gen3:int;
var gen4:int;
var GeomYStep:int;
var mode2:int;
var xv2:int;
var icgen:int;
var z1:int;
var fireMode:int;
var next:int;
var RandYMag:int;
public function Thingie(){
var _local1:int;
animData = new Array(6);
super();
if (Prefs.PRE_ALLOC_TRAIL){
trail_it = new Array(Prefs.TRAIL_LEN);
_local1 = 0;
while (_local1 < Prefs.TRAIL_LEN) {
trail_it[_local1] = new PART();
_local1++;
};
};
}
public function checkTrail():void{
var _local1:int;
if (trail_it == null){
trail_it = new Array(Prefs.TRAIL_LEN);
_local1 = 0;
while (_local1 < Prefs.TRAIL_LEN) {
trail_it[_local1] = new PART();
_local1++;
};
};
}
}
}//package