/* */ package { import flash.display.Sprite; import flash.events.Event; import flash.events.KeyboardEvent; import flash.ui.Keyboard; public class plat extends Sprite { private var gameState, timer:int; // concerning the board private var theBoard:board; // player and opponents private var thePlayer:body; private var thePrize:lovelyPrize; private var creeps:Array; private var spawns:Array; private var pushingDir:int; private const gridSize = 25; private const halfGridSize = 12.5; private const numCreeps = 40; private var activeCreeps = 5; public function plat() { var i, j, k:int; var sx, sy:Number; pushingDir = 0; // make a board, 16 rows x24 cols, with 24-pix squares theBoard = new board(16,24, gridSize); addChild(theBoard); // put the player somewhere empty i=0; sx = (i*gridSize)+halfGridSize; sy = (3*gridSize)+halfGridSize; while ((theBoard.inBlock(sx, sy))&&(i<11)) { sx = (i*gridSize)+halfGridSize; sy = (3*gridSize)+halfGridSize; ++i; } thePlayer = new body(sx, sy, 1, 1); addChild(thePlayer); creeps = new Array(numCreeps); spawns = new Array(numCreeps); for (i=0; i