In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

flash on 2011-7-2

Get Adobe Flash player
by troy200550 07 Aug 2011
    Embed
/**
 * Copyright troy200550 ( http://wonderfl.net/user/troy200550 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/38DR
 */

/**
 * 25-Line ActionScript Contest Entry
 * 
 * Project: VO Byte Size (ultra-compact pac-man style game engine)
 * Author:  Peter Wilkins .. peter@vogames.co.uk .. www.vogames.co.uk
 * Date:    14-02-2009
 * 
 * OK to publish code if I am not a finalist: ___YES___
 * (change to NO if you don't want to be published. All finalist code WILL be published).
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
 
// 3 free lines! Alter the parameters of the following lines or remove them.
// Do not substitute other code for the three lines in this section
[SWF(width=600, height=400, backgroundColor=0x000000, frameRate=10)]
stage.align = StageAlign.LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
// 25 lines begins here!

//LINE .. 1 to 6 .. set up the basic objects and some variables which persist through the levels
var mc = addChild(new Sprite());    //the levels are drawn onto this graphics object
var pm = mc.addChild(new Sprite()); //the main guy himself is drawn onto this
var gh = new Array(mc.addChild(new Sprite()), mc.addChild(new Sprite()), mc.addChild(new Sprite()), mc.addChild(new Sprite()) ); //the ghosts are drawn onto these
var txt = mc.addChild(new Sprite().addChild(new TextField())); //the single text field used for all game info
var globalvars:Object = {isPaused: new Boolean(false), lives:3, currentlevel:1, score:0, playerLocation:new Point(260,200), ghostLocation:new Array(new Point(240,100),new Point(260,100),new Point(300,100),new Point(320,100))}; //the variables that persist through the levels
var vars = new Object(); //an object to hold the variables that effectively get reset each level

//LINE .. 7 .. draw the characters and initialise for first game
((pm.graphics.beginFill(0xFFFF00, 1)) || (pm.graphics.drawCircle(0, 0, 10)) || (pm.graphics.moveTo(8,-8)) || (pm.graphics.lineTo(0,0)) || (pm.graphics.lineTo(8,8)) || (pm.graphics.lineTo(10,0)) || (gh[0].graphics.beginFill(0xFF0000, 1)) || (gh[0].graphics.drawRoundRect(0, 0, 20, 20,10,20)) || (gh[0].graphics.drawRoundRect(4,16,4,4,2,4)) || (gh[0].graphics.drawRoundRect(12,16,4,4,2,4)) || (gh[0].graphics.beginFill(0xFFFFFF,1)) || (gh[0].graphics.drawCircle(5,5,2)) || (gh[0].graphics.drawCircle(15,5,2)) || (gh[1].graphics.beginFill(0x00FF00, 1)) || (gh[1].graphics.drawRoundRect(0, 0, 20, 20,10,20)) || (gh[1].graphics.drawRoundRect(4,16,4,4,2,4)) || (gh[1].graphics.drawRoundRect(12,16,4,4,2,4)) || (gh[1].graphics.beginFill(0xFFFFFF,1)) || (gh[1].graphics.drawCircle(5,5,2)) || (gh[1].graphics.drawCircle(15,5,2)) || (gh[2].graphics.beginFill(0xFFCC00, 1)) || (gh[2].graphics.drawRoundRect(0, 0, 20, 20,10,20)) || (gh[2].graphics.drawRoundRect(4,16,4,4,2,4)) || (gh[2].graphics.drawRoundRect(12,16,4,4,2,4)) || (gh[2].graphics.beginFill(0xFFFFFF,1)) || (gh[2].graphics.drawCircle(5,5,2)) || (gh[2].graphics.drawCircle(15,5,2)) || (gh[3].graphics.beginFill(0xFF00FF, 1)) || (gh[3].graphics.drawRoundRect(0, 0, 20, 20,10,20)) || (gh[3].graphics.drawRoundRect(4,16,4,4,2,4)) || (gh[3].graphics.drawRoundRect(12,16,4,4,2,4)) || (gh[3].graphics.beginFill(0xFFFFFF,1)) || (gh[3].graphics.drawCircle(5,5,2)) || (gh[3].graphics.drawCircle(15,5,2)) || !(txt.textColor = 0xFFFFFF) || !(txt.autoSize = TextFieldAutoSize.LEFT) || !(txt.y = 360) || !(mc.x = 10) ) || (txt.text = "<<< CLICK to PLAY again to PAUSE .. use ARROW KEYS to move >>>  "+"                   LIVES: "+globalvars.lives+"     SCORE: "+globalvars.score+"\n  gsm507                                  gsm507                       gsm507    gsm507") ? init() : init();

//LINE .. 8 to 12 .. create the listeners that handle click to play,pause and the keyboard events
stage.addEventListener(MouseEvent.CLICK, clickHandler);
stage.addEventListener(KeyboardEvent.KEY_DOWN, function (event:KeyboardEvent){
        (event.keyCode >= 37 && event.keyCode <= 40) ? vars.keysDown[event.keyCode-37] = 1 : vars.keysDown = vars.keysDown;});
stage.addEventListener(KeyboardEvent.KEY_UP, function (event:KeyboardEvent){
        (event.keyCode >= 37 && event.keyCode <= 40) ? vars.keysDown[event.keyCode-37] = 0 : vars.keysDown = vars.keysDown;});

//LINE .. 13 to 14 .. play and pause achieved by adding and removing enterframe listener on a toggle
function clickHandler (event:MouseEvent = null) {
    (globalvars.isPaused = !globalvars.isPaused) ? stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler) : stage.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);};

//LINE .. 15 to 16 .. the enterframe handler runs all game logic .. first change player to face in current direction
function enterFrameHandler(event:Event){
    (vars.playerIsDying == false) ? ( !(pm.x = vars.playerLocation.x+10) || (!(pm.y = vars.playerLocation.y+10) || (vars.lastDirection = vars.playerDirection) ) ) ? (vars.playerDirection == 0) ? pm.rotation = 180 : (vars.playerDirection == 1) ? pm.rotation = 270 : (vars.playerDirection == 2) ? pm.rotation = 0 : (vars.playerDirection == 3) ? pm.rotation = 90 : pm.rotation = 0 : pm.rotation = 180 : pm.rotation++;
        
//LINE .. 17 .. the longest for looped nested if else if chain i've ever coded in a single line .. mainly the ghost logic, collision and AI
for (var n:int = 0; n < 4; ++n) ( (vars.ghostLocation[n].x % vars.blockSize == 0) && (vars.ghostLocation[n].y % vars.blockSize == 0) && (vars.playerIsDying == false) ) ? (vars.ghostChangeMode[n]) && (vars.ghostChangeTo[n] == 2) ? ( (vars.ghostMode[n] == 1) ? !(vars.ghostMode[n] = 2) || !(vars.ghostSpeed[n] = 2) || (gh[n].alpha = 0.5) : true ) ? (vars.ghostChangeMode[n] = false) ? true : false : false : (vars.ghostChangeMode[n]) && (vars.ghostChangeTo[n] == 1) ? ( (vars.ghostMode[n] != 3) ? !(vars.ghostMode[n] = 1) || !(vars.ghostSpeed[n] = 5) || (gh[n].alpha = 1) : true ) ? (vars.ghostChangeMode[n] = false) ? true : false : false : (vars.ghostChangeMode[n]) && (vars.ghostChangeTo[n] == 3) ? ( (vars.ghostMode[n] == 2) ? !(vars.ghostMode[n] = 3) || !(vars.ghostSpeed[n] = 1) || (gh[n].alpha = 0.2) : true ) ? (vars.ghostChangeMode[n] = false) ? true : false : false : ( ( Math.floor(vars.levelData[Math.floor((vars.ghostLocation[n].x+(vars.offsetData[0*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.ghostLocation[n].y+(vars.offsetData[(0*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1 && (vars.ghostDirection[n] != 2) ) ? vars.ghostValidDirection[n].push(0) : true ) && ( ( Math.floor(vars.levelData[Math.floor((vars.ghostLocation[n].x+(vars.offsetData[1*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.ghostLocation[n].y+(vars.offsetData[(1*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1 && (vars.ghostDirection[n] != 3) ) ? vars.ghostValidDirection[n].push(1) : true ) && ( ( Math.floor(vars.levelData[Math.floor((vars.ghostLocation[n].x+(vars.offsetData[2*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.ghostLocation[n].y+(vars.offsetData[(2*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1 && (vars.ghostDirection[n] != 0) ) ? vars.ghostValidDirection[n].push(2) : true ) && ( ( Math.floor(vars.levelData[Math.floor((vars.ghostLocation[n].x+(vars.offsetData[3*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.ghostLocation[n].y+(vars.offsetData[(3*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1 && (vars.ghostDirection[n] != 1) ) ? vars.ghostValidDirection[n].push(3) : true ) ? ( vars.ghostMode[n] == 3) ? ( ( (gh[n].x == globalvars.ghostLocation[n].x) && (gh[n].y == globalvars.ghostLocation[n].y) ) ? !(vars.ghostChangeMode[n] = true) || !(vars.ghostMode[n] = 2) || (vars.ghostChangeTo[n] = 1) ? true : false : (gh[n].x >= globalvars.ghostLocation[n].x) ? (vars.ghostValidDirection[n].indexOf(0,0) != -1) ? ( vars.ghostValidDirection[n].splice(0,vars.ghostValidDirection[n].length,0)) ? true : false : false : (gh[n].x <= globalvars.ghostLocation[n].x) ? (vars.ghostValidDirection[n].indexOf(2,0) != -1) ? ( vars.ghostValidDirection[n].splice(0,vars.ghostValidDirection[n].length,2)) ? true : false : false : (gh[n].y <= globalvars.ghostLocation[n].y) ? (vars.ghostValidDirection[n].indexOf(3,0) != -1) ? ( vars.ghostValidDirection[n].splice(0,vars.ghostValidDirection[n].length,3)) ? true : false : false : (gh[n].y >= globalvars.ghostLocation[n].y) ? (vars.ghostValidDirection[n].indexOf(1,0) != -1) ? ( vars.ghostValidDirection[n].splice(0,vars.ghostValidDirection[n].length,1)) ? true : false : false : false ) || true ? !( vars.ghostDirection[n] = vars.ghostValidDirection[n][(Math.floor(Math.random()*vars.ghostValidDirection[n].length))] ).toString() || ( vars.ghostLocation[n].offset( vars.offsetData[vars.ghostDirection[n]*2] * vars.ghostSpeed[n], vars.offsetData[(vars.ghostDirection[n]*2)+1] *vars.ghostSpeed[n] ) ) || !( gh[n].x = vars.ghostLocation[n].x ) || !( gh[n].y = vars.ghostLocation[n].y ) || ( vars.ghostValidDirection[n].splice(0,vars.ghostValidDirection[n].length)) ? true : false : false : !( vars.ghostDirection[n] = vars.ghostValidDirection[n][(Math.floor(Math.random()*vars.ghostValidDirection[n].length))] ).toString() || ( vars.ghostLocation[n].offset( vars.offsetData[vars.ghostDirection[n]*2] * vars.ghostSpeed[n], vars.offsetData[(vars.ghostDirection[n]*2)+1] *vars.ghostSpeed[n] ) ) || !( gh[n].x = vars.ghostLocation[n].x ) || !( gh[n].y = vars.ghostLocation[n].y ) || ( vars.ghostValidDirection[n].splice(0,vars.ghostValidDirection[n].length)) : false : (vars.playerIsDying == false) ? ( vars.ghostLocation[n].offset( vars.offsetData[vars.ghostDirection[n]*2] * vars.ghostSpeed[n], vars.offsetData[(vars.ghostDirection[n]*2)+1] *vars.ghostSpeed[n] ) ) || !( gh[n].x = vars.ghostLocation[n].x ) || !( gh[n].y = vars.ghostLocation[n].y ) || ( vars.ghostValidDirection[n].splice(0,vars.ghostValidDirection[n].length)) ? gh[n].hitTestObject(pm) ? (vars.ghostMode[n] == 1) ? !(vars.playerIsDying = true) || !(globalvars.lives--) || !(vars.lastDirection = 2) || !(vars.playerDirection = 2) || !(vars.playerLocation = globalvars.playerLocation.clone()) || !(vars.ghostLocation[0] = globalvars.ghostLocation[0].clone()) || !(vars.ghostLocation[1] = globalvars.ghostLocation[1].clone()) || !(vars.ghostLocation[2] = globalvars.ghostLocation[2].clone()) || !(vars.ghostLocation[3] = globalvars.ghostLocation[3].clone()) : (vars.ghostMode[n] == 2) ? !(vars.ghostChangeMode[n] = true) || (vars.ghostChangeTo[n] = 3) ? true : false : false : (vars.edibleCounter < 1000) ? !(vars.edibleCounter--) ? !(vars.edibleCounter = 1000) || !(vars.ghostChangeMode.splice(0, 4, true, true, true, true) ) || (vars.ghostChangeTo.splice(0, 4, 1, 1, 1, 1) ) ? true : false : false : false : true : (globalvars.lives == 0) ? !(globalvars.lives = 3) || !(txt.text = "                        <<< GAME OVER you scored    "+globalvars.score+"    CLICK to PLAY again >>>     LIVES: 0      SCORE: "+globalvars.score+"\n  The 25 Line ActionScript Contest                                  gsm507                       gsm507") || !(globalvars.currentlevel = 1) || !(stage.frameRate = 25) || !(globalvars.score = 0) ? !(init()) ? clickHandler() ? true : false : false : false : (pm.rotation += 3) && (vars.deathCounter--) ? true : !(txt.text = "                        <<< EAT dots DODGE the ghosts >>> "+"                                           LIVES: "+globalvars.lives+"     SCORE: "+globalvars.score+"\gsm507                                  gsm507                       gsm507    gsm507") || !(vars.deathCounter = 100) || (vars.playerIsDying = false) || !(vars.ghostChangeMode.splice(0, 4, true, true, true, true)) || !(vars.ghostMode.splice(0, 4, 1, 1, 1, 1)) || !(vars.ghostChangeTo.splice(0, 4, 1, 1, 1, 1)) ? true : false;

//LINE .. 18 .. player movement, collision and logic 
(vars.playerIsDying == false) ? ( (vars.playerLocation.x % vars.blockSize == 0) && (vars.playerLocation.y % vars.blockSize == 0) ) ? ((vars.keysDown[0] == 1) && (Math.floor(vars.levelData[Math.floor((vars.playerLocation.x+(vars.offsetData[0*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.playerLocation.y+(vars.offsetData[(0*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1 ) && !(vars.playerDirection = 0) ) ? vars.playerLocation.offset( vars.offsetData[vars.playerDirection*2] * vars.playerSpeed, vars.offsetData[(vars.playerDirection*2)+1] *vars.playerSpeed) : ((vars.keysDown[1] == 1) && (Math.floor(vars.levelData[Math.floor((vars.playerLocation.x+(vars.offsetData[1*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.playerLocation.y+(vars.offsetData[(1*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1) && (vars.playerDirection = 1) ) ? vars.playerLocation.offset( vars.offsetData[vars.playerDirection*2] * vars.playerSpeed, vars.offsetData[(vars.playerDirection*2)+1] *vars.playerSpeed) : ((vars.keysDown[2] == 1) && (Math.floor(vars.levelData[Math.floor((vars.playerLocation.x+(vars.offsetData[2*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.playerLocation.y+(vars.offsetData[(2*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1) && (vars.playerDirection = 2) ) ? vars.playerLocation.offset( vars.offsetData[vars.playerDirection*2] * vars.playerSpeed, vars.offsetData[(vars.playerDirection*2)+1] *vars.playerSpeed) : ((vars.keysDown[3] == 1) && (Math.floor(vars.levelData[Math.floor((vars.playerLocation.x+(vars.offsetData[3*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.playerLocation.y+(vars.offsetData[(3*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1) && (vars.playerDirection = 3) ) ? vars.playerLocation.offset( vars.offsetData[vars.playerDirection*2] * vars.playerSpeed, vars.offsetData[(vars.playerDirection*2)+1] *vars.playerSpeed) : ( (Math.floor(vars.levelData[Math.floor((vars.playerLocation.x+(vars.offsetData[vars.lastDirection*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.playerLocation.y+(vars.offsetData[(vars.lastDirection*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1 ) && (vars.playerDirection = vars.lastDirection) ) ? vars.playerLocation.offset( vars.offsetData[vars.playerDirection*2] * vars.playerSpeed, vars.offsetData[(vars.playerDirection*2)+1] *vars.playerSpeed) : ( (vars.playerDirection == 0) && (Math.floor(vars.levelData[Math.floor((vars.playerLocation.x+(vars.offsetData[0*2]*vars.blockSize))/vars.blockSize)+Math.floor(((vars.playerLocation.y+(vars.offsetData[(0*2)+1]*vars.blockSize))/vars.blockSize)*vars.gameWidth)]) < 1 ) ) ? vars.playerLocation.offset( vars.offsetData[vars.playerDirection*2] * vars.playerSpeed, vars.offsetData[(vars.playerDirection*2)+1] *vars.playerSpeed) : vars.playerDirection = vars.lastDirection : vars.playerLocation.offset( vars.offsetData[vars.playerDirection*2] * vars.playerSpeed, vars.offsetData[(vars.playerDirection*2)+1] *vars.playerSpeed) : txt.text = "                        <<< GHOST GOT YOU. Get Ready! >>> "+"                                       LIVES: "+globalvars.lives+"     SCORE: "+globalvars.score+"\n  gsm507                                  gsm507                       gsm507    gsm507";

//LINE .. 19 .. player eat stuff logic and visuals
( (vars.playerLocation.x % vars.blockSize == 0) && (vars.playerLocation.y % vars.blockSize == 0) && (Math.floor(vars.levelData[Math.floor(vars.playerLocation.x/vars.blockSize)+Math.floor((vars.playerLocation.y/vars.blockSize)*vars.gameWidth)]) == 0) ) ? (vars.levelData[Math.floor(vars.playerLocation.x/vars.blockSize)+Math.floor((vars.playerLocation.y/vars.blockSize)*vars.gameWidth)] == 0) ? !(vars.levelData[Math.floor(vars.playerLocation.x/vars.blockSize)+Math.floor((vars.playerLocation.y/vars.blockSize)*vars.gameWidth)] += 0.1) || mc.graphics.beginFill(0x000000, 1) || mc.graphics.drawCircle(vars.playerLocation.x+(vars.blockSize/2), vars.playerLocation.y+(vars.blockSize/2), vars.blockSize/8) || ( (vars.itemsRemaining-- -1) && (globalvars.score++) ) ? txt.text = "                        <<< use ARROW KEYS to move >>>     "+"                                            LIVES: "+globalvars.lives+"     SCORE: "+globalvars.score+"\n  The 25 Line ActionScript Contest                                  gsm507                       pacman game" : (globalvars.currentlevel++) ? init() : true : (vars.levelData[Math.floor(vars.playerLocation.x/vars.blockSize)+Math.floor((vars.playerLocation.y/vars.blockSize)*vars.gameWidth)] == 0.2) ? !(vars.ghostChangeMode.splice(0, 4, true, true, true, true) ) || !(vars.ghostChangeTo.splice(0, 4, 2, 2, 2, 2) ) || !(vars.levelData[Math.floor(vars.playerLocation.x/vars.blockSize)+Math.floor((vars.playerLocation.y/vars.blockSize)*vars.gameWidth)] -= 0.1) || ( mc.graphics.beginFill(0x000000, 1) ) || ( mc.graphics.drawCircle(vars.playerLocation.x+(vars.blockSize/2), vars.playerLocation.y+(vars.blockSize/2), vars.blockSize/5) ) || (vars.edibleCounter = 999) ? ( (vars.itemsRemaining-- -1) && (globalvars.score++) ) ? txt.text = "                        <<< quick EAT the GHOSTS now >>>     "+"                                            LIVES: "+globalvars.lives+"     SCORE: "+globalvars.score+"\n  gsm507                                  gsm507                       modified by    www.gsm507m" : (globalvars.currentlevel++) ? init() : true : false : true : true ;};

//LINE 20 to 24 .. initialise the game level .. increasing difficulty simulated with framerate increase .. FP10 rocks!
function init() {
stage.frameRate++;
mc.graphics.clear();

vars = { levelData:new Array(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.2,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0.2,1,1,0,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,1,1,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,0,0,0,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,0,1,0,1,0,0,0,0,1,0,1,1,1,0,1,0,0,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,0,0,0,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,0,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,0,0,1,0,1,1,0.2,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0.2,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), offsetData:new Array(-1,0,0,-1,1,0,0,1), keysDown:new Array(0,0,0,0), ghostLocation:new Array(new Point(240,100),new Point(260,100),new Point(300,100),new Point(320,100)), ghostDirection:new Array(1,1,1,1), ghostLastDirection:new Array(1,1,1,1), ghostValidDirection:new Array(new Array(), new Array(), new Array(), new Array()), ghostChangeMode:new Array(new Boolean(true),new Boolean(true),new Boolean(true),new Boolean(true)), ghostChangeTo:new Array(1,1,1,1), ghostMode:new Array(1,1,1,1), itemsRemaining:0, gameWidth:29, gameHeight:18, playerLocation:new Point(260,200), playerDirection:2, lastDirection:2, playerSpeed:5, ghostSpeed:new Array(5,5,5,5), playerIsDying:new Boolean(false), deathCounter:100, edibleCounter:1000, blockSize:20};
    
for (var n:int = 0; n < vars.levelData.length; ++n) (vars.levelData[n] == 1) ? mc.graphics.beginFill(0x0000FF, 1) || mc.graphics.drawRect( (n*vars.blockSize) % (vars.gameWidth*vars.blockSize), Math.floor(n/vars.gameWidth)*vars.blockSize, vars.blockSize, vars.blockSize) : (vars.levelData[n] == 0) ? !(vars.itemsRemaining++ +1) || mc.graphics.beginFill(0xFFFF00, 1) || mc.graphics.drawCircle( ((n*vars.blockSize) % (vars.gameWidth*vars.blockSize))+(vars.blockSize/2), (Math.floor(n/vars.gameWidth)*vars.blockSize)+(vars.blockSize/2), vars.blockSize/7) : !(vars.itemsRemaining++ +1) || mc.graphics.beginFill(0xFFFFFF, 1) || mc.graphics.drawCircle( ((n*vars.blockSize) % (vars.gameWidth*vars.blockSize))+(vars.blockSize/2), (Math.floor(n/vars.gameWidth)*vars.blockSize)+(vars.blockSize/2), vars.blockSize/4);}

//LINE 25 .. perhaps use this line to squeeze a sound generator in for the next version .. ran out of time!

// 25 lines ends here!