STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228016
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2560 · P5119

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/71179084?noj=FRM71179084-18DC" width="1" height="1"></div>

Mechanics.swf

This is the info page for
Flash #248112

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS3]
Section 1
//KeyPoll (bigroom.input.KeyPoll) package bigroom.input { import flash.events.*; import flash.display.*; import flash.utils.*; public class KeyPoll { private var states:ByteArray; public var press:Boolean;// = false public var click:Boolean;// = false public var onscreen:Boolean;// = true public var hasclicked:Boolean;// = false private var dispObj:DisplayObject; public function KeyPoll(obj:DisplayObject){ super(); states = new ByteArray(); states.writeUnsignedInt(0); states.writeUnsignedInt(0); states.writeUnsignedInt(0); states.writeUnsignedInt(0); states.writeUnsignedInt(0); states.writeUnsignedInt(0); states.writeUnsignedInt(0); states.writeUnsignedInt(0); dispObj = obj; dispObj.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener, false, 0, true); dispObj.addEventListener(KeyboardEvent.KEY_UP, keyUpListener, false, 0, true); dispObj.addEventListener(Event.ACTIVATE, activateListener, false, 0, true); dispObj.addEventListener(Event.DEACTIVATE, deactivateListener, false, 0, true); dispObj.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownListener); dispObj.addEventListener(MouseEvent.MOUSE_UP, mouseUpListener); dispObj.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler); dispObj.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler); } public function mouseOutHandler(e:MouseEvent):void{ onscreen = false; } public function isUp(keyCode:uint):Boolean{ return (((states[(keyCode >>> 3)] & (1 << (keyCode & 7))) == 0)); } private function activateListener(ev:Event):void{ var i:int; while (i < 8) { states[i] = 0; i++; }; } public function isDown(keyCode:uint):Boolean{ return (!(((states[(keyCode >>> 3)] & (1 << (keyCode & 7))) == 0))); } private function keyUpListener(ev:KeyboardEvent):void{ states[(ev.keyCode >>> 3)] = (states[(ev.keyCode >>> 3)] & ~((1 << (ev.keyCode & 7)))); } private function deactivateListener(ev:Event):void{ var i:int; while (i < 8) { states[i] = 0; i++; }; } public function mouseOverHandler(e:MouseEvent):void{ onscreen = true; } public function mouseUpListener(e:MouseEvent):void{ press = false; click = false; hasclicked = false; } public function mouseDownListener(e:MouseEvent):void{ press = true; click = true; hasclicked = true; } private function keyDownListener(ev:KeyboardEvent):void{ states[(ev.keyCode >>> 3)] = (states[(ev.keyCode >>> 3)] | (1 << (ev.keyCode & 7))); } } }//package bigroom.input
Section 2
//BitmapAsset (mx.core.BitmapAsset) package mx.core { import flash.display.*; public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject { mx_internal static const VERSION:String = "3.4.0.6955"; public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){ super(bitmapData, pixelSnapping, smoothing); } public function get measuredWidth():Number{ if (bitmapData){ return (bitmapData.width); }; return (0); } public function get measuredHeight():Number{ if (bitmapData){ return (bitmapData.height); }; return (0); } public function setActualSize(newWidth:Number, newHeight:Number):void{ width = newWidth; height = newHeight; } public function move(x:Number, y:Number):void{ this.x = x; this.y = y; } } }//package mx.core
Section 3
//FlexBitmap (mx.core.FlexBitmap) package mx.core { import flash.display.*; import mx.utils.*; public class FlexBitmap extends Bitmap { mx_internal static const VERSION:String = "3.4.0.6955"; public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){ var bitmapData = bitmapData; var pixelSnapping = pixelSnapping; var smoothing = smoothing; super(bitmapData, pixelSnapping, smoothing); name = NameUtil.createUniqueName(this); //unresolved jump var _slot1 = e; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 4
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 5
//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(void:Point):Point; function get name():String; function set width(flash.display:Number):void; function get measuredHeight():Number; function get blendMode():String; function get scale9Grid():Rectangle; function set name(flash.display:String):void; function set scaleX(flash.display:Number):void; function set scaleY(flash.display:Number):void; function get measuredWidth():Number; function get accessibilityProperties():AccessibilityProperties; function set scrollRect(flash.display:Rectangle):void; function get cacheAsBitmap():Boolean; function globalToLocal(void:Point):Point; function get height():Number; function set blendMode(flash.display:String):void; function get parent():DisplayObjectContainer; function getBounds(String:DisplayObject):Rectangle; function get opaqueBackground():Object; function set scale9Grid(flash.display:Rectangle):void; function setActualSize(_arg1:Number, _arg2:Number):void; function set alpha(flash.display:Number):void; function set accessibilityProperties(flash.display:AccessibilityProperties):void; function get width():Number; function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean; function set cacheAsBitmap(flash.display: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(flash.display:Number):void; function set mask(flash.display:DisplayObject):void; function getRect(String:DisplayObject):Rectangle; function get alpha():Number; function set transform(flash.display:Transform):void; function move(_arg1:Number, _arg2:Number):void; function get loaderInfo():LoaderInfo; function get root():DisplayObject; function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean; function set opaqueBackground(flash.display:Object):void; function set visible(flash.display:Boolean):void; function get mask():DisplayObject; function set x(flash.display:Number):void; function set y(flash.display:Number):void; function get transform():Transform; function set filters(flash.display:Array):void; function get x():Number; function get y():Number; function get filters():Array; function set rotation(flash.display:Number):void; function get stage():Stage; } }//package mx.core
Section 6
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(C:\autobuild\3.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get isDocument():Boolean; function set repeaters(C:\autobuild\3.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function initializeRepeaterArrays(C:\autobuild\3.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(C:\autobuild\3.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 7
//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 8
//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.4.0.6955"; private static var counter:int = 0; public function NameUtil(){ super(); } public static function displayObjectToString(displayObject:DisplayObject):String{ var result:String; var o:DisplayObject; var s:String; var indices:Array; var displayObject = displayObject; o = displayObject; while (o != null) { if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){ break; }; s = o.name; if ((o is IRepeaterClient)){ indices = IRepeaterClient(o).instanceIndices; if (indices){ s = (s + (("[" + indices.join("][")) + "]")); }; }; result = ((result == null)) ? s : ((s + ".") + result); o = o.parent; }; //unresolved jump var _slot1 = e; return (result); } public static function createUniqueName(object:Object):String{ if (!object){ return (null); }; var name:String = getQualifiedClassName(object); var index:int = name.indexOf("::"); if (index != -1){ name = name.substr((index + 2)); }; var charCode:int = name.charCodeAt((name.length - 1)); if ((((charCode >= 48)) && ((charCode <= 57)))){ name = (name + "_"); }; return ((name + counter++)); } } }//package mx.utils
Section 9
//blockclass (blockclass) package { import flash.display.*; import flash.geom.*; public class blockclass extends Sprite { public var hp:int; public var rect:Rectangle; public var active:Boolean; public var yp:int; public var xp:int; public var wp:int; public var type:int; public var trigger:int; public function blockclass():void{ super(); rect = new Rectangle(); clear(); } public function clear():void{ active = false; type = 0; trigger = 0; xp = 0; yp = 0; wp = 0; hp = 0; rect.x = xp; rect.y = yp; rect.width = wp; rect.height = hp; } public function rectset(xi:int, yi:int, wi:int, hi:int):void{ rect.x = xi; rect.y = yi; rect.width = wi; rect.height = hi; } } }//package
Section 10
//dwgraphicsclass (dwgraphicsclass) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.net.*; public class dwgraphicsclass extends Sprite { public var i:int; public var j:int; public var temptile:BitmapData; public var backgrounds:Array; public var alphamult:uint; public var bfontpos:int; public var tiles:Array; public var bfontmask:Array; public var tempsprite:BitmapData; public var footerrect:Rectangle; public var tpoint:Point; public var screenbuffer:BitmapData; public var bfont:Array; public var sprites_rect:Rectangle; public var bg_rect:Rectangle; public var updatebackground:Boolean; public var bfont_rect:Rectangle; public var cur:int; public var bfontlen:Array; public var bfontmask_rect:Rectangle; public var stemp:String; public var images_rect:Rectangle; public var sprites:Array; public var buffer:BitmapData; public var temp:int; public var temp3:int; public var tiles_rect:Rectangle; public var backbuffer:BitmapData; public var screen:Bitmap; public var temp2:int; public var ct:ColorTransform; public var images:Array; public var tl:Point; public function dwgraphicsclass(){ backgrounds = new Array(); images = new Array(); tiles = new Array(); sprites = new Array(); bfont = new Array(); bfontmask = new Array(); bfontlen = new Array(); super(); } public function makebfont():void{ var maprow:Array; var i:Number; var t:BitmapData; var temprect:Rectangle; var j:Number = 0; while (j < 16) { i = 0; while (i < 16) { t = new BitmapData(8, 8, true, 0); temprect = new Rectangle((i * 8), (j * 8), 8, 8); t.copyPixels(buffer, temprect, tl); bfont.push(t); i++; }; j++; }; i = 0; while (i < 0x0100) { bfontlen.push(6); i++; }; var tstring:String = "4,3,5,7,6,7,6,3,4,4,7,7,3,5,2,5,6,5,6,6,6,6,6,6,6,6,2,3,5,5,5,6,7,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,4,5,4,5,6,4,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,5,3,5,6,4"; maprow = new Array(); maprow = tstring.split(","); var k:int; while (k < 96) { bfontlen[(k + 32)] = 8; k++; }; } public function drawentities(obj:entityclass, help:helpclass):void{ var j:int; var k:int; var i:int; while (i < obj.nentity) { if (((!(obj.entities[i].invis)) && (obj.entities[i].active))){ if (obj.entities[i].size == 0){ tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; setcol(obj.entities[i].colour, help); sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct); backbuffer.copyPixels(sprites[obj.entities[i].drawframe], sprites_rect, tpoint); } else { if (obj.entities[i].size == 1){ tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); } else { if (obj.entities[i].size == 2){ tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp; backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); tpoint.x = (tpoint.x + 8); backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); tpoint.x = (tpoint.x + 8); backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); tpoint.x = (tpoint.x + 8); backbuffer.copyPixels(tiles[obj.entities[i].drawframe], tiles_rect, tpoint); }; }; }; }; i++; }; } public function makespritearray():void{ var i:Number; var t:BitmapData; var temprect:Rectangle; var j:Number = 0; while (j < 8) { i = 0; while (i < 10) { t = new BitmapData(32, 32, true, 0); temprect = new Rectangle((i * 32), (j * 32), 32, 32); t.copyPixels(buffer, temprect, tl); sprites.push(t); i++; }; j++; }; } public function bprint(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean=false):void{ printmask(x, y, t, cen); print(x, y, t, r, g, b, cen); } public function bprinttemptile(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean=false):void{ printmasktemptile(x, y, t, cen); printtemptile(x, y, t, r, g, b, cen); } public function addbackground():void{ var t:BitmapData = new BitmapData(160, 144, true, 0); t.copyPixels(buffer, bg_rect, tl); backgrounds.push(t); } public function init():void{ updatebackground = true; tiles_rect = new Rectangle(0, 0, 8, 8); sprites_rect = new Rectangle(0, 0, 32, 32); bfont_rect = new Rectangle(0, 0, 8, 8); bfontmask_rect = new Rectangle(0, 0, 9, 9); bg_rect = new Rectangle(0, 0, 320, 240); footerrect = new Rectangle(0, 230, 320, 10); tl = new Point(0, 0); tpoint = new Point(0, 0); ct = new ColorTransform(0, 0, 0, 1, 0xFF, 0xFF, 0xFF, 1); backbuffer = new BitmapData(320, 240, false, 0); screenbuffer = new BitmapData(320, 240, false, 0); temptile = new BitmapData(8, 8, false, 0); tempsprite = new BitmapData(32, 32, false, 0); screen = new Bitmap(screenbuffer); screen.width = 640; screen.height = 480; addChild(screen); } public function len(t:String):int{ bfontpos = 0; var i:int; while (i < t.length) { cur = t.charCodeAt(i); bfontpos = (bfontpos + bfontlen[cur]); i++; }; return (bfontpos); } public function render():void{ screenbuffer.lock(); screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false); screenbuffer.unlock(); backbuffer.lock(); backbuffer.fillRect(backbuffer.rect, 0); backbuffer.unlock(); } public function drawimage(t:int, xp:int, yp:int, cent:Boolean=false):void{ if (cent){ backbuffer.copyPixels(images[t], new Rectangle(0, 0, images[t].width, images[t].height), new Point((80 - int((images[t].width / 2))), yp)); } else { backbuffer.copyPixels(images[t], new Rectangle(0, 0, images[t].width, images[t].height), new Point(xp, yp)); }; } public function drawmap(map:mapclass):void{ j = 0; while (j < 30) { i = 0; while (i < 40) { drawtile((i * 8), (j * 8), map.contents[(i + map.vmult[j])]); i++; }; j++; }; } public function printmask(x:int, y:int, t:String, cen:Boolean=false):void{ if (cen){ x = (160 - (len(t) / 2)); }; bfontpos = 0; var i:int; while (i < t.length) { cur = t.charCodeAt(i); backbuffer.copyPixels(bfontmask[cur], bfont_rect, new Point(((x + bfontpos) - 1), y)); bfontpos = (bfontpos + bfontlen[cur]); i++; }; } public function screenshake():void{ screenbuffer.lock(); screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false); screenbuffer.copyPixels(backbuffer, backbuffer.rect, new Point(((Math.random() * 5) - 3), ((Math.random() * 5) - 3)), null, null, false); screenbuffer.unlock(); backbuffer.lock(); backbuffer.fillRect(backbuffer.rect, 0); backbuffer.unlock(); } public function printmasktemptile(x:int, y:int, t:String, cen:Boolean=false):void{ if (cen){ x = (160 - (len(t) / 2)); }; bfontpos = 0; var i:int; while (i < t.length) { cur = t.charCodeAt(i); temptile.copyPixels(bfontmask[cur], bfont_rect, new Point(((x + bfontpos) - 1), y)); bfontpos = (bfontpos + bfontlen[cur]); i++; }; } public function flashlight():void{ backbuffer.fillRect(backbuffer.rect, 9383213); } public function RGB(red:Number, green:Number, blue:Number):Number{ return (((blue | (green << 8)) | (red << 16))); } public function printtemptile(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean=false):void{ if (r < 0){ r = 0; }; if (g < 0){ g = 0; }; if (b < 0){ b = 0; }; if (r > 0xFF){ r = 0xFF; }; if (g > 0xFF){ g = 0xFF; }; if (b > 0xFF){ b = 0xFF; }; ct.color = RGB(r, g, b); if (cen){ x = (160 - (len(t) / 2)); }; bfontpos = 0; var i:int; while (i < t.length) { cur = t.charCodeAt(i); bfont[cur].colorTransform(bfont_rect, ct); temptile.copyPixels(bfont[cur], bfont_rect, new Point((x + bfontpos), y)); bfontpos = (bfontpos + bfontlen[cur]); i++; }; } public function drawbuffertile(x:int, y:int, t:int):void{ buffer.copyPixels(tiles[t], tiles_rect, new Point(x, y)); } public function print(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean=false):void{ if (r < 0){ r = 0; }; if (g < 0){ g = 0; }; if (b < 0){ b = 0; }; if (r > 0xFF){ r = 0xFF; }; if (g > 0xFF){ g = 0xFF; }; if (b > 0xFF){ b = 0xFF; }; ct.color = RGB(r, g, b); if (cen){ x = (160 - (len(t) / 2)); }; bfontpos = 0; var i:int; while (i < t.length) { cur = t.charCodeAt(i); bfont[cur].colorTransform(bfont_rect, ct); backbuffer.copyPixels(bfont[cur], bfont_rect, new Point((x + bfontpos), y)); bfontpos = (bfontpos + bfontlen[cur]); i++; }; } public function maketilearray():void{ var i:Number; var t:BitmapData; var temprect:Rectangle; var j:Number = 0; while (j < 30) { i = 0; while (i < 40) { t = new BitmapData(8, 8, true, 0); temprect = new Rectangle((i * 8), (j * 8), 8, 8); t.copyPixels(buffer, temprect, tl); tiles.push(t); i++; }; j++; }; } public function addimage():void{ var t:BitmapData = new BitmapData(buffer.width, buffer.height, true, 0); t.copyPixels(buffer, new Rectangle(0, 0, buffer.width, buffer.height), tl); images.push(t); } public function setcol(t:int, help:helpclass):void{ switch (t){ case 0: ct.color = RGB(32, 164, (196 - help.glow)); break; case 1: ct.color = RGB((0xFF - help.glow), 32, 32); break; case 2: ct.color = RGB((220 - help.glow), 40, 100); break; default: ct.color = 0xFFFFFF; break; }; } public function makebfontmask():void{ var i:Number; var t:BitmapData; var temprect:Rectangle; var j:Number = 0; while (j < 16) { i = 0; while (i < 16) { t = new BitmapData(9, 9, true, 0); temprect = new Rectangle((i * 9), (j * 9), 9, 9); t.copyPixels(buffer, temprect, tl); bfontmask.push(t); i++; }; j++; }; } public function drawtile(x:int, y:int, t:int):void{ backbuffer.copyPixels(tiles[t], tiles_rect, new Point(x, y)); } public function drawbackground(t:int):void{ backbuffer.copyPixels(backgrounds[t], bg_rect, tl); } } }//package
Section 11
//entclass (entclass) package { import flash.display.*; public class entclass extends Sprite { public var size:int; public var rule:int; public var active:Boolean; public var onentity:Boolean; public var jumpframe:int; public var state:int; public var statedelay:int; public var walkingframe:int; public var jumping:Boolean; public var yp:Number; public var isplatform:Boolean; public var newxp:Number; public var harmful:Boolean; public var onwall:int; public var behave:int; public var onground:Boolean; public var tile:int; public var dir:int; public var ax:Number; public var ay:Number; public var x1:int; public var type:int; public var framedelay:int; public var newyp:Number; public var vy:Number; public var onywall:int; public var vx:Number; public var onxwall:int; public var onroof:Boolean; public var colour:int; public var gravity:Boolean; public var x2:int; public var y1:int; public var y2:int; public var invis:Boolean; public var para:int; public var animate:int; public var drawframe:int; public var h:int; public var cx:int; public var cy:int; public var xp:Number; public var life:int; public var w:int; public function entclass():void{ super(); clear(); } public function outside():Boolean{ if (xp < x1){ xp = x1; return (true); }; if (yp < y1){ yp = y1; return (true); }; if ((xp + w) > x2){ xp = (x2 - w); return (true); }; if ((yp + h) > y2){ yp = (y2 - h); return (true); }; return (false); } public function clear():void{ active = false; invis = false; type = 0; size = 0; tile = 0; rule = 0; state = 0; statedelay = 0; life = 0; colour = 0; para = 0; behave = 0; animate = 0; xp = 0; yp = 0; ax = 0; ay = 0; vx = 0; vy = 0; w = 16; h = 16; cx = 0; cy = 0; newxp = 0; newyp = 0; x1 = 0; y1 = 0; x2 = 320; y2 = 240; jumping = false; gravity = false; onground = true; onroof = true; jumpframe = 0; onentity = false; harmful = false; onwall = 0; onxwall = 0; onywall = 0; isplatform = false; framedelay = 0; drawframe = 0; walkingframe = 0; dir = 0; } } }//package
Section 12
//entityclass (entityclass) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.net.*; public class entityclass extends Sprite { public var blocks:Array; public var z:int; public var temph:int; public var dy:int; public var nblocks:int; public var dx:int; public var dr:int; public var tempw:int; public var tempy:int; public var tempx:int; public var tpx1:int; public var tpx2:int; public var temprect:Rectangle; public var skipdirblocks:Boolean; public var skipblocks:Boolean; public var entities:Array; public var nentity:int; public var tpy2:int; public var temp:int; public var temp2:int; public var i:int; public var tpy1:int; public var j:int; public var temprect2:Rectangle; public static var DIRECTIONAL:Number = 3; public static var TRIGGER:Number = 1; public static var SAFE:Number = 4; public static var BLOCK:Number = 0; public static var DAMAGE:Number = 2; public function entityclass(){ entities = new Array(); blocks = new Array(); super(); } public function removeblock(t:int):void{ blocks[t].clear(); i = (nblocks - 1); while ((((i >= 0)) && (!(blocks[i].active)))) { nblocks--; i--; }; } public function updateentities(i:int, help:helpclass, game:gameclass, music:musicclass):Boolean{ if (entities[i].active){ if (entities[i].statedelay <= 0){ switch (entities[i].type){ case 0: if (entities[i].state == 0){ }; break; case 1: switch (entities[i].behave){ case 0: if (entities[i].state == 0){ entities[i].state = 3; updateentities(i, help, game, music); } else { if (entities[i].state == 1){ if (entities[i].outside()){ entities[i].state = entities[i].onwall; }; } else { if (entities[i].state == 2){ entities[i].vy = -(entities[i].para); entities[i].onwall = 3; entities[i].state = 1; } else { if (entities[i].state == 3){ entities[i].vy = entities[i].para; entities[i].onwall = 2; entities[i].state = 1; }; }; }; }; break; case 1: if (entities[i].state == 0){ entities[i].state = 2; updateentities(i, help, game, music); } else { if (entities[i].state == 1){ if (entities[i].outside()){ entities[i].state = entities[i].onwall; }; } else { if (entities[i].state == 2){ entities[i].vy = -(entities[i].para); entities[i].onwall = 3; entities[i].state = 1; } else { if (entities[i].state == 3){ entities[i].vy = entities[i].para; entities[i].onwall = 2; entities[i].state = 1; }; }; }; }; break; case 2: if (entities[i].state == 0){ entities[i].state = 3; updateentities(i, help, game, music); } else { if (entities[i].state == 1){ if (entities[i].outside()){ entities[i].state = entities[i].onwall; }; } else { if (entities[i].state == 2){ entities[i].vx = -(entities[i].para); entities[i].onwall = 3; entities[i].state = 1; } else { if (entities[i].state == 3){ entities[i].vx = entities[i].para; entities[i].onwall = 2; entities[i].state = 1; }; }; }; }; break; case 3: if (entities[i].state == 0){ entities[i].state = 3; updateentities(i, help, game, music); } else { if (entities[i].state == 1){ if (entities[i].outside()){ entities[i].state = entities[i].onwall; }; } else { if (entities[i].state == 2){ entities[i].vx = -(entities[i].para); entities[i].onwall = 3; entities[i].state = 1; } else { if (entities[i].state == 3){ entities[i].vx = entities[i].para; entities[i].onwall = 2; entities[i].state = 1; }; }; }; }; break; }; break; case 2: if (entities[i].state == 1){ entities[i].life = 12; entities[i].state = 2; entities[i].onentity = 0; } else { if (entities[i].state == 2){ entities[i].life--; if ((entities[i].life % 3) == 0){ entities[i].tile++; }; if (entities[i].life <= 0){ removeblockat(entities[i].xp, entities[i].yp); entities[i].active = false; }; }; }; break; case 3: if (entities[i].state == 1){ j = getplayer(); if ((((entities[j].vy > 1)) && (((entities[j].yp + entities[j].h) <= (entities[i].yp + 2))))){ entities[i].life = 4; entities[i].state = 2; entities[i].onentity = 0; } else { if ((((entities[j].vy < -1)) && ((entities[j].yp >= (entities[i].yp + 4))))){ entities[i].life = 4; entities[i].state = 2; entities[i].onentity = 0; } else { entities[i].state = 0; }; }; } else { if (entities[i].state == 2){ entities[i].life--; entities[i].tile++; if (entities[i].life <= 0){ removeblockat(entities[i].xp, entities[i].yp); entities[i].active = false; }; }; }; break; case 4: if (entities[i].state == 1){ entities[i].active = false; game.gravitycontrol = ((game.gravitycontrol + 1) % 2); }; break; }; } else { entities[i].statedelay--; if (entities[i].statedelay < 0){ entities[i].statedelay = 0; }; }; }; return (true); } public function checkblocks():Boolean{ i = 0; while (i < nblocks) { if (blocks[i].active){ if (!skipdirblocks){ if (blocks[i].type == DIRECTIONAL){ if ((((dy > 0)) && ((blocks[i].trigger == 0)))){ if (blocks[i].rect.intersects(temprect)){ return (true); }; }; if ((((dy <= 0)) && ((blocks[i].trigger == 1)))){ if (blocks[i].rect.intersects(temprect)){ return (true); }; }; if ((((dx > 0)) && ((blocks[i].trigger == 2)))){ if (blocks[i].rect.intersects(temprect)){ return (true); }; }; if ((((dx <= 0)) && ((blocks[i].trigger == 3)))){ if (blocks[i].rect.intersects(temprect)){ return (true); }; }; }; }; if (blocks[i].type == BLOCK){ if (blocks[i].rect.intersects(temprect)){ return (true); }; }; if (blocks[i].type == SAFE){ if (dr == 1){ if (blocks[i].rect.intersects(temprect)){ return (true); }; }; }; }; i++; }; return (false); } public function init():void{ var entity:entclass; var block:blockclass; nentity = 0; nblocks = 0; temprect = new Rectangle(); temprect2 = new Rectangle(); skipdirblocks = false; var z:Number = 0; while (z < 200) { entity = new entclass(); entities.push(entity); block = new blockclass(); blocks.push(block); z++; }; } public function createblock(t:int, xp:int=0, yp:int=0, w:int=0, h:int=0, trig:int=0):void{ if (nblocks == 0){ z = 0; nblocks++; } else { i = 0; z = -1; while (i < nblocks) { if (!blocks[i].active){ z = i; i = nblocks; }; i++; }; if (z == -1){ z = nblocks; nblocks++; }; }; blocks[z].clear(); blocks[z].active = true; switch (t){ case BLOCK: blocks[z].type = BLOCK; blocks[z].xp = xp; blocks[z].yp = yp; blocks[z].wp = w; blocks[z].hp = h; blocks[z].rectset(xp, yp, w, h); nblocks++; break; case TRIGGER: blocks[z].type = TRIGGER; blocks[z].x = xp; blocks[z].y = yp; blocks[z].wp = w; blocks[z].hp = h; blocks[z].rectset(xp, yp, w, h); blocks[z].trigger = trig; nblocks++; break; case DAMAGE: blocks[z].type = DAMAGE; blocks[z].x = xp; blocks[z].y = yp; blocks[z].wp = w; blocks[z].hp = h; blocks[z].rectset(xp, yp, w, h); nblocks++; break; case DIRECTIONAL: blocks[z].type = DIRECTIONAL; blocks[z].x = xp; blocks[z].y = yp; blocks[z].wp = w; blocks[z].hp = h; blocks[z].rectset(xp, yp, w, h); blocks[z].trigger = trig; nblocks++; break; case SAFE: blocks[z].type = SAFE; blocks[z].xp = xp; blocks[z].yp = yp; blocks[z].wp = w; blocks[z].hp = h; blocks[z].rectset(xp, yp, w, h); nblocks++; break; }; } public function gettype(t:int):Boolean{ var i:int; while (i < nentity) { if (entities[i].type == t){ return (true); }; i++; }; return (false); } public function cleanup():void{ i = (nentity - 1); while ((((i >= 0)) && (!(entities[i].active)))) { nentity--; i--; }; } public function animateentities(i:int, help:helpclass):void{ if (entities[i].active){ if (entities[i].statedelay <= 0){ switch (entities[i].type){ default: entities[i].drawframe = entities[i].tile; break; }; } else { entities[i].statedelay--; if (entities[i].statedelay < 0){ entities[i].statedelay = 0; }; }; }; } public function cblocks(t:int):Boolean{ tempx = (entities[t].xp + entities[t].cx); tempy = (entities[t].yp + entities[t].cy); tempw = entities[t].w; temph = entities[t].h; rectset(tempx, tempy, tempw, temph); return (checkblocks()); } public function removetrigger(t:int):void{ i = 0; while (i < nblocks) { if (blocks[i].type == TRIGGER){ if (blocks[i].trigger == t){ removeblock(i); }; }; i++; }; } public function getplayer():int{ var i:int; while (i < nentity) { if (entities[i].type == 0){ return (i); }; i++; }; return (-1); } public function checktrigger():int{ i = 0; while (i < nentity) { if (entities[i].rule == 0){ tempx = (entities[i].xp + entities[i].cx); tempy = (entities[i].yp + entities[i].cy); tempw = entities[i].w; temph = entities[i].h; rectset(tempx, tempy, tempw, temph); j = 0; while (j < nblocks) { if (blocks[j].type == TRIGGER){ if (blocks[j].rect.intersects(temprect)){ return (blocks[j].trigger); }; }; j++; }; }; i++; }; return (-1); } public function testwallsx(t:int, map:mapclass, tx:int, ty:int):Boolean{ tempx = (tx + entities[t].cx); tempy = (ty + entities[t].cy); tempw = entities[t].w; temph = entities[t].h; rectset(tempx, tempy, tempw, temph); if (entities[t].rule < 2){ skipblocks = true; } else { skipblocks = false; }; dx = 0; dy = 0; if (entities[t].rule == 0){ dx = entities[t].vx; }; dr = entities[t].rule; if (checkwall(map)){ if (entities[t].vx > 1){ entities[t].vx--; entities[t].newxp = int((entities[t].xp + entities[t].vx)); return (testwallsx(t, map, entities[t].newxp, entities[t].yp)); }; if (entities[t].vx < -1){ entities[t].vx++; entities[t].newxp = int((entities[t].xp + entities[t].vx)); return (testwallsx(t, map, entities[t].newxp, entities[t].yp)); }; entities[t].vx = 0; return (false); }; return (true); } public function testwallsy(t:int, map:mapclass, tx:int, ty:int):Boolean{ tempx = (tx + entities[t].cx); tempy = (ty + entities[t].cy); tempw = entities[t].w; temph = entities[t].h; rectset(tempx, tempy, tempw, temph); if (entities[t].rule < 2){ skipblocks = true; } else { skipblocks = false; }; dx = 0; dy = 0; if (entities[t].rule == 0){ dy = entities[t].vy; }; dr = entities[t].rule; if (checkwall(map)){ if (entities[t].vy > 1){ entities[t].vy--; entities[t].newyp = int((entities[t].yp + entities[t].vy)); return (testwallsy(t, map, entities[t].xp, entities[t].newyp)); }; if (entities[t].vy < -1){ entities[t].vy++; entities[t].newyp = int((entities[t].yp + entities[t].vy)); return (testwallsy(t, map, entities[t].xp, entities[t].newyp)); }; entities[t].vy = 0; return (false); }; return (true); } public function entitycollideroof(map:mapclass, t:int):Boolean{ tempx = (entities[t].xp + entities[t].cx); tempy = ((entities[t].yp + entities[t].cy) - 1); tempw = entities[t].w; temph = entities[t].h; rectset(tempx, tempy, tempw, temph); if (checkwall(map)){ return (true); }; return (false); } public function checkwall(map:mapclass):Boolean{ if (skipblocks){ if (checkblocks()){ return (true); }; }; tempx = getgridpoint(temprect.x); tempy = getgridpoint(temprect.y); tempw = getgridpoint(((temprect.x + temprect.width) - 1)); temph = getgridpoint(((temprect.y + temprect.height) - 1)); if (map.collide(tempx, tempy)){ return (true); }; if (map.collide(tempw, tempy)){ return (true); }; if (map.collide(tempx, temph)){ return (true); }; if (map.collide(tempw, temph)){ return (true); }; if (temprect.height >= 12){ tpy1 = getgridpoint((temprect.y + 6)); if (map.collide(tempx, tpy1)){ return (true); }; if (map.collide(tempw, tpy1)){ return (true); }; if (temprect.height >= 18){ tpy1 = getgridpoint((temprect.y + 12)); if (map.collide(tempx, tpy1)){ return (true); }; if (map.collide(tempw, tpy1)){ return (true); }; if (temprect.height >= 24){ tpy1 = getgridpoint((temprect.y + 18)); if (map.collide(tempx, tpy1)){ return (true); }; if (map.collide(tempw, tpy1)){ return (true); }; }; }; }; if (temprect.width >= 12){ tpx1 = getgridpoint((temprect.x + 6)); if (map.collide(tpx1, tempy)){ return (true); }; if (map.collide(tpx1, temph)){ return (true); }; }; return (false); } public function rect2set(xi:int, yi:int, wi:int, hi:int):void{ temprect2.x = xi; temprect2.y = yi; temprect2.width = wi; temprect2.height = hi; } public function createentity(xp:Number, yp:Number, t:int, vx:Number=0, vy:Number=0, p1:int=0, p2:int=0, p3:int=320, p4:int=240):void{ if (nentity == 0){ z = 0; nentity++; } else { i = 0; z = -1; while (i < nentity) { if (!entities[i].active){ z = i; i = nentity; }; i++; }; if (z == -1){ z = nentity; nentity++; }; }; entities[z].clear(); entities[z].active = true; entities[z].type = t; switch (t){ case 0: entities[z].rule = 0; entities[z].tile = 0; entities[z].colour = 0; entities[z].xp = xp; entities[z].yp = yp; entities[z].w = 14; entities[z].h = 21; entities[z].gravity = true; break; case 1: entities[z].rule = 1; entities[z].tile = 10; entities[z].colour = 1; entities[z].xp = xp; entities[z].yp = yp; entities[z].w = 16; entities[z].h = 16; entities[z].behave = vx; entities[z].para = vy; entities[z].x1 = p1; entities[z].y1 = p2; entities[z].x2 = p3; entities[z].y2 = p4; entities[z].harmful = true; break; case 2: entities[z].rule = 2; entities[z].type = 1; entities[z].size = 2; entities[z].tile = 1; entities[z].xp = xp; entities[z].yp = yp; entities[z].w = 32; entities[z].h = 8; entities[z].behave = vx; entities[z].para = vy; entities[z].x1 = p1; entities[z].y1 = p2; entities[z].x2 = p3; entities[z].y2 = p4; entities[z].isplatform = true; createblock(0, xp, yp, 32, 8); break; case 3: entities[z].rule = 3; entities[z].type = 2; entities[z].size = 2; entities[z].tile = 2; entities[z].xp = xp; entities[z].yp = yp; entities[z].cy = -1; entities[z].w = 32; entities[z].h = 10; entities[z].behave = vx; entities[z].para = vy; entities[z].onentity = 1; createblock(0, xp, yp, 32, 8); break; case 4: entities[z].rule = 3; entities[z].type = 3; entities[z].size = 1; entities[z].tile = 7; entities[z].xp = xp; entities[z].yp = yp; entities[z].cy = -1; entities[z].w = 8; entities[z].h = 10; entities[z].behave = vx; entities[z].para = vy; entities[z].onentity = 1; createblock(0, xp, yp, 8, 8); break; case 5: entities[z].rule = 3; entities[z].type = 4; entities[z].size = 0; entities[z].tile = 11; entities[z].xp = xp; entities[z].yp = yp; entities[z].w = 16; entities[z].h = 16; entities[z].behave = vx; entities[z].para = vy; entities[z].onentity = 1; break; }; } public function checkdirectional(t:int):Boolean{ i = 0; while (i < nentity) { if (entities[i].rule == 0){ tempx = (entities[i].xp + entities[i].cx); tempy = (entities[i].yp + entities[i].cy); tempw = entities[i].w; temph = entities[i].h; rectset(tempx, tempy, tempw, temph); j = 0; while (j < nblocks) { if ((((blocks[j].type == DIRECTIONAL)) && (blocks[j].active))){ if (blocks[j].rect.intersects(temprect)){ return (true); }; }; j++; }; }; i++; }; return (false); } public function removeallblocks():void{ i = 0; while (i < nblocks) { blocks[i].clear(); i++; }; nblocks = 0; } public function applyfriction(t:int, xrate:Number, yrate:Number):void{ if (Math.abs(entities[t].vx) <= xrate){ entities[t].vx = 0; }; if (Math.abs(entities[t].vy) <= yrate){ entities[t].vy = 0; }; if (entities[t].vx > 0){ entities[t].vx = (entities[t].vx - xrate); }; if (entities[t].vx < 0){ entities[t].vx = (entities[t].vx + xrate); }; if (entities[t].vy > 0){ entities[t].vy = (entities[t].vy - yrate); }; if (entities[t].vy < 0){ entities[t].vy = (entities[t].vy + yrate); }; if (entities[t].vy > 10){ entities[t].vy = 10; }; if (entities[t].vy < -10){ entities[t].vy = -10; }; if (entities[t].vx > 6){ entities[t].vx = 6; }; if (entities[t].vx < -6){ entities[t].vx = -6; }; } public function entitycollidefloor(map:mapclass, t:int):Boolean{ tempx = (entities[t].xp + entities[t].cx); tempy = ((entities[t].yp + entities[t].cy) + 1); tempw = entities[t].w; temph = entities[t].h; rectset(tempx, tempy, tempw, temph); if (checkwall(map)){ return (true); }; return (false); } public function getgridpoint(t:int):int{ t = ((t - (t % 8)) / 8); return (t); } public function checkdamage():Boolean{ i = 0; while (i < nentity) { if (entities[i].rule == 0){ tempx = (entities[i].xp + entities[i].cx); tempy = (entities[i].yp + entities[i].cy); tempw = entities[i].w; temph = entities[i].h; rectset(tempx, tempy, tempw, temph); j = 0; while (j < nblocks) { if ((((blocks[j].type == DAMAGE)) && (blocks[j].active))){ if (blocks[j].rect.intersects(temprect)){ return (true); }; }; j++; }; }; i++; }; return (false); } public function entitycollide(a:int, b:int):Boolean{ tempx = (entities[a].xp + entities[a].cx); tempy = (entities[a].yp + entities[a].cy); tempw = entities[a].w; temph = entities[a].h; rectset(tempx, tempy, tempw, temph); tempx = (entities[b].xp + entities[b].cx); tempy = (entities[b].yp + entities[b].cy); tempw = entities[b].w; temph = entities[b].h; rect2set(tempx, tempy, tempw, temph); if (temprect.intersects(temprect2)){ return (true); }; return (false); } public function removeblockat(x:int, y:int):void{ i = 0; while (i < nblocks) { if ((((blocks[i].xp == int(x))) && ((blocks[i].yp == int(y))))){ removeblock(i); }; i++; }; } public function rectset(xi:int, yi:int, wi:int, hi:int):void{ temprect.x = xi; temprect.y = yi; temprect.width = wi; temprect.height = hi; } } }//package
Section 13
//gameclass (gameclass) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.net.*; public class gameclass extends Sprite { public var saverx:int; public var savery:int; public var hascontrol:Boolean; public var state:int; public var statedelay:int; public var door_down:int; public var savegc:int; public var screenshake:int; public var savex:int; public var savey:int; public var test:Boolean; public var teststring:String; public var mx:int; public var my:int; public var door_right:int; public var door_up:int; public var gravitycontrol:int; public var temp:int; public var gamestate:int; public var jumpheld:Boolean; public var i:int; public var j:int; public var k:int; public var door_left:int; public var roomx:int; public var roomy:int; public static var GAMEMODE:Number = 0; public function gameclass(obj:entityclass, help:helpclass, music:musicclass):void{ super(); gamestate = GAMEMODE; hascontrol = true; jumpheld = false; gravitycontrol = 0; test = false; teststring = "TEST = True"; state = 1; statedelay = 0; updatestate(obj, help, music); } public function gotoroom(rx:int, ry:int, map:mapclass, obj:entityclass):void{ obj.removeallblocks(); i = 0; while (i < obj.nentity) { if (obj.entities[i].rule != 0){ obj.entities[i].active = false; }; i++; }; obj.cleanup(); door_up = (rx + ((ry - 1) * 100)); door_down = (rx + ((ry + 1) * 100)); door_right = ((rx + 1) + (ry * 100)); door_left = ((rx - 1) + (ry * 100)); temp = (rx + (ry * 100)); roomx = rx; roomy = ry; map.loadlevel(roomx, roomy, obj); } public function updatestate(obj:entityclass, help:helpclass, music:musicclass):void{ statedelay--; if (statedelay <= 0){ statedelay = 0; }; if (statedelay <= 0){ switch (state){ case 0: break; case 1: break; }; }; } public function resetplayer(obj:entityclass, map:mapclass):void{ if (((!((roomx == saverx))) || (!((roomy == savery))))){ gotoroom(saverx, savery, map, obj); }; i = obj.getplayer(); obj.entities[i].vx = 0; obj.entities[i].vy = 0; obj.entities[i].ax = 0; obj.entities[i].ay = 0; obj.entities[i].xp = savex; obj.entities[i].yp = savey; gravitycontrol = savegc; } } }//package
Section 14
//helpclass (helpclass) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.net.*; public class helpclass extends Sprite { public var glowdir:int; public var globaltemp3:int; public var glow:int; public var slowsine:int; public var sine:Array; public var globaltemp:int; public var cosine:Array; public var globaltemp2:int; public function helpclass(){ super(); } public function removeObject(obj:Object, arr:Array):void{ var i:String; for (i in arr) { if (arr[i] == obj){ arr.splice(i, 1); break; }; }; } public function init():void{ sine = new Array(); cosine = new Array(); var i:int; while (i < 64) { sine[i] = Math.sin(((i * 6.283) / 64)); cosine[i] = Math.cos(((i * 6.283) / 64)); i++; }; glow = 0; glowdir = 0; slowsine = 0; } public function updateglow():void{ slowsine++; if (slowsine >= 64){ slowsine = 0; }; if (glowdir == 0){ glow = (glow + 2); if (glow >= 62){ glowdir = 1; }; } else { glow = (glow - 2); if (glow < 2){ glowdir = 0; }; }; } } }//package
Section 15
//Main (Main) package { import bigroom.input.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.net.*; import flash.ui.*; public class Main extends Sprite { public var dwgfx:dwgraphicsclass; public var game:gameclass; public var pixel:uint; public var GAMEMODE:int;// = 0 public var slogo:MovieClip; public var colpoint1:Point; public var colpoint2:Point; public var music:musicclass; private var im_tiles:Class; private var im_sprites:Class; public var help:helpclass; private var im_bfontmask:Class; public var logoposition:Matrix; public var map:mapclass; public var gamestate:int; private var im_bfont:Class; public var key:KeyPoll; public var i:int; public var j:int; public var k:int; public var pixel2:uint; public var obj:entityclass; public var pi:uint; public var pj:uint; public static var TRIGGER:Number = 1; public static var BLOCK:Number = 0; public static var DAMAGE:Number = 2; public function Main():void{ dwgfx = new dwgraphicsclass(); music = new musicclass(); help = new helpclass(); map = new mapclass(); obj = new entityclass(); im_tiles = Main_im_tiles; im_sprites = Main_im_sprites; im_bfont = Main_im_bfont; im_bfontmask = Main_im_bfontmask; super(); if (stage){ gameinit(); } else { addEventListener(Event.ADDED_TO_STAGE, gameinit); }; } private function gameinit(e:Event=null):void{ var tempbmp:Bitmap; var rc_menu:ContextMenu; var credit:ContextMenuItem; removeEventListener(Event.ADDED_TO_STAGE, gameinit); if (sitelock()){ rc_menu = new ContextMenu(); credit = new ContextMenuItem("Visit distractionware.com"); credit.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_distractionware); rc_menu.hideBuiltInItems(); rc_menu.customItems.push(credit); this.contextMenu = rc_menu; colpoint1 = new Point(); colpoint2 = new Point(); gamestate = GAMEMODE; obj.init(); help.init(); key = new KeyPoll(stage); game = new gameclass(obj, help, music); game.savex = 100; game.savey = 59; game.saverx = 50; game.savery = 50; game.savegc = 0; obj.createentity(game.savex, game.savey, 0); game.gotoroom(game.saverx, game.savery, map, obj); dwgfx.init(); tempbmp = new im_tiles(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.maketilearray(); tempbmp = new im_sprites(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makespritearray(); tempbmp = new im_bfont(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfont(); tempbmp = new im_bfontmask(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfontmask(); dwgfx.buffer = new BitmapData(320, 240, false, 0); addChild(dwgfx); addEventListener(Event.ENTER_FRAME, mainloop); } else { dwgfx.init(); addChild(dwgfx); tempbmp = new im_bfont(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfont(); tempbmp = new im_bfontmask(); dwgfx.buffer = tempbmp.bitmapData; dwgfx.makebfontmask(); dwgfx.buffer = new BitmapData(320, 240, false, 0); addEventListener(Event.ENTER_FRAME, lockedloop); }; } public function gamerender(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass):void{ dwgfx.backbuffer.lock(); dwgfx.drawmap(map); i = 0; while (i < obj.nentity) { obj.animateentities(i, help); i++; }; dwgfx.drawentities(obj, help); dwgfx.backbuffer.fillRect(dwgfx.footerrect, 0); dwgfx.bprint(5, 231, map.roomname, 196, 196, (0xFF - help.glow), true); if (game.test){ dwgfx.bprint(5, 5, game.teststring, 196, 196, 0xFF, false); }; dwgfx.render(); dwgfx.backbuffer.unlock(); } public function gameinput(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass, music:musicclass):void{ game.mx = (mouseX / 4); game.my = (mouseY / 4); i = 0; while (i < obj.nentity) { if (obj.entities[i].rule == 0){ if (game.hascontrol){ if (key.isDown(Keyboard.LEFT)){ obj.entities[i].ax = -3; obj.entities[i].dir = 0; } else { if (key.isDown(Keyboard.RIGHT)){ obj.entities[i].ax = 3; obj.entities[i].dir = 1; }; }; if (!key.isDown(90)){ game.jumpheld = false; }; if (((key.isDown(90)) && (!(game.jumpheld)))){ game.jumpheld = true; if (((obj.entities[i].onground) && ((game.gravitycontrol == 0)))){ game.gravitycontrol = 1; obj.entities[i].vy = -4; }; if (((obj.entities[i].onroof) && ((game.gravitycontrol == 1)))){ game.gravitycontrol = 0; obj.entities[i].vy = 4; }; }; }; }; i++; }; } public function visit_sponsor_logo():void{ var sponsor_link:URLRequest = new URLRequest("http://www.kongregate.com/?gamereferral=dontlookback"); navigateToURL(sponsor_link, "_blank"); } public function visit_sponsor(e:Event):void{ var sponsor_link:URLRequest = new URLRequest("http://www.kongregate.com/?gamereferral=dontlookback"); navigateToURL(sponsor_link, "_blank"); } public function gamelogic(key:KeyPoll, dwgfx:dwgraphicsclass, game:gameclass, map:mapclass, obj:entityclass, help:helpclass, music:musicclass):void{ help.updateglow(); game.updatestate(obj, help, music); i = (obj.nentity - 1); while (i >= 0) { if (obj.entities[i].isplatform){ obj.removeblockat(obj.entities[i].xp, obj.entities[i].yp); }; obj.updateentities(i, help, game, music); obj.entities[i].vx = (obj.entities[i].vx + obj.entities[i].ax); obj.entities[i].vy = (obj.entities[i].vy + obj.entities[i].ay); obj.entities[i].ax = 0; if (obj.entities[i].gravity){ if (obj.entities[i].rule == 0){ if (game.gravitycontrol == 0){ obj.entities[i].ay = 3; } else { obj.entities[i].ay = -3; }; } else { obj.entities[i].ay = 3; }; }; if (obj.entities[i].gravity){ obj.applyfriction(i, 0.8, 0.25); }; obj.entities[i].newxp = (obj.entities[i].xp + obj.entities[i].vx); obj.entities[i].newyp = (obj.entities[i].yp + obj.entities[i].vy); if (obj.testwallsx(i, map, obj.entities[i].newxp, obj.entities[i].yp)){ obj.entities[i].xp = obj.entities[i].newxp; } else { if (obj.entities[i].onwall > 0){ obj.entities[i].state = obj.entities[i].onwall; }; if (obj.entities[i].onxwall > 0){ obj.entities[i].state = obj.entities[i].onxwall; }; }; if (obj.testwallsy(i, map, obj.entities[i].xp, obj.entities[i].newyp)){ obj.entities[i].yp = obj.entities[i].newyp; } else { if (obj.entities[i].onwall > 0){ obj.entities[i].state = obj.entities[i].onwall; }; if (obj.entities[i].onywall > 0){ obj.entities[i].state = obj.entities[i].onywall; }; obj.entities[i].jumpframe = 0; }; if (obj.entitycollidefloor(map, i)){ obj.entities[i].onground = true; } else { obj.entities[i].onground = false; }; if (obj.entitycollideroof(map, i)){ obj.entities[i].onroof = true; } else { obj.entities[i].onroof = false; }; if (obj.entities[i].isplatform){ obj.createblock(0, obj.entities[i].xp, obj.entities[i].yp, obj.entities[i].w, obj.entities[i].h); j = obj.getplayer(); if (obj.entitycollide(i, j)){ obj.entities[j].vy = obj.entities[i].vy; obj.entities[j].newyp = (obj.entities[j].yp + obj.entities[j].vy); if (obj.testwallsy(j, map, obj.entities[j].xp, obj.entities[j].newyp)){ obj.entities[j].yp = obj.entities[j].newyp; } else { obj.entities[i].state = obj.entities[i].onwall; }; }; }; i--; }; i = 0; while (i < obj.nentity) { if (obj.entities[i].active){ j = 0; while (j < obj.nentity) { if (obj.entities[j].active){ if ((((((obj.entities[i].rule == 0)) && ((obj.entities[j].rule == 1)))) && (obj.entities[j].harmful))){ if (obj.entitycollide(i, j)){ if ((((obj.entities[i].size == 0)) && ((obj.entities[j].size == 0)))){ colpoint1.x = obj.entities[i].xp; colpoint1.y = obj.entities[i].yp; colpoint2.x = obj.entities[j].xp; colpoint2.y = obj.entities[j].yp; if (dwgfx.sprites[obj.entities[i].drawframe].hitTest(colpoint1, 1, dwgfx.sprites[obj.entities[j].drawframe], colpoint2, 1)){ game.resetplayer(obj, map); }; } else { game.resetplayer(obj, map); }; }; }; if ((((obj.entities[i].rule == 0)) && ((obj.entities[j].rule == 2)))){ if (obj.entitycollide(i, j)){ obj.removeblockat(obj.entities[j].xp, obj.entities[j].yp); }; }; if ((((obj.entities[i].rule == 0)) && ((obj.entities[j].rule == 3)))){ if (obj.entities[j].onentity > 0){ if (obj.entitycollide(i, j)){ obj.entities[j].state = obj.entities[j].onentity; }; }; }; }; j++; }; }; i++; }; i = obj.getplayer(); obj.skipdirblocks = true; if (!obj.testwallsx(i, map, obj.entities[i].xp, obj.entities[i].yp)){ if (obj.entities[i].rule == 0){ if (game.gravitycontrol == 0){ obj.entities[i].yp = (obj.entities[i].yp - 3); } else { obj.entities[i].yp = (obj.entities[i].yp + 3); }; }; }; obj.skipdirblocks = false; if (obj.checkdamage()){ game.resetplayer(obj, map); }; obj.cleanup(); i = obj.getplayer(); if ((((game.door_down > -2)) && ((obj.entities[i].yp >= 232)))){ obj.entities[i].yp = (obj.entities[i].yp - 240); game.gotoroom(game.roomx, (game.roomy + 1), map, obj); }; if ((((game.door_up > -2)) && ((obj.entities[i].yp < -10)))){ obj.entities[i].yp = (obj.entities[i].yp + 240); game.gotoroom(game.roomx, (game.roomy - 1), map, obj); }; if ((((game.door_left > -2)) && ((obj.entities[i].xp < -10)))){ obj.entities[i].xp = (obj.entities[i].xp + 320); game.gotoroom((game.roomx - 1), game.roomy, map, obj); }; if ((((game.door_right > -2)) && ((obj.entities[i].xp >= 312)))){ obj.entities[i].xp = (obj.entities[i].xp - 320); game.gotoroom((game.roomx + 1), game.roomy, map, obj); }; } public function lockedloop(e:Event):void{ dwgfx.backbuffer.lock(); dwgfx.bprint(5, 110, "Sorry! This game can only by played on", (196 - help.glow), (196 - help.glow), (0xFF - help.glow), true); dwgfx.bprint(5, 120, "www.distractionware.com", (196 - help.glow), (196 - help.glow), (0xFF - help.glow), true); dwgfx.render(); dwgfx.backbuffer.unlock(); help.updateglow(); } public function visit_distractionware(e:Event):void{ var distractionware_link:URLRequest = new URLRequest("http://www.distractionware.com"); navigateToURL(distractionware_link, "_blank"); } public function mainloop(e:Event):void{ gamerender(key, dwgfx, game, map, obj, help); gameinput(key, dwgfx, game, map, obj, help, music); gamelogic(key, dwgfx, game, map, obj, help, music); if (key.hasclicked){ key.click = false; }; } public function sitelock():Boolean{ var currUrl:String = stage.loaderInfo.url.toLowerCase(); if ((((currUrl.indexOf("distractionware.com") <= 0)) && ((currUrl.indexOf("flashgamelicense.com") <= 0)))){ return (true); }; return (true); } } }//package
Section 16
//Main_im_bfont (Main_im_bfont) package { import mx.core.*; public class Main_im_bfont extends BitmapAsset { } }//package
Section 17
//Main_im_bfontmask (Main_im_bfontmask) package { import mx.core.*; public class Main_im_bfontmask extends BitmapAsset { } }//package
Section 18
//Main_im_sprites (Main_im_sprites) package { import mx.core.*; public class Main_im_sprites extends BitmapAsset { } }//package
Section 19
//Main_im_tiles (Main_im_tiles) package { import mx.core.*; public class Main_im_tiles extends BitmapAsset { } }//package
Section 20
//mapclass (mapclass) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.net.*; public class mapclass extends Sprite { public var vmult:Array; public var tmap:Array; public var i:int; public var j:int; public var temp2:int; public var temp:int; public var roomname:String; public var contents:Array; public function mapclass():void{ contents = new Array(); vmult = new Array(); tmap = new Array(); super(); i = 0; while (i < 30) { vmult.push(int((i * 40))); i++; }; var j:int; while (j < 30) { i = 0; while (i < 40) { contents.push(0); i++; }; j++; }; } public function loadlevel(rx:int, ry:int, obj:entityclass):void{ var t:int; t = (rx + (ry * 100)); switch (t){ case rn(50, 50): tmap = new Array(); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0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1,1"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,7,7,7,7,7,7,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,6,6,6,6,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,7,7,7,7,7,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); fillcontent(tmap); roomname = "The first test room"; obj.createentity(260, 80, 3, 0, 2); break; case rn(51, 50): tmap = new Array(); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1"); tmap.push("0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1"); tmap.push("0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1");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,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1"); fillcontent(tmap); roomname = "cor blimely"; obj.createentity(160, 80, 1, 1, 6); obj.createblock(4, 0, 120, 320, 120); break; case rn(50, 51): tmap = new Array(); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("1,1,1,6,6,6,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,14,0,0,0,0,0"); tmap.push("0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0"); fillcontent(tmap); roomname = "this is so cool"; obj.createentity(30, 95, 5); break; default: tmap = new Array(); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); tmap.push("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); fillcontent(tmap); roomname = "Oh shit"; break; }; j = 0; while (j < 30) { i = 0; while (i < 40) { if (contents[(i + vmult[j])] == 6){ obj.createblock(2, (i * 8), (j * 8), 8, 8); }; if (contents[(i + vmult[j])] == 7){ contents[(i + vmult[j])] = 0; obj.createentity((i * 8), (j * 8), 4); }; if ((((contents[(i + vmult[j])] >= 11)) && ((contents[(i + vmult[j])] <= 14)))){ obj.createblock(3, (i * 8), (j * 8), 8, 8, (contents[(i + vmult[j])] - 11)); }; i++; }; j++; }; } public function fillcontent(tmap:Array):void{ var maprow:Array; j = 0; while (j < 30) { maprow = new Array(); maprow = tmap[j].split(","); i = 0; while (i < 40) { contents[(i + vmult[j])] = maprow[i]; i++; }; j++; }; } public function rn(rx:int, ry:int):int{ return ((rx + (ry * 100))); } public function collide(x:int, y:int):Boolean{ if ((((((((x < 0)) || ((y < 0)))) || ((x >= 40)))) || ((y >= 30)))){ return (false); }; if (contents[(x + vmult[y])] == 1){ return (true); }; return (false); } } }//package
Section 21
//musicclass (musicclass) package { import flash.events.*; import flash.display.*; import flash.media.*; public class musicclass extends Sprite { public var stepstopother:int; public var ambchan:Array; public var ambchanlen:int; public var currentsong:int; public var step2playing:Boolean; public var ambchannel:SoundChannel; public var musicfadein:int; public var currentstepchan:int; public var currentamb:int; public var currentmusicchan:int; public var stepchan:Array; public var musicfade:int; public var step1playing:Boolean; public var currentefchan:int; public var steptype:int; public var ambchancur:int; public var playingsteps:Boolean; public var musicchannel:SoundChannel; public var amb2active:Boolean; public var musicchannel2:SoundChannel; public var ambchannel2:SoundChannel; public var stepchannel:SoundChannel; public var musicstopother:int; public var currentstep:int; public var musicchanlen:int; public var stopother:int; public var stepchanlen:int; public var efchannel:Array; public var stepchannel2:SoundChannel; public var stepchancur:int; public var musicchancur:int; public var currentambchan:int; public var efchan:Array; public var musicchan:Array; public function musicclass(){ ambchan = new Array(); musicchan = new Array(); stepchan = new Array(); efchannel = new Array(); efchan = new Array(); super(); } public function playstep(t:int):void{ if (currentstep != t){ if (currentstep != -1){ stepchanlen = 0; stepchancur = stepchanlen; currentstepchan = 0; stepstopother = 0; if (step1playing){ stepchannel.stop(); }; if (step2playing){ stepchannel2.stop(); }; }; if (t != -1){ if (t == 0){ stepchanlen = 64; }; if (t == 1){ stepchanlen = 52; }; if (t == 2){ stepchanlen = 52; }; stepchancur = stepchanlen; currentstepchan = 0; currentstep = t; stepchannel = stepchan[currentstep].play(); step1playing = true; step2playing = false; } else { currentstep = -1; }; }; } public function initefchannels():void{ var i:int; while (i < 16) { efchannel.push(new SoundChannel()); i++; }; } public function changeamb(t:int):void{ if (currentamb != t){ if (currentamb != -1){ ambchanlen = 0; ambchancur = ambchanlen; currentambchan = 0; stopother = 0; ambchannel.stop(); if (amb2active){ ambchannel2.stop(); }; }; if (t != -1){ if (t == 0){ ambchanlen = 285; }; if (t == 1){ ambchanlen = 360; }; if (t == 2){ ambchanlen = 120; }; if (t == 3){ ambchanlen = 480; }; ambchancur = ambchanlen; currentambchan = 0; currentamb = t; ambchannel = ambchan[currentamb].play(); } else { currentamb = -1; }; }; } public function processmusicfade():void{ musicfade--; if (musicfade > 0){ if (currentmusicchan == 0){ musicchannel.soundTransform = new SoundTransform((musicfade / 60)); }; if (currentmusicchan == 1){ musicchannel2.soundTransform = new SoundTransform((musicfade / 60)); }; } else { if (currentmusicchan == 0){ musicchannel.stop(); }; if (currentmusicchan == 1){ musicchannel2.stop(); }; currentsong = -1; }; } public function processmusic():void{ if (musicfade > 0){ processmusicfade(); }; if (musicfadein > 0){ processmusicfadein(); }; musicstopother--; if (musicstopother == 1){ musicstopother = 0; if (currentmusicchan == 0){ musicchannel2.stop(); }; if (currentmusicchan == 1){ musicchannel.stop(); }; }; if (musicstopother < 0){ musicstopother = 0; }; musicchancur--; if ((((((musicchancur <= 0)) && ((currentsong > -1)))) && ((musicchanlen > 0)))){ musicchancur = musicchanlen; if (currentmusicchan == 0){ musicchannel2 = musicchan[currentsong].play(); musicstopother = 3; currentmusicchan = 1; } else { musicchannel = musicchan[currentsong].play(); musicstopother = 3; currentmusicchan = 0; }; }; } public function play(t:int):void{ if (currentsong != t){ if (currentsong != -1){ musicchanlen = 0; musicchancur = musicchanlen; currentmusicchan = 0; musicstopother = 0; musicchannel.stop(); musicchannel2.stop(); }; if (t != -1){ musicchanlen = -1; if (t == 2){ musicchanlen = 1231; }; if (t == 3){ musicchanlen = 3280; }; musicchancur = musicchanlen; currentmusicchan = 0; currentsong = t; if (currentsong == 3){ musicfadein = 61; musicchannel = musicchan[currentsong].play(0, 0, new SoundTransform(0)); } else { musicchannel = musicchan[currentsong].play(); }; if (musicchanlen < 0){ musicchannel.addEventListener(Event.SOUND_COMPLETE, stopmusic); }; } else { currentsong = -1; }; }; } public function processmusicfadein():void{ musicfadein--; if (musicfadein > 0){ musicchannel.soundTransform = new SoundTransform(((60 - musicfadein) / 60)); } else { musicchannel.soundTransform = new SoundTransform(1); }; } public function processstep():void{ stepstopother--; if (stepstopother == 1){ stepstopother = 0; if (currentstepchan == 0){ stepchannel2.stop(); step2playing = false; }; if (currentstepchan == 1){ stepchannel.stop(); step1playing = false; }; }; if (stepstopother < 0){ stepstopother = 0; }; stepchancur--; if ((((((stepchancur <= 0)) && ((currentstep > -1)))) && ((stepchanlen > 0)))){ stepchancur = stepchanlen; if (currentstepchan == 0){ stepchannel2 = stepchan[currentstep].play(); step2playing = true; stepstopother = 3; currentstepchan = 1; } else { stepchannel = stepchan[currentstep].play(); step1playing = true; stepstopother = 3; currentstepchan = 0; }; }; } public function fadeout():void{ if ((((currentsong == 2)) || ((currentsong == 3)))){ if (musicfade == 0){ musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic); musicfade = 61; }; } else { if (currentsong == 0){ if (musicfade == 0){ musicfade = 61; }; }; }; } public function stopstep():void{ if (step1playing){ stepchannel.stop(); step1playing = false; }; if (step2playing){ stepchannel2.stop(); step2playing = false; }; currentstep = -1; } public function playef(t:int, offset:int=0):void{ efchannel[currentefchan] = efchan[t].play(offset); currentefchan++; if (currentefchan > 15){ currentefchan = (currentefchan - 16); }; } public function loopamb1(e:Event):void{ ambchannel.removeEventListener(Event.SOUND_COMPLETE, loopamb1); ambchannel = ambchan[currentamb].play(0, 0, new SoundTransform(0.5)); ambchannel.addEventListener(Event.SOUND_COMPLETE, loopamb1); } public function loopamb2(e:Event):void{ ambchannel.removeEventListener(Event.SOUND_COMPLETE, loopamb2); ambchannel2 = ambchan[currentamb].play(0, 0, new SoundTransform(0.5)); ambchannel2.addEventListener(Event.SOUND_COMPLETE, loopamb2); } public function stopmusic(e:Event):void{ musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic); musicchannel.stop(); currentsong = -1; } public function processamb():void{ stopother--; if (stopother == 1){ stopother = 0; if (currentambchan == 0){ ambchannel2.stop(); }; if (currentambchan == 1){ ambchannel.stop(); }; }; if (stopother < 0){ stopother = 0; }; ambchancur--; if ((((ambchancur <= 0)) && ((currentamb > -1)))){ ambchancur = ambchanlen; if (currentambchan == 0){ amb2active = true; ambchannel2 = ambchan[currentamb].play(); stopother = 3; if (currentamb == 3){ stopother = 20; }; currentambchan = 1; } else { ambchannel = ambchan[currentamb].play(); stopother = 3; if (currentamb == 3){ stopother = 20; }; currentambchan = 0; }; }; } } }//package
Section 22
//Preloader (Preloader) package { import flash.events.*; import flash.display.*; import flash.ui.*; import flash.net.*; import flash.utils.*; public dynamic class Preloader extends MovieClip { private var im_loading:Class; public var showctp:Boolean; public var startgame:Boolean; public var adson:Boolean; public var loading:Bitmap; public function Preloader(){ im_loading = Preloader_im_loading; super(); if (checksite()){ adson = false; } else { adson = true; }; adson = false; var rc_menu:ContextMenu = new ContextMenu(); var credit:ContextMenuItem = new ContextMenuItem("Visit distractionware.com"); var credit2:ContextMenuItem = new ContextMenuItem("Visit kongregate.com"); credit.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_distractionware); credit2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_sponsor); credit2.separatorBefore = false; rc_menu.hideBuiltInItems(); rc_menu.customItems.push(credit); rc_menu.customItems.push(credit2); this.contextMenu = rc_menu; addEventListener(Event.ENTER_FRAME, checkFrame); if (!adson){ loading = new im_loading(); loading.x = (320 - (loading.width / 2)); loading.y = 316; addChild(loading); }; showctp = false; startgame = false; } private function checkFrame(e:Event):void{ var w:int; var p:Number = (this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal); if (!adson){ graphics.clear(); graphics.beginFill(0); graphics.drawRect(0, 0, 640, 480); graphics.endFill(); graphics.beginFill(0xFF); graphics.drawRect(120, 279, 400, 18); graphics.endFill(); }; if (p < 1){ if (!adson){ graphics.beginFill(0); w = int(Math.round((p * 391))); graphics.drawRect((125 + w), 283, (391 - w), 10); graphics.endFill(); }; } else { if (!showctp){ showctp = true; startgame = true; }; }; if (currentFrame == totalFrames){ if (startgame){ startup(); }; }; } public function visit_sponsor(e:Event):void{ var sponsor_link:URLRequest = new URLRequest("http://www.kongregate.com/?gamereferral=dontlookback"); navigateToURL(sponsor_link, "_blank"); } public function visit_distractionware(e:Event):void{ var distractionware_link:URLRequest = new URLRequest("http://www.distractionware.com"); navigateToURL(distractionware_link, "_blank"); } public function checksite():Boolean{ var currUrl:String = stage.loaderInfo.url.toLowerCase(); if ((((((((currUrl.indexOf("distractionware.com") <= 0)) && ((currUrl.indexOf("flashgamelicense.com") <= 0)))) && ((currUrl.indexOf("kongregate.com") <= 0)))) && ((currUrl.indexOf("chat.kongregate.com") <= 0)))){ return (false); }; return (true); } private function startup():void{ removeEventListener(Event.ENTER_FRAME, checkFrame); var mainClass:Class = (getDefinitionByName("Main") as Class); addChild((new (mainClass) as DisplayObject)); } } }//package
Section 23
//Preloader_im_loading (Preloader_im_loading) package { import mx.core.*; public class Preloader_im_loading extends BitmapAsset { } }//package

Library Items

Symbol 1 Bitmap {Preloader_im_loading}
Symbol 2 Bitmap {Main_im_tiles}
Symbol 3 Bitmap {Main_im_bfontmask}
Symbol 4 Bitmap {Main_im_bfont}
Symbol 5 Bitmap {Main_im_sprites}

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1458 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
EnableDebugger2 (64)Timeline Frame 131 bytes "u.$1$eo$DctRqUpQngjSnA5fI/UKW/."
DebugMX1 (63)Timeline Frame 1
SerialNumber (41)Timeline Frame 1

Labels

"Preloader"Frame 1
"start"Frame 2




http://swfchan.com/50/248112/info.shtml
Created: 8/5 -2022 11:56:19 Last modified: 8/5 -2022 12:09:29 Server time: 18/04 -2024 06:18:11