Frame 1
_root.gamemode = 2;
var game = (new com.midasplayer.game.startris.Game());
Instance of Symbol 99 MovieClip "soundOnOff" in Frame 1
on (release) {
_root.game.soundOnOff();
}
Instance of Symbol 101 MovieClip "exitGame" in Frame 1
on (release) {
_root.game.exitGame();
}
Symbol 18 MovieClip [O] Frame 1
#initclip 34
Object.registerClass("O", com.midasplayer.game.startris.Block);
#endinitclip
Symbol 21 MovieClip [J] Frame 1
#initclip 24
Object.registerClass("J", com.midasplayer.game.startris.Block);
#endinitclip
Symbol 24 MovieClip [L] Frame 1
#initclip 25
Object.registerClass("L", com.midasplayer.game.startris.Block);
#endinitclip
Symbol 27 MovieClip [Z] Frame 1
#initclip 26
Object.registerClass("Z", com.midasplayer.game.startris.Block);
#endinitclip
Symbol 30 MovieClip [T] Frame 1
#initclip 27
Object.registerClass("T", com.midasplayer.game.startris.Block);
#endinitclip
Symbol 33 MovieClip [S] Frame 1
#initclip 28
Object.registerClass("S", com.midasplayer.game.startris.Block);
#endinitclip
Symbol 36 MovieClip [I] Frame 1
#initclip 29
Object.registerClass("I", com.midasplayer.game.startris.Block);
#endinitclip
Symbol 39 MovieClip [BlockBG] Frame 1
#initclip 30
Object.registerClass("BlockBG", com.midasplayer.game.startris.BlockBackground);
#endinitclip
Symbol 46 MovieClip [StarExplosion] Frame 1
#initclip 31
Object.registerClass("StarExplosion", com.midasplayer.game.startris.StarExplosion);
#endinitclip
Symbol 61 MovieClip Frame 90
gotoAndPlay (30);
Symbol 78 MovieClip [BigStarExplosion] Frame 1
#initclip 32
Object.registerClass("BigStarExplosion", com.midasplayer.game.startris.BigStarExplosion);
#endinitclip
Symbol 87 MovieClip [starPlate] Frame 1
#initclip 33
Object.registerClass("starPlate", com.midasplayer.game.startris.StarPlate);
#endinitclip
Symbol 102 MovieClip [__Packages.com.midasplayer.util.GameBase] Frame 0
class com.midasplayer.util.GameBase extends MovieClip
{
static var gameData_, game_, checkGameDataIntervalId_;
function GameBase () {
super();
gameMode_ = GAME_MODE_MONEY;
}
function startGame() {
}
static function setGameMode(gameMode) {
gameMode_ = gameMode;
}
static function getGameMode() {
return(gameMode_);
}
static function setGameType(gameType) {
gameType_ = gameType;
}
static function getGameType() {
return(gameType_);
}
static function getGameData() {
return(gameData_);
}
function reportGameStart() {
com.midasplayer.util.Log.debug("gameStart");
fscommand ("gameStart");
}
function reportGameEnd(score) {
com.midasplayer.util.Log.debug("gameEnd " + String(score));
fscommand ("gameEnd", String(score));
}
function reportGameQuit() {
com.midasplayer.util.Log.debug("gameQuit");
fscommand ("gameQuit");
}
function reportGameOver(score) {
com.midasplayer.util.Log.debug("gameOver " + String(score));
fscommand ("gameOver", String(score));
}
function reportPlayData(pCode, pData, pScore) {
if (gameMode_ != GAME_MODE_MONEY) {
return(undefined);
}
var _local1;
_local1 = String(pCode);
if ((pData != null) && (pData.length > 0)) {
_local1 = _local1 + ("," + pData);
}
if (((pScore != undefined) && (pScore != null)) && (pScore.length > 0)) {
_local1 = _local1 + ("=" + pScore);
}
com.midasplayer.util.Log.debug("playData " + _local1);
fscommand ("playData", "" + _local1);
}
static function runsLocal() {
return(_root._URL.substr(0, 5).toLowerCase() == "file:");
}
function init(game) {
game_ = game;
checkGameDataIntervalId_ = setInterval(this, "checkGameData", 200);
}
function checkGameData() {
if (!hasGameData_) {
if (((_root.gameData != null) && (_root.gameData != undefined)) && (_root.gameData != "")) {
hasGameData_ = true;
parseGameData(_root.gameData);
clearInterval(checkGameDataIntervalId_);
trace("call startGame()");
game_.startGame();
}
}
}
function parseGameData(myData) {
gameData_ = new com.midasplayer.util.Map();
var _local7 = new XML();
_local7.ignoreWhite = true;
_local7.parseXML(myData);
var _local4 = _local7.firstChild;
if (_local4.nodeName == "gamedata") {
for (var _local6 in _local4.attributes) {
var _local5;
var _local2 = _local4.attributes[_local6];
gameData_.put(_local6, _local2);
}
var _local1 = _local4.firstChild;
while (_local1 != null) {
if (_local1.nodeName == "text") {
com.midasplayer.util.I18n.addTranslation(String(_local1.attributes.id), String(_local1.firstChild));
} else {
var _local3 = "0";
for (var _local6 in _local1.attributes) {
var _local2 = _local1.attributes[_local6];
if (_local6 == "id") {
_local3 = _local2;
} else {
gameData_.put((((_local1.nodeName + ".") + _local3) + ".") + _local6, _local2);
}
}
}
_local1 = _local1.nextSibling;
}
}
}
static var GAME_MODE_DEBUG = 0;
static var GAME_MODE_PRACTICE = 1;
static var GAME_MODE_MONEY = 2;
static var GAME_TYPE_SINGLE = 0;
static var GAME_TYPE_MULTI = 1;
static var gameMode_ = GAME_MODE_DEBUG;
static var gameType_ = GAME_TYPE_SINGLE;
static var hasGameData_ = false;
}
Symbol 103 MovieClip [__Packages.com.midasplayer.util.Map] Frame 0
class com.midasplayer.util.Map
{
var map, lastSize;
function Map (init) {
map = new Object();
for (var _local3 in init) {
map["@" + _local3] = init[_local3];
}
lastSize = -1;
}
function put(key, value) {
map["@" + key] = value;
lastSize = -1;
}
function get(key) {
return(map["@" + key]);
}
function remove(key) {
var _local2 = map["@" + key];
delete map["@" + key];
lastSize = -1;
return(_local2);
}
function count() {
if (lastSize < 0) {
lastSize = 0;
for (var _local2 in map) {
lastSize++;
}
}
return(lastSize);
}
function size() {
return(count());
}
function clear() {
map = {};
lastSize = 0;
}
function dump() {
var _local2 = "";
for (var _local3 in map) {
_local2 = _local2 + (((_local3 + "=>") + map[_local3]) + newline);
}
trace(_local2);
}
function toArray() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = map[_local3];
}
return(_local2);
}
function keySet() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = _local3.substring(1);
}
return(_local2);
}
function foreach(fn) {
do {
if ((in map) == null) {
break;
}
var _local3 = in map;
} while (fn(_local3.substring(1), map[_local3]) != false);
do {
} while ("foreach" != null);
lastSize = -1;
}
}
Symbol 104 MovieClip [__Packages.com.midasplayer.util.ArrayList] Frame 0
class com.midasplayer.util.ArrayList
{
var value;
function ArrayList () {
value = new Array();
}
function insert(obj, pos) {
var _local3 = value.length;
if (pos == undefined) {
value.push(obj);
return(_local3);
}
if (pos > _local3) {
pos = _local3;
}
var _local2 = _local3 - 1;
while (_local2 > (pos - 1)) {
value[_local2 + 1] = value[_local2];
_local2--;
}
value[pos] = obj;
return(pos);
}
function get(pos) {
return(value[pos]);
}
function indexOf(obj) {
var _local2 = 0;
while (_local2 < value.length) {
if (obj == value[_local2]) {
return(_local2);
}
_local2++;
}
return(-1);
}
function remove(obj) {
return(removeByIndex(indexOf(obj)));
}
function removeByIndex(pos) {
var _local5;
var _local3 = value.length;
if ((pos < _local3) && (pos >= 0)) {
_local5 = value[pos];
delete value[pos];
var _local2 = pos;
while (_local2 < (_local3 - 1)) {
value[_local2] = value[_local2 + 1];
_local2++;
}
value.length = _local3 - 1;
}
return(_local5);
}
function size() {
return(value.length);
}
function clear() {
value = new Array();
}
function toArray() {
return(value);
}
function foreach(fn) {
var _local2 = 0;
var _local3 = value.length;
while (_local2 < _local3) {
if (fn(_local2, value[_local2]) == false) {
break;
}
_local2++;
}
}
function sortOn(field) {
value.sortOn(field);
}
function sort() {
value.sort();
}
function subList(from, to) {
if (!to) {
to = value.length;
}
var a = (new com.midasplayer.util.ArrayList());
var i = from;
while (i < to) {
a.insert(eval (i));
i++;
}
return(a);
}
}
Symbol 105 MovieClip [__Packages.com.midasplayer.util.Log] Frame 0
class com.midasplayer.util.Log
{
function Log () {
}
static function setLevel(level) {
level_ = level;
}
static function debug(msg) {
if (level_ <= LEVEL_DEBUG) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_DEBUG, msg));
}
}
static function warning(msg) {
if (level_ <= LEVEL_WARNING) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_WARNING, msg));
}
}
static function error(msg) {
if (level_ <= LEVEL_ERROR) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_ERROR, msg));
}
}
static function getLog() {
if (log_.size() != logStringLastUpdatedSize_) {
logString_ = "";
var _local1 = 0;
while (_local1 < log_.size()) {
var _local2 = com.midasplayer.util.LogEntry(log_.get(_local1));
if (_local1 > 0) {
logString_ = logString_ + newline;
}
logString_ = logString_ + LEVEL_STRINGS[_local2.getLevel()];
logString_ = logString_ + ": ";
logString_ = logString_ + _local2.getMessage();
logStringLastUpdatedSize_ = log_.size();
_local1++;
}
}
return(logString_);
}
static var LEVEL_ALL = -1;
static var LEVEL_NONE = 1000;
static var LEVEL_DEBUG = 0;
static var LEVEL_WARNING = 1;
static var LEVEL_ERROR = 2;
static var LEVEL_STRINGS = ["DEBUG", "WARNING", "ERROR"];
static var level_ = LEVEL_ALL;
static var log_ = new com.midasplayer.util.ArrayList();
static var logString_ = "";
static var logStringLastUpdatedSize_ = 0;
}
Symbol 106 MovieClip [__Packages.com.midasplayer.util.LogEntry] Frame 0
class com.midasplayer.util.LogEntry
{
var level_, message_;
function LogEntry (level, msg) {
level_ = level;
message_ = msg;
}
function getLevel() {
return(level_);
}
function getMessage() {
return(message_);
}
}
Symbol 107 MovieClip [__Packages.com.midasplayer.util.I18n] Frame 0
class com.midasplayer.util.I18n
{
function I18n () {
}
static function addTranslation(name, val) {
val = val.split("\r\n").join(newline);
translations_.put(name, val);
}
static function format(name, replace0, replace1, replace2) {
var _local2 = translations_.get(name);
if (_local2 == undefined) {
return(("{" + name) + "}");
}
var _local1 = _local2.toString();
if (replace1 != undefined) {
var _local4 = _local1.split("{0}");
_local1 = _local4.join(replace0);
if (replace2 != undefined) {
_local4 = _local1.split("{1}");
_local1 = _local4.join(replace1);
if (replace2 != undefined) {
_local4 = _local1.split("{2}");
_local1 = _local4.join(replace2);
}
}
}
return(_local1);
}
static var translations_ = new com.midasplayer.util.Map();
}
Symbol 108 MovieClip [__Packages.com.midasplayer.game.startris.Game] Frame 0
class com.midasplayer.game.startris.Game extends com.midasplayer.util.GameBase
{
static var gameOverPlate_;
var init, myBoard_, startPlate_, reportGameStart, boardLayer_, startGameIndex_, startGameIntervalId_, timer_, waitForNextLevelId_, gameOverIntervalId_, reportGameOver, reportPlayData;
function Game () {
super();
trace("Game()");
Stage.showMenu = false;
Stage.scaleMode = "noScale";
_root._focusrect = false;
com.midasplayer.util.GameBase.setGameMode(_root.gamemode);
com.midasplayer.util.Log.setLevel(com.midasplayer.util.Log.LEVEL_NONE);
init(this);
}
function getBoard() {
return(myBoard_);
}
function soundOn() {
_root.soundOnOff.sound_label.text = com.midasplayer.util.I18n.format("sound_off");
soundOn_ = true;
com.midasplayer.fx.SoundManager.restoreMuteAll();
}
function soundOff() {
_root.soundOnOff.sound_label.text = com.midasplayer.util.I18n.format("sound_on");
soundOn_ = false;
com.midasplayer.fx.SoundManager.muteAll();
}
function soundOnOff() {
if (soundOn_) {
soundOff();
} else {
soundOn();
}
}
static function playIntro() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundIntro", 40, false, playLoop);
}
}
static function stopIntro() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.stop("soundIntro");
}
}
static function playLoop() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundLoop", 40, true);
}
}
static function stopLoop() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.stop("soundLoop");
}
}
static function playClock() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundClock", 100, false);
}
}
static function stopClock() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.stop("soundClock");
}
}
static function playLanding() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundLanding", 100, false);
}
}
static function playRotating() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundRotating", 70, false);
}
}
static function playRowCleared() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundRowCleared", 100, false);
}
}
static function playStar() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundstar", 100, false);
}
}
static function playBonus() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundBonus", 100, false);
}
}
static function playLevelStart() {
if (soundOn_) {
stopLoop();
com.midasplayer.fx.SoundManager.play("soundLevelStart", 100, false, playLoop);
}
}
static function playLevelUp() {
if (soundOn_) {
com.midasplayer.fx.SoundManager.play("soundLevelUp", 100, false);
}
}
static function playGameOver() {
if (soundOn_) {
stopIntro();
com.midasplayer.fx.SoundManager.play("soundGameOver", 100, false);
}
}
function onKeyDown() {
switch (Key.getCode()) {
case 40 :
myBoard_.keyDownActive();
break;
case 37 :
myBoard_.keyLeftActive();
break;
case 39 :
myBoard_.keyRightActive();
break;
case 38 :
myBoard_.keyUpActive();
break;
case 83 :
myBoard_.keyDownActive();
break;
case 65 :
myBoard_.keyLeftActive();
break;
case 68 :
myBoard_.keyRightActive();
break;
case 87 :
myBoard_.keyUpActive();
break;
case 32 :
myBoard_.keySpaceActive();
}
}
function onKeyUp() {
switch (Key.getCode()) {
case 40 :
myBoard_.keyDownReleased();
break;
case 38 :
myBoard_.keyUpReleased();
break;
case 37 :
myBoard_.keyLeftReleased();
break;
case 39 :
myBoard_.keyRightReleased();
break;
case 83 :
myBoard_.keyDownReleased();
break;
case 87 :
myBoard_.keyUpReleased();
break;
case 65 :
myBoard_.keyLeftReleased();
break;
case 68 :
myBoard_.keyRightReleased();
break;
case 32 :
myBoard_.keySpaceReleased();
}
}
function showStartPlate() {
startPlate_ = _root.attachMovie("startPlate", "startPlate", _root.getNextHighestDepth());
startPlate_.welcome_label.text = com.midasplayer.util.I18n.format("welcome");
startPlate_.instructions_label.text = com.midasplayer.util.I18n.format("instructions");
startPlate_.rotate_label.text = com.midasplayer.util.I18n.format("rotate");
startPlate_.move_left_label.text = com.midasplayer.util.I18n.format("move_left");
startPlate_.move_right_label.text = com.midasplayer.util.I18n.format("move_right");
startPlate_.fall_faster_label.text = com.midasplayer.util.I18n.format("fall_faster");
startPlate_.instant_fall_label.text = com.midasplayer.util.I18n.format("instant_fall");
startPlate_.key_space_label.text = com.midasplayer.util.I18n.format("key_space");
startPlate_.start_label.text = com.midasplayer.util.I18n.format("start");
startPlate_._x = 240;
startPlate_._y = 20;
startPlate_.startButton.onPress = function () {
_root.game.startGamePressed();
};
}
function startGame() {
trace("startGame()");
reportGameStart();
Key.addListener(this);
_root.score_label.text = com.midasplayer.util.I18n.format("score");
_root.stars_label.text = com.midasplayer.util.I18n.format("stars");
_root.level_label.text = com.midasplayer.util.I18n.format("level");
_root.timeleft_label.text = com.midasplayer.util.I18n.format("time_left");
_root.exitGame.exit_game_label.text = com.midasplayer.util.I18n.format("exit_game");
boardLayer_ = _root.createEmptyMovieClip("boardlayer", _root.getNextHighestDepth());
showStartPlate();
soundOn();
playIntro();
}
function startGamePressed() {
_root.exitGame._visible = true;
startGameIndex_ = 0;
startGameIntervalId_ = setInterval(this, "doStartGame", 25);
}
function doStartGame() {
trace("doStartGame()");
startPlate_._alpha = startPlate_._alpha - 20;
startGameIndex_++;
if (startGameIndex_ == 6) {
clearInterval(startGameIntervalId_);
startPlate_.removeMovieClip();
startLevel(1);
}
}
function initTimer() {
timer_ = new com.midasplayer.game.startris.Timer(myBoard_, 25);
boardLayer_.timer = timer_;
boardLayer_.onEnterFrame = function () {
this.timer.advanceTime();
};
}
function removeTimer() {
boardLayer_.onEnterFrame = undefined;
delete timer_;
}
function startLevel(num) {
trace("startLevel()");
var _local3 = "level." + num;
var _local7 = Number(com.midasplayer.util.GameBase.gameData_.get(_local3 + ".cols"));
var _local4 = Number(com.midasplayer.util.GameBase.gameData_.get(_local3 + ".rows"));
var _local8 = Number(com.midasplayer.util.GameBase.gameData_.get(_local3 + ".timelimit"));
var _local6 = Number(com.midasplayer.util.GameBase.gameData_.get(_local3 + ".starsrequired"));
var _local5 = Number(com.midasplayer.util.GameBase.gameData_.get(_local3 + ".speed"));
if (myBoard_ == null) {
myBoard_ = new com.midasplayer.game.startris.Board(this, boardLayer_, "myBoard", 1, _local7, _local4);
myBoard_.setSpeed(_local5);
myBoard_.setPosition(246, 43);
initTimer();
}
_root.starPlate.setMaxStars(_local6);
myBoard_.setSpeed(_local5);
myBoard_.startLevel(num, _local7, _local4, _local8, _local6, numStarsToNextLevel_, timeLeftToNextLevel_);
}
function levelFinished(numStarsToNextLevel, timeLeft) {
numStarsToNextLevel_ = numStarsToNextLevel;
timeLeftToNextLevel_ = timeLeft;
if (level_ == 3) {
_root.nextLevelStars1 = com.midasplayer.game.startris.BigStarExplosion(_root.attachMovie("BigStarExplosion", "bse", _root.getNextHighestDepth()));
_root.nextLevelStars1._x = myBoard_.getXPosition() + ((myBoard_.getWidth() * com.midasplayer.game.startris.Brick.BLOCK_WIDTH) / 2);
_root.nextLevelStars1._y = 235;
myBoard_.addScore(10000);
_root.game.reportPlayData(11, "", "10000");
playBonus();
_root.nextLevelPlate = _root.attachMovie("specialLevelPlate", "nlp", _root.getNextHighestDepth());
} else {
playLevelUp();
_root.nextLevelPlate = _root.attachMovie("nextLevelPlate", "nlp", _root.getNextHighestDepth());
}
_root.nextLevelPlate._alpha = 0;
_root.nextLevelPlate._x = myBoard_.getXPosition() + (((myBoard_.getWidth() * com.midasplayer.game.startris.Brick.BLOCK_WIDTH) - _root.nextLevelPlate._width) / 2);
_root.nextLevelPlate.timeIndex = 0;
waitForNextLevelId_ = setInterval(this, "waitForNextLevel", 20);
}
function anyMoreLevels() {
var _local2 = level_ + 1;
var _local3 = com.midasplayer.util.GameBase.gameData_.get(("level." + _local2) + ".cols");
return(_local3 != undefined);
}
function waitForNextLevel() {
var _local4 = 90;
var _local6 = 200;
var _local7 = 110;
_root.nextLevelPlate.timeIndex++;
var _local3 = _root.nextLevelPlate.timeIndex;
if (_local3 >= _local4) {
_root.nextLevelPlate.removeMovieClip();
clearInterval(waitForNextLevelId_);
_root.nextLevelStars1.remove();
if (!anyMoreLevels()) {
myBoard_.gameOver();
} else {
level_++;
startLevel(level_);
}
} else {
_root.nextLevelStars1.animate(_local4);
var _local5 = 100;
var _local8;
_local5 = ((_local3 < 10) ? (_local3 * _local3) : (_local5));
_local5 = ((_local3 > (_local4 - 10)) ? ((_local4 - _local3) * 10) : (_local5));
_local8 = Math.round(_local6 - (_local7 * (_local3 / _local4)));
_root.nextLevelPlate._y = _local8;
_root.nextLevelPlate._alpha = _local5;
}
}
function gameOver() {
gameOverPlate_ = _root.attachMovie("gameOverPlate", "gameOverPlate", _root.getNextHighestDepth());
gameOverPlate_.gameover_label.text = com.midasplayer.util.I18n.format("gameover");
gameOverPlate_.your_score_label.text = com.midasplayer.util.I18n.format("your_score");
gameOverPlate_._x = 240;
gameOverPlate_._y = 20;
gameOverPlate_.score.text = ((myBoard_ != null) ? (myBoard_.getScore()) : 0);
gameOverIntervalId_ = setInterval(this, "doGameOver", 1500);
}
function doGameOver() {
clearInterval(gameOverIntervalId_);
var _local2 = myBoard_.getScore();
if (_local2 == undefined) {
_local2 = 0;
}
reportGameOver(_local2);
}
function exitGame() {
if (doExit_) {
return(undefined);
}
doExit_ = true;
reportPlayData(19, "", "0");
if (myBoard_ != null) {
myBoard_.gameOver();
} else {
startPlate_.removeMovieClip();
gameOver();
}
}
function onEnterFrame() {
super.onEnterFrame();
if ((!isInitialized_) && (com.midasplayer.util.GameBase.hasGameData_)) {
isInitialized_ = true;
init();
} else {
timer_.advanceTime();
}
}
var isInitialized_ = false;
var level_ = 1;
static var soundOn_ = true;
var doExit_ = false;
var numStarsToNextLevel_ = 0;
var timeLeftToNextLevel_ = 0;
}
Symbol 109 MovieClip [__Packages.com.midasplayer.game.startris.BlockCallback] Frame 0
interface com.midasplayer.game.startris.BlockCallback
{
}
Symbol 110 MovieClip [__Packages.com.midasplayer.game.startris.GridBoard] Frame 0
class com.midasplayer.game.startris.GridBoard implements com.midasplayer.game.startris.BlockCallback
{
var board_, clipCount_, myClip_, cells_, cellBackgrounds_, numOccupiedCells_, numBlocksBeingRemoved_, attachOk_, isAttaching_, doUpdateIntervalId_, attachScore_;
function GridBoard (target, layer, name, depth, board) {
board_ = board;
clipCount_ = 0;
myClip_ = layer.createEmptyMovieClip(name, depth);
}
function init(width, height) {
setWidth(width);
setHeight(height);
cells_ = new Array(getHeight());
cellBackgrounds_ = new Array(getHeight());
numOccupiedCells_ = new Array(getHeight());
var _local3 = 0;
while (_local3 < getHeight()) {
numOccupiedCells_[_local3] = 0;
cells_[_local3] = new Array(getWidth());
cellBackgrounds_[_local3] = new Array(getWidth());
var _local2 = 0;
while (_local2 < getWidth()) {
cells_[_local3][_local2] = null;
cellBackgrounds_[_local3][_local2] = null;
_local2++;
}
_local3++;
}
}
function setPosition(x, y) {
myClip_._x = x;
myClip_._y = y;
}
function getXPosition() {
return(myClip_._x);
}
function getYPosition() {
return(myClip_._y);
}
function getWidth() {
return(width_);
}
function getHeight() {
return(height_);
}
function setWidth(width) {
if (width < width_) {
var _local3 = height_ - 1;
while (_local3 >= 0) {
var _local2 = 0;
while (_local2 < (width_ - 1)) {
cells_[_local3][_local2] = cells_[_local3][_local2 + 1];
cells_[_local3][_local2]._x = cells_[_local3][_local2]._x - com.midasplayer.game.startris.Brick.BLOCK_WIDTH;
cellBackgrounds_[_local3][_local2] = cellBackgrounds_[_local3][_local2 + 1];
cellBackgrounds_[_local3][_local2]._x = cellBackgrounds_[_local3][_local2]._x - com.midasplayer.game.startris.Brick.BLOCK_WIDTH;
_local2++;
}
_local3--;
}
myClip_._x = myClip_._x + com.midasplayer.game.startris.Brick.BLOCK_WIDTH;
}
width_ = width;
}
function setHeight(height) {
height_ = height;
}
function getCenterX() {
return(Math.floor(width_ / 2));
}
function update() {
numLinesRemovedOnUpdate_ = 0;
numStarsRemovedOnUpdate_ = 0;
numBlocksBeingRemoved_ = 0;
if (attachOk_) {
var _local2 = 0;
while (_local2 < height_) {
if (numOccupiedCells_[_local2] == width_) {
removeLine(_local2);
numLinesRemovedOnUpdate_++;
}
_local2++;
}
}
if (numLinesRemovedOnUpdate_ > 0) {
com.midasplayer.game.startris.Game.playRowCleared();
}
if (isAttaching_ && (numStarsRemovedOnUpdate_ > 0)) {
com.midasplayer.game.startris.Game.playStar();
}
doUpdateIntervalId_ = setInterval(this, "doUpdate", 50);
}
function doUpdate() {
if (numBlocksBeingRemoved_ == 0) {
clearInterval(doUpdateIntervalId_);
compact();
var _local2 = (isAttaching_ ? true : false);
isAttaching_ = false;
board_.attachBrickCallback(attachOk_, numLinesRemovedOnUpdate_, numStarsRemovedOnUpdate_, attachScore_, _local2);
}
}
function removeLine(line) {
var _local2 = 0;
while (_local2 < width_) {
removeBlock(_local2, line);
_local2++;
}
numLinesRemoved_++;
}
function removeBlock(col, row, countStars) {
if (countStars == undefined) {
countStars = true;
}
if (cells_[row][col] != null) {
if (countStars && (cells_[row][col].hasStar)) {
numStarsRemoved_++;
numStarsRemovedOnUpdate_++;
}
numBlocksBeingRemoved_++;
cells_[row][col].remove(this, countStars);
cells_[row][col] = null;
cellBackgrounds_[row][col].remove();
cellBackgrounds_[row][col] = null;
numOccupiedCells_[row] = numOccupiedCells_[row] - 1;
}
}
function removeBlockCallback() {
numBlocksBeingRemoved_--;
}
function compact() {
var _local4 = 0;
var _local3 = height_ - 1;
while (_local3 >= 0) {
if (numOccupiedCells_[_local3] == 0) {
_local4++;
} else if (_local4 > 0) {
var _local2 = 0;
while (_local2 < width_) {
if (cells_[_local3][_local2] != null) {
cells_[_local3][_local2]._y = cells_[_local3][_local2]._y + (_local4 * com.midasplayer.game.startris.Brick.BLOCK_HEIGHT);
cells_[_local3 + _local4][_local2] = cells_[_local3][_local2];
cells_[_local3][_local2] = null;
cellBackgrounds_[_local3][_local2]._y = cellBackgrounds_[_local3][_local2]._y + (_local4 * com.midasplayer.game.startris.Brick.BLOCK_HEIGHT);
cellBackgrounds_[_local3 + _local4][_local2] = cellBackgrounds_[_local3][_local2];
cellBackgrounds_[_local3][_local2] = null;
}
_local2++;
}
numOccupiedCells_[_local3 + _local4] = numOccupiedCells_[_local3];
numOccupiedCells_[_local3] = 0;
}
_local3--;
}
}
function attachBrick(brick) {
attachScore_ = 1;
attachScore_ = attachScore_ + (1 * brick.getNumInstantFallingRows());
attachOk_ = true;
isAttaching_ = true;
var _local2 = 0;
while (_local2 < 4) {
var _local5 = brick.getBlockX(_local2);
var _local3 = brick.getBlockY(_local2);
if (_local3 < 0) {
brick.getBlock(_local2).removeMovieClip();
brick.getBlockBackground(_local2).removeMovieClip();
attachOk_ = false;
} else {
cells_[_local3][_local5] = brick.getBlock(_local2);
cellBackgrounds_[_local3][_local5] = brick.getBlockBackground(_local2);
numOccupiedCells_[_local3] = numOccupiedCells_[_local3] + 1;
}
_local2++;
}
update();
}
function printBoard() {
var _local6 = "";
var _local4 = 0;
while (_local4 < height_) {
var _local5 = "";
var _local3 = 0;
while (_local3 < width_) {
_local5 = _local5 + ((cells_[_local4][_local3] != null) ? "x" : " ");
_local3++;
}
_local6 = _local6 + ((((" : " + _local5) + " : ") + numOccupiedCells_[_local4]) + newline);
_local4++;
}
_root.debug.text = _local6;
}
function isInside(x, y) {
if (((x < 0) || (x >= width_)) || (y >= height_)) {
return(false);
}
return(true);
}
function isFree(x, y) {
if (cells_[y][x] != null) {
return(false);
}
return(true);
}
var width_ = 0;
var height_ = 0;
var numLinesRemoved_ = 0;
var numStarsRemoved_ = 0;
var numLinesRemovedOnUpdate_ = 0;
var numStarsRemovedOnUpdate_ = 0;
var numPoints_ = 0;
}
Symbol 111 MovieClip [__Packages.com.midasplayer.game.startris.Brick] Frame 0
class com.midasplayer.game.startris.Brick
{
var myBoard_, myClip_, myBackgroundClip_, type_, backgrounds_, blocks_, wantedXGrid_, ixPos_, iyPos_, instantFalling_, numInstantFallingRows_, attached_, ySpeed_;
function Brick (board, target, name, depth, brickType, stars) {
myBoard_ = board;
myClip_ = target.createEmptyMovieClip(name, depth + 10000);
myBackgroundClip_ = target.createEmptyMovieClip(name + "bg", depth);
trace("x:" + myBackgroundClip_);
init(brickType, stars);
}
function init(brickType, stars) {
type_ = brickType;
backgrounds_ = new Array(4);
blocks_ = new Array(4);
xGridPos_ = myBoard_.getCenterX();
wantedXGrid_ = xGridPos_;
xPos_ = BLOCK_WIDTH * xGridPos_;
yGridPos_ = myBoard_.getStartY();
yPos_ = BLOCK_HEIGHT * yGridPos_;
ixPos_ = new com.midasplayer.game.startris.IFloat();
iyPos_ = new com.midasplayer.game.startris.IFloat();
ixPos_.set(BLOCK_WIDTH * xGridPos_);
ixPos_.set(BLOCK_WIDTH * xGridPos_);
iyPos_.set(BLOCK_HEIGHT * yGridPos_);
iyPos_.set(BLOCK_HEIGHT * yGridPos_);
var _local4 = false;
var _local2 = 0;
while (_local2 < 4) {
backgrounds_[_local2] = com.midasplayer.game.startris.BlockBackground(myBackgroundClip_.attachMovie("BlockBG", "blockbg" + _local2, _local2));
backgrounds_[_local2]._x = BLOCK_WIDTH * getBlockX(_local2, 0);
backgrounds_[_local2]._y = BLOCK_HEIGHT * getBlockY(_local2, 0);
_local2++;
}
_local2 = 0;
while (_local2 < 4) {
var _local3 = BRICK_TYPES[type_];
blocks_[_local2] = com.midasplayer.game.startris.Block(myClip_.attachMovie(_local3, "block" + _local2, _local2));
blocks_[_local2]._x = BLOCK_WIDTH * getBlockX(_local2, 0);
blocks_[_local2]._y = BLOCK_HEIGHT * getBlockY(_local2, 0);
if (stars[_local2] && (!_local4)) {
_local4 = true;
blocks_[_local2].addStar();
}
_local2++;
}
instantFalling_ = false;
numInstantFallingRows_ = 0;
attached_ = true;
}
function remove() {
myClip_.removeMovieClip();
myBackgroundClip_.removeMovieClip();
}
function getType() {
return(type_);
}
function setInstantFalling(t) {
instantFalling_ = t;
}
function getNumInstantFallingRows() {
return(((numInstantFallingRows_ > myBoard_.getHeight()) ? (myBoard_.getHeight()) : (numInstantFallingRows_)));
}
function setXSpeed(speed) {
xSpeed_ = speed;
}
function setYSpeed(speed) {
ySpeed_ = speed;
}
function getXPosition() {
return(myClip_._x);
}
function getYPosition() {
return(myClip_._y);
}
function setPosition(x, y) {
myClip_._x = (x - (xGridPos_ * BLOCK_WIDTH)) + (BRICK_PREVIEW_OFFSETS[type_][0] * BLOCK_WIDTH);
myClip_._y = (y - (yGridPos_ * BLOCK_HEIGHT)) + (BRICK_PREVIEW_OFFSETS[type_][1] * BLOCK_HEIGHT);
myBackgroundClip_._x = (x - (xGridPos_ * BLOCK_WIDTH)) + (BRICK_PREVIEW_OFFSETS[type_][0] * BLOCK_WIDTH);
myBackgroundClip_._y = (y - (yGridPos_ * BLOCK_HEIGHT)) + (BRICK_PREVIEW_OFFSETS[type_][1] * BLOCK_HEIGHT);
}
function getCurrentXGrid() {
return(Math.floor(xPos_ / BLOCK_WIDTH));
}
function getCurrentYGrid() {
return(Math.floor(yPos_ / BLOCK_HEIGHT));
}
function getWantedXGrid() {
return(wantedXGrid_);
}
function setWantedXGrid(x) {
wantedXGrid_ = x;
}
function getWidth() {
return(myClip_._width);
}
function getHeight() {
return(myClip_._height);
}
function getLeftmostGrid(x) {
return(Math.floor(x / BLOCK_WIDTH));
}
function getRightmostGrid(x) {
return(Math.ceil(x / BLOCK_WIDTH));
}
function getTopmostGrid(y) {
return(Math.floor(y / BLOCK_HEIGHT));
}
function getBottommostGrid(y) {
return(Math.ceil(y / BLOCK_HEIGHT));
}
function canMoveToPos(x, y, rotation) {
var _local3;
var _local2;
_local3 = Math.floor(x / BLOCK_WIDTH);
_local2 = Math.floor(y / BLOCK_HEIGHT);
if (!canMoveToGrid(_local3, _local2, rotation)) {
return(false);
}
_local3 = Math.ceil(x / BLOCK_WIDTH);
_local2 = Math.floor(y / BLOCK_HEIGHT);
if (!canMoveToGrid(_local3, _local2, rotation)) {
return(false);
}
_local3 = Math.floor(x / BLOCK_WIDTH);
_local2 = Math.ceil(y / BLOCK_HEIGHT);
if (!canMoveToGrid(_local3, _local2, rotation)) {
return(false);
}
_local3 = Math.ceil(x / BLOCK_WIDTH);
_local2 = Math.ceil(y / BLOCK_HEIGHT);
if (!canMoveToGrid(_local3, _local2, rotation)) {
return(false);
}
return(true);
}
function canMoveToGrid(xGrid, yGrid, rotation) {
outsideFlag_ = false;
var _local2 = 0;
while (_local2 < 4) {
if (!myBoard_.isInside(getBlockX(_local2, rotation, xGrid, yGrid), getBlockY(_local2, rotation, xGrid, yGrid))) {
outsideFlag_ = true;
return(false);
}
if (!myBoard_.isFree(getBlockX(_local2, rotation, xGrid, yGrid), getBlockY(_local2, rotation, xGrid, yGrid))) {
return(false);
}
_local2++;
}
return(true);
}
function rotate() {
var _local2 = Math.ceil(yPos_ / BLOCK_HEIGHT);
if (canMoveToGrid(getCurrentXGrid(), _local2, rotation_ + 1)) {
rotation_++;
xPos_ = BLOCK_WIDTH * getCurrentXGrid();
setWantedXGrid(getCurrentXGrid());
com.midasplayer.game.startris.Game.playRotating();
return(true);
}
if (outsideFlag_) {
if (canMoveToGrid(getCurrentXGrid() - 1, _local2, rotation_ + 1)) {
rotation_++;
xPos_ = BLOCK_WIDTH * (getCurrentXGrid() - 1);
setWantedXGrid(getCurrentXGrid());
com.midasplayer.game.startris.Game.playRotating();
return(true);
}
if (canMoveToGrid(getCurrentXGrid() + 1, _local2, rotation_ + 1)) {
rotation_++;
xPos_ = BLOCK_WIDTH * (getCurrentXGrid() + 1);
setWantedXGrid(getCurrentXGrid());
com.midasplayer.game.startris.Game.playRotating();
return(true);
}
if (canMoveToGrid(getCurrentXGrid() + 2, _local2, rotation_ + 1)) {
rotation_++;
xPos_ = BLOCK_WIDTH * (getCurrentXGrid() + 2);
setWantedXGrid(getCurrentXGrid());
com.midasplayer.game.startris.Game.playRotating();
return(true);
}
}
return(false);
}
function moveLeft() {
setWantedXGrid(getCurrentXGrid() - 1);
return(true);
}
function moveRight() {
setWantedXGrid(getCurrentXGrid() + 1);
return(true);
}
function move(alpha, doRender) {
var _local2;
_local2 = true;
if (stuckCount_ > 2) {
_local2 = false;
} else if (!doRender) {
_local2 = move2(ySpeed_ * alpha, xSpeed_ * alpha, doRender);
}
if (doRender) {
render(alpha);
}
return(_local2);
}
function move2(dy, dx, doRender) {
var _local4;
var _local2;
var _local3;
var _local9;
var _local5 = false;
if (dy > BLOCK_HEIGHT) {
var _local8 = move2(BLOCK_HEIGHT, dx);
if (!_local8) {
return(false);
}
dy = dy - BLOCK_HEIGHT;
dx = 0;
}
_local2 = yPos_ + dy;
_local9 = getTopmostGrid(_local2);
if (xPos_ == (getWantedXGrid() * BLOCK_WIDTH)) {
_local4 = xPos_;
_local3 = getCurrentXGrid();
} else if (xPos_ < (getWantedXGrid() * BLOCK_WIDTH)) {
_local4 = xPos_ + dx;
if (_local4 > (getWantedXGrid() * BLOCK_WIDTH)) {
_local4 = getWantedXGrid() * BLOCK_WIDTH;
}
_local3 = Math.ceil(_local4 / BLOCK_WIDTH);
} else if (xPos_ > (getWantedXGrid() * BLOCK_WIDTH)) {
_local4 = xPos_ - dx;
if (_local4 < (getWantedXGrid() * BLOCK_WIDTH)) {
_local4 = getWantedXGrid() * BLOCK_WIDTH;
}
_local3 = Math.floor(_local4 / BLOCK_WIDTH);
}
if (getTopmostGrid(yPos_) != getTopmostGrid(_local2)) {
if (xPos_ > _local4) {
if (canMoveToGrid(_local3, getTopmostGrid(_local2), rotation_)) {
xPos_ = _local4;
_local5 = true;
} else if (canMoveToGrid(_local3 + 1, getTopmostGrid(_local2), rotation_)) {
xPos_ = (_local3 + 1) * BLOCK_WIDTH;
_local5 = true;
}
} else if (xPos_ < _local4) {
if (canMoveToGrid(_local3, getTopmostGrid(_local2), rotation_)) {
xPos_ = _local4;
_local5 = true;
} else if (canMoveToGrid(_local3 - 1, getTopmostGrid(_local2), rotation_)) {
xPos_ = (_local3 - 1) * BLOCK_WIDTH;
_local5 = true;
}
}
if (instantFalling_) {
numInstantFallingRows_++;
}
}
if (canMoveToGrid(getLeftmostGrid(xPos_), getBottommostGrid(_local2), rotation_) && (canMoveToGrid(getRightmostGrid(xPos_), getBottommostGrid(_local2), rotation_))) {
yPos_ = _local2;
stuckCount_ = 0;
} else {
while (_local2 > yPos_) {
if (canMoveToGrid(getLeftmostGrid(xPos_), getBottommostGrid(_local2), rotation_) && (canMoveToGrid(getRightmostGrid(xPos_), getBottommostGrid(_local2), rotation_))) {
break;
}
_local2 = _local2 - BLOCK_HEIGHT;
}
yPos_ = _local2;
yPos_ = getBottommostGrid(yPos_) * BLOCK_HEIGHT;
stuckCount_++;
}
if ((_local5 == false) && (xPos_ != _local4)) {
if (stuckCount_ == 0) {
if (xPos_ > _local4) {
if (canMoveToGrid(_local3, getTopmostGrid(_local2), rotation_) && (canMoveToGrid(_local3, getBottommostGrid(_local2), rotation_))) {
xPos_ = _local4;
stuckCount_ = 0;
} else if (canMoveToGrid(_local3 + 1, getTopmostGrid(_local2), rotation_) && (canMoveToGrid(_local3 + 1, getBottommostGrid(_local2), rotation_))) {
xPos_ = (_local3 + 1) * BLOCK_WIDTH;
stuckCount_ = 0;
}
} else if (xPos_ < _local4) {
if (canMoveToGrid(_local3, getTopmostGrid(_local2), rotation_) && (canMoveToGrid(_local3, getBottommostGrid(_local2), rotation_))) {
xPos_ = _local4;
stuckCount_ = 0;
} else if (canMoveToGrid(_local3 - 1, getTopmostGrid(_local2), rotation_) && (canMoveToGrid(_local3 - 1, getBottommostGrid(_local2), rotation_))) {
xPos_ = (_local3 - 1) * BLOCK_WIDTH;
stuckCount_ = 0;
}
}
} else if (xPos_ > _local4) {
if (canMoveToGrid(_local3, getTopmostGrid(yPos_), rotation_)) {
xPos_ = _local4;
if (getLeftmostGrid(xPos_) != getRightmostGrid(xPos_)) {
stuckCount_ = 0;
}
} else if (canMoveToGrid(_local3 + 1, getTopmostGrid(yPos_), rotation_)) {
xPos_ = (_local3 + 1) * BLOCK_WIDTH;
if (getLeftmostGrid(xPos_) != getRightmostGrid(xPos_)) {
stuckCount_ = 0;
}
}
} else if (xPos_ < _local4) {
if (canMoveToGrid(_local3, getTopmostGrid(yPos_), rotation_)) {
xPos_ = _local4;
if (getLeftmostGrid(xPos_) != getRightmostGrid(xPos_)) {
stuckCount_ = 0;
}
} else if (canMoveToGrid(_local3 - 1, getTopmostGrid(yPos_), rotation_)) {
xPos_ = (_local3 - 1) * BLOCK_WIDTH;
if (getLeftmostGrid(xPos_) != getRightmostGrid(xPos_)) {
stuckCount_ = 0;
}
}
}
}
if ((xPos_ % BLOCK_WIDTH) != 0) {
stuckCount_ = 0;
}
ixPos_.set(xPos_);
iyPos_.set(yPos_);
return(stuckCount_ <= 2);
}
function render(alpha) {
var _local4;
var _local3;
_local4 = ixPos_.get(alpha);
_local3 = iyPos_.get(alpha);
_local4 = Math.round(_local4);
_local3 = Math.round(_local3);
var _local2 = 0;
while (_local2 < 4) {
blocks_[_local2].ox = _local4;
blocks_[_local2].r = rotation_;
blocks_[_local2]._x = (BLOCK_WIDTH * getBlockX(_local2, blocks_[_local2].r, 0, 0)) + blocks_[_local2].ox;
blocks_[_local2]._y = (BLOCK_HEIGHT * getBlockY(_local2, blocks_[_local2].r, 0, 0)) + _local3;
backgrounds_[_local2]._x = blocks_[_local2]._x;
backgrounds_[_local2]._y = blocks_[_local2]._y;
_local2++;
}
}
function getBlock(blockNum) {
return(blocks_[blockNum]);
}
function getBlockBackground(blockNum) {
return(backgrounds_[blockNum]);
}
function getBlockX(blockNum, rotation, x, y) {
if (rotation == undefined) {
rotation = rotation_;
}
if (x == undefined) {
x = getCurrentXGrid();
}
if (y == undefined) {
y = getCurrentYGrid();
}
rotation = rotation % 4;
switch (rotation) {
case 0 :
return((BRICK_LAYOUT[type_][blockNum][0] + x) + BRICK_ROTATION_OFFSETS[type_][rotation][0]);
case 1 :
return(((-BRICK_LAYOUT[type_][blockNum][1]) + x) + BRICK_ROTATION_OFFSETS[type_][rotation][0]);
case 2 :
return(((-BRICK_LAYOUT[type_][blockNum][0]) + x) + BRICK_ROTATION_OFFSETS[type_][rotation][0]);
}
return((BRICK_LAYOUT[type_][blockNum][1] + x) + BRICK_ROTATION_OFFSETS[type_][rotation][0]);
}
function getBlockY(blockNum, rotation, x, y) {
if (rotation == undefined) {
rotation = rotation_;
}
if (x == undefined) {
x = getCurrentXGrid();
}
if (y == undefined) {
y = getCurrentYGrid();
}
rotation = rotation % 4;
switch (rotation) {
case 0 :
return((BRICK_LAYOUT[type_][blockNum][1] + y) + BRICK_ROTATION_OFFSETS[type_][rotation][1]);
case 1 :
return((BRICK_LAYOUT[type_][blockNum][0] + y) + BRICK_ROTATION_OFFSETS[type_][rotation][1]);
case 2 :
return(((-BRICK_LAYOUT[type_][blockNum][1]) + y) + BRICK_ROTATION_OFFSETS[type_][rotation][1]);
}
return(((-BRICK_LAYOUT[type_][blockNum][0]) + y) + BRICK_ROTATION_OFFSETS[type_][rotation][1]);
}
static var BLOCK_HEIGHT = 30;
static var BLOCK_WIDTH = 30;
static var NUM_BRICK_TYPES = 7;
static var BRICK_TYPE_I = 0;
static var BRICK_TYPE_J = 1;
static var BRICK_TYPE_L = 2;
static var BRICK_TYPE_O = 3;
static var BRICK_TYPE_S = 4;
static var BRICK_TYPE_T = 5;
static var BRICK_TYPE_Z = 6;
static var BRICK_TYPES = ["I", "J", "L", "O", "S", "T", "Z"];
static var BRICK_LAYOUT = [[[0, 1], [0, 0], [0, -1], [0, -2]], [[0, -1], [0, 0], [0, 1], [-1, 1]], [[0, -1], [0, 0], [0, 1], [1, 1]], [[0, 0], [-1, 0], [-1, -1], [0, -1]], [[0, -1], [0, 0], [-1, 0], [-1, 1]], [[0, -1], [0, 0], [0, 1], [-1, 0]], [[-1, -1], [-1, 0], [0, 0], [0, 1]]];
static var BRICK_ROTATION_OFFSETS = [[[0, 0], [-1, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [-1, 0], [-1, -1], [0, -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]]];
static var BRICK_PREVIEW_OFFSETS = [[-0.5, 0], [0, 0], [-1, 0], [0, 1], [0, 0], [0, 0], [0, 0]];
var rotation_ = 0;
var xSpeed_ = 15;
var xPos_ = 0;
var yPos_ = 0;
var xGridPos_ = 0;
var yGridPos_ = 0;
var stuckCount_ = 0;
var outsideFlag_ = false;
}
Symbol 112 MovieClip [__Packages.com.midasplayer.game.startris.IFloat] Frame 0
class com.midasplayer.game.startris.IFloat
{
function IFloat () {
}
function set(newValue) {
lastValue = value;
value = newValue;
}
function get(alpha) {
return(lastValue + ((value - lastValue) * alpha));
}
var value = 0;
var lastValue = 0;
}
Symbol 113 MovieClip [__Packages.com.midasplayer.game.startris.BlockBackground] Frame 0
class com.midasplayer.game.startris.BlockBackground extends MovieClip
{
var removeIntervalId_, removeMovieClip, _width, _height, _x, _y;
function BlockBackground () {
super();
}
function remove() {
removeIntervalId_ = setInterval(this, "doRemove", 40);
removeMovieClip();
}
function doRemove() {
var _local2;
_local2 = scale();
if (!_local2) {
clearInterval(removeIntervalId_);
removeMovieClip();
}
}
function scale() {
_width = _width - 2;
_height = _height - 2;
_x++;
_y++;
if (_width <= 0) {
return(false);
}
return(true);
}
}
Symbol 114 MovieClip [__Packages.com.midasplayer.game.startris.Block] Frame 0
class com.midasplayer.game.startris.Block extends MovieClip
{
var starExplosion_, callback_, countStars_, lineBlock_, attachMovie, removeIntervalId_, hasStar, _x, _y, star_, removeMovieClip, _width, _height;
function Block () {
super();
}
function remove(callback, countStars) {
starExplosion_ = null;
callback_ = callback;
countStars_ = countStars;
lineBlock_ = attachMovie("LineBlock", "lb", 2);
removeIntervalId_ = setInterval(this, "doRemove", 40);
if (hasStar && (countStars_)) {
var _local3 = _root.getNextHighestDepth();
starExplosion_ = com.midasplayer.game.startris.StarExplosion(_root.attachMovie("StarExplosion", "sa" + _local3, _local3));
starExplosion_._x = (_root.game.getBoard().getXPosition() + _x) + (com.midasplayer.game.startris.Brick.BLOCK_WIDTH / 2);
starExplosion_._y = (_root.game.getBoard().getYPosition() + _y) + (com.midasplayer.game.startris.Brick.BLOCK_HEIGHT / 2);
star_.removeMovieClip();
}
}
function addStar() {
star_ = attachMovie("STAR", "star", 3);
hasStar = true;
}
function doRemove() {
var _local2;
_local2 = scale();
if (!_local2) {
clearInterval(removeIntervalId_);
lineBlock_.removeMovieClip();
callback_.removeBlockCallback();
starExplosion_.remove(15);
delete starExplosion_;
removeMovieClip();
}
}
function scale() {
if (starExplosion_ != null) {
starExplosion_.animate();
}
_width = _width - 2;
_height = _height - 2;
_x = _x + 1;
_y = _y + 1;
if (_width <= 1) {
return(false);
}
return(true);
}
}
Symbol 115 MovieClip [__Packages.com.midasplayer.game.startris.StarExplosion] Frame 0
class com.midasplayer.game.startris.StarExplosion extends MovieClip
{
var frame, smallStars, largeStars, smallStarsRadiusAdd_, smallStarsAngleAdd_, smallStarsFallHeight_, smallStarsRotation_, largeStarsRadiusAdd_, largeStarsAngleAdd_, largeStarsFallHeight_, largeStarsRotation_, attachMovie, removeMovieClip;
function StarExplosion () {
super();
frame = 0;
smallStars = new Array();
largeStars = new Array();
var _local5 = 0;
smallStarsRadiusAdd_ = 1.8 + (0.9 * Math.random());
smallStarsAngleAdd_ = 0.08 + (0.13 * Math.random());
smallStarsFallHeight_ = 0.12 + (0.05 * Math.random());
smallStarsRotation_ = 2 + Math.random(4);
largeStarsRadiusAdd_ = 0.6 + (0.4 * Math.random());
largeStarsAngleAdd_ = 0.06 + (0.15 * Math.random());
largeStarsFallHeight_ = 0.11 + (0.04 * Math.random());
largeStarsRotation_ = 2 + Math.random(4);
var _local4 = 0;
while (_local4 < NUM_SMALL_STARS) {
_local5++;
var _local3 = attachMovie("star2", "ss" + (_local4 + 1), _local5);
_local3._xscale = 50;
_local3._yscale = 50;
_local3._rotation = (_local4 * 360) / NUM_SMALL_STARS;
_local3.myAngle = ((_local4 * 2) * Math.PI) / NUM_SMALL_STARS;
_local3.myRadius = 0;
smallStars.push(_local3);
_local4++;
}
_local4 = 0;
while (_local4 < NUM_LARGE_STARS) {
_local5++;
var _local3 = attachMovie("star2", "ls" + (_local4 + 1), _local5);
_local3._xscale = 100;
_local3._yscale = 100;
_local3._rotation = (_local4 * 360) / NUM_LARGE_STARS;
_local3.myAngle = ((_local4 * 2) * Math.PI) / NUM_LARGE_STARS;
_local3.myRadius = 0;
largeStars.push(_local3);
_local4++;
}
}
function animate(maxFrame) {
frame++;
var _local7;
var _local6;
var _local3 = maxFrame * fallTime_;
var _local5 = 0;
while (_local5 < NUM_SMALL_STARS) {
var _local2 = smallStars[_local5];
_local2.myRadius = _local2.myRadius + smallStarsRadiusAdd_;
_local2.myAngle = _local2.myAngle + smallStarsAngleAdd_;
_local7 = Math.cos(_local2.myAngle) * _local2.myRadius;
_local6 = Math.sin(_local2.myAngle) * _local2.myRadius;
_local2._x = _local7;
_local2._y = _local6;
_local2._y = _local2._y + (frame - (smallStarsFallHeight_ * ((_local3 * _local3) - ((frame - _local3) * (frame - _local3)))));
_local2._rotation = _local2._rotation + smallStarsRotation_;
if (frame >= (maxFrame - 6)) {
_local2._xscale = ((maxFrame - frame) * 100) / 6;
_local2._yscale = ((maxFrame - frame) * 100) / 6;
}
_local5++;
}
_local5 = 0;
while (_local5 < NUM_LARGE_STARS) {
var _local2 = largeStars[_local5];
_local2.myRadius = _local2.myRadius + largeStarsRadiusAdd_;
_local2.myAngle = _local2.myAngle + largeStarsAngleAdd_;
_local7 = Math.cos(_local2.myAngle) * _local2.myRadius;
_local6 = Math.sin(_local2.myAngle) * _local2.myRadius;
_local2._x = _local7;
_local2._y = _local6;
_local2._y = _local2._y + (frame - (largeStarsFallHeight_ * ((_local3 * _local3) - ((frame - _local3) * (frame - _local3)))));
_local2._rotation = _local2._rotation + largeStarsRotation_;
if (frame >= (maxFrame - 6)) {
_local2._xscale = ((maxFrame - frame) * 100) / 6;
_local2._yscale = ((maxFrame - frame) * 100) / 6;
}
_local5++;
}
}
function remove() {
var _local2 = 0;
while (_local2 < NUM_SMALL_STARS) {
smallStars[_local2].removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < NUM_LARGE_STARS) {
largeStars[_local2].removeMovieClip();
_local2++;
}
removeMovieClip();
}
static var NUM_SMALL_STARS = 5;
static var NUM_LARGE_STARS = 3;
var fallTime_ = 0.4;
}
Symbol 116 MovieClip [__Packages.com.midasplayer.game.startris.Timeable] Frame 0
interface com.midasplayer.game.startris.Timeable
{
}
Symbol 117 MovieClip [__Packages.com.midasplayer.game.startris.Board] Frame 0
class com.midasplayer.game.startris.Board extends com.midasplayer.game.startris.GridBoard implements com.midasplayer.game.startris.Timeable
{
var layer_, score_, random_, game_, cols_, rows_, backgroundFrameClip_, myClip_, backgroundFrameMaskClip_, backgroundClip_, clipCount_, backgroundMaskClip1_, backgroundMaskClip2_, maskClip_, backgroundOverlayClip_, gameOverWhenAttached_, numStarsRemoved_, timeLimit_, newLevelIntervalId_, starsRequired_, level_, resizeClearLine_, startAnimIndex_, startAnimIntervalId_, activeBrick_, nextKeyCheck_, removeBlock, resizeDelay_, update, timeLeft_, clockIntervalId_, nextBrickType_, nextBrickStars_, gameOverIntervalId_, reportString_, numLinesRemoved_;
function Board (target, layer, name, depth, cols, rows) {
super(target, layer, name, depth, this);
layer_ = layer;
score_ = 0;
random_ = new com.midasplayer.util.Random(Number(com.midasplayer.util.GameBase.getGameData().get("seed")));
game_ = target;
cols_ = cols;
rows_ = rows;
trace(target);
backgroundFrameClip_ = layer_.attachMovie("BG_FRAME", "bgframe", layer_.getNextHighestDepth());
backgroundFrameClip_.swapDepths(myClip_);
backgroundFrameMaskClip_ = layer_.attachMovie("BG_FRAME", "bgframeMask", layer_.getNextHighestDepth());
backgroundFrameClip_.setMask(backgroundFrameMaskClip_);
backgroundClip_ = myClip_.attachMovie("Board_BG", "bg", clipCount_++);
backgroundMaskClip1_ = myClip_.attachMovie("Board_BG", "bgmask1", clipCount_++);
backgroundMaskClip2_ = myClip_.attachMovie("Board_BG", "bgmask2", clipCount_++);
maskClip_ = layer_.attachMovie("Board_BG", "mask5", layer_.getNextHighestDepth());
maskClip_._visible = false;
myClip_.setMask(maskClip_);
backgroundClip_._width = (cols * com.midasplayer.game.startris.Brick.BLOCK_WIDTH) + 4;
backgroundClip_._height = (rows * com.midasplayer.game.startris.Brick.BLOCK_HEIGHT) + 2;
backgroundClip_._y = 0;
backgroundClip_._x = -2;
backgroundMaskClip1_._x = backgroundClip_._x;
backgroundMaskClip1_._y = backgroundClip_._y;
backgroundMaskClip1_._width = backgroundClip_._width;
backgroundMaskClip1_._height = backgroundClip_._height;
backgroundMaskClip2_._x = backgroundClip_._x;
backgroundMaskClip2_._y = backgroundClip_._y;
backgroundMaskClip2_._width = backgroundClip_._width;
backgroundMaskClip2_._height = backgroundClip_._height;
backgroundMaskClip1_._y = backgroundMaskClip1_._y - backgroundClip_._height;
backgroundMaskClip2_._y = backgroundMaskClip2_._y + backgroundClip_._height;
backgroundFrameClip_._width = (cols * com.midasplayer.game.startris.Brick.BLOCK_WIDTH) + 8;
backgroundFrameClip_._height = (rows * com.midasplayer.game.startris.Brick.BLOCK_HEIGHT) + 6;
backgroundFrameMaskClip_._width = ((cols * com.midasplayer.game.startris.Brick.BLOCK_WIDTH) + 8) + 100;
backgroundFrameMaskClip_._height = ((rows * com.midasplayer.game.startris.Brick.BLOCK_HEIGHT) + 6) + 100;
maskClip_._width = (cols * com.midasplayer.game.startris.Brick.BLOCK_WIDTH) + 4;
maskClip_._height = (rows * com.midasplayer.game.startris.Brick.BLOCK_HEIGHT) + 2;
backgroundOverlayClip_ = myClip_.attachMovie("BG_OVERLAY", "bgo", clipCount_++);
backgroundOverlayClip_._width = backgroundClip_._width;
backgroundOverlayClip_._y = (backgroundClip_._height - backgroundOverlayClip_._height) + backgroundClip_._y;
backgroundOverlayClip_._x = backgroundClip_._x;
backgroundClip_.setMask(backgroundMaskClip1_);
backgroundOverlayClip_.setMask(backgroundMaskClip2_);
super.init(cols_, rows_);
}
function getRandom(n) {
return(random_.nextInt(n));
}
function startLevel(level, cols, rows, timeLimit, starsRequired, numStarsCollected, timeLeft) {
if (gameOver_ == true) {
return(undefined);
}
gameOverWhenAttached_ = false;
_root.game.reportPlayData(74, "" + level, "0");
numStarsRemoved_ = numStarsCollected;
_root.starPlate.addStars(numStarsRemoved_);
timeLimit_ = timeLimit;
if (cols != cols_) {
doResize_ = true;
com.midasplayer.game.startris.Game.playLevelStart();
newLevelIntervalId_ = setInterval(this, "doResize", 25);
}
starsRequired_ = starsRequired;
level_ = level;
cols_ = cols;
rows_ = rows;
_root.stars.text = (numStarsRemoved_ + " / ") + starsRequired_;
_root.level.text = com.midasplayer.util.I18n.format("level_" + level);
resizeClearLine_ = 0;
if (level == 1) {
startAnimIndex_ = 0;
startAnimIntervalId_ = setInterval(this, "startAnim", 25);
backgroundFrameMaskClip_._x = backgroundFrameClip_._x - backgroundFrameMaskClip_._width;
backgroundFrameMaskClip_._y = backgroundFrameClip_._y - backgroundFrameMaskClip_._height;
}
}
function startAnim() {
startAnimIndex_++;
backgroundFrameMaskClip_._x = backgroundFrameMaskClip_._x - ((backgroundFrameMaskClip_._x - backgroundFrameClip_._x) * 0.05);
backgroundFrameMaskClip_._y = backgroundFrameMaskClip_._y - ((backgroundFrameMaskClip_._y - backgroundFrameClip_._y) * 0.05);
if (startAnimIndex_ > 30) {
backgroundMaskClip1_._y = backgroundMaskClip1_._y - ((backgroundMaskClip1_._y - backgroundClip_._y) * 0.09);
}
if (startAnimIndex_ > 60) {
backgroundMaskClip2_._y = backgroundMaskClip2_._y - ((backgroundMaskClip2_._y - backgroundClip_._y) * 0.15);
}
if (startAnimIndex_ == 80) {
backgroundFrameClip_.setMask(null);
backgroundClip_.setMask(null);
backgroundOverlayClip_.setMask(null);
backgroundMaskClip1_.removeMovieClip();
backgroundMaskClip2_.removeMovieClip();
backgroundFrameMaskClip_.removeMovieClip();
clearInterval(startAnimIntervalId_);
var _local3 = backgroundFrameClip_.getDepth();
var _local6 = backgroundFrameClip_._x;
var _local4 = backgroundFrameClip_._y;
var _local7 = backgroundFrameClip_._width;
var _local5 = backgroundFrameClip_._height;
backgroundFrameClip_ = layer_.attachMovie("BG_FRAME_FILLED", "bgframe", _local3);
backgroundFrameClip_._x = _local6;
backgroundFrameClip_._y = _local4;
backgroundFrameClip_._width = _local7;
backgroundFrameClip_._height = _local5;
_root.previewPlate = _root.attachMovie("previewPlate", "previewPlate", _root.getNextHighestDepth());
_root.previewPlate.next_label.text = com.midasplayer.util.I18n.format("next");
_root.previewPlate.next_label._width = 80;
_root.previewPlate.next_label.autoSize = true;
if (_root.previewPlate.next_label._width > 80) {
_root.previewPlate.next_label._yscale = 8000 / _root.previewPlate.next_label._width;
_root.previewPlate.next_label._xscale = 8000 / _root.previewPlate.next_label._width;
}
if (_root.previewPlate.next_label._width <= 80) {
_root.previewPlate.next_label._x = _root.previewPlate.next_label._x + (((80 - _root.previewPlate.next_label._width) / 2) - 10);
}
generateNextBrick();
updatePreviewPlate();
startClock();
addBrick();
}
}
function tick(tick) {
var _local2 = tick - lastTick_;
lastTick_ = tick;
if (activeBrick_ == null) {
return(undefined);
}
if (doResize_) {
return(undefined);
}
nextKeyCheck_--;
if (nextKeyCheck_ <= 0) {
nextKeyCheck_ = keyCheckInterval_ - 2;
if (keyLeftPressed_) {
activeBrick_.moveLeft();
}
if (keyRightPressed_) {
activeBrick_.moveRight();
}
}
activeBrick_.setXSpeed(xSpeed_);
activeBrick_.setYSpeed(getSpeed());
activeBrick_.setInstantFalling(ultraFastMode_);
var _local4 = activeBrick_.move(_local2, false);
}
function render(tick, alpha) {
if (activeBrick_ == null) {
return(undefined);
}
activeBrick_.setXSpeed(xSpeed_);
activeBrick_.setYSpeed(getSpeed());
activeBrick_.setInstantFalling(ultraFastMode_);
var _local2 = activeBrick_.move(alpha, true);
if (!_local2) {
attachBrick(activeBrick_);
}
}
function doResize() {
if (doResize_) {
if (resizeClearLine_ < rows_) {
removeBlock(0, resizeClearLine_, false);
removeBlock(cols_ + 1, resizeClearLine_, false);
resizeClearLine_++;
resizeDelay_ = 0;
}
if (resizeDelay_ < 56) {
resizeDelay_++;
} else if (maskClip_._width > ((cols_ * com.midasplayer.game.startris.Brick.BLOCK_WIDTH) + 4)) {
maskClip_._width = maskClip_._width - 2;
maskClip_._x = maskClip_._x + 1;
backgroundFrameClip_._x = backgroundFrameClip_._x + 1;
backgroundFrameClip_._width = backgroundFrameClip_._width - 2;
backgroundOverlayClip_._x = backgroundOverlayClip_._x + 1;
backgroundOverlayClip_._width = backgroundOverlayClip_._width - 2;
backgroundOverlayClip_._height = backgroundOverlayClip_._width * 1.1521978021978;
backgroundOverlayClip_._y = (maskClip_._height - backgroundOverlayClip_._height) + backgroundClip_._y;
updatePreviewPlate();
} else {
clearInterval(newLevelIntervalId_);
nextBrick_.remove();
super.setWidth(cols_);
backgroundClip_._x = backgroundClip_._x - com.midasplayer.game.startris.Brick.BLOCK_WIDTH;
backgroundOverlayClip_._x = backgroundOverlayClip_._x - com.midasplayer.game.startris.Brick.BLOCK_WIDTH;
doResize_ = false;
stopped_ = false;
startClock();
update();
}
return(undefined);
}
}
function startClock() {
if (gameOver_ == true) {
return(undefined);
}
timeLeft_ = timeLimit_;
setClockTime(timeLeft_);
clockIntervalId_ = setInterval(this, "updateClock", 1000);
}
function stopClock() {
com.midasplayer.game.startris.Game.stopClock();
clearInterval(clockIntervalId_);
}
function updateClock(ref) {
timeLeft_--;
if (timeLeft_ <= 0) {
timeLeft_ = 0;
}
setClockTime(timeLeft_);
}
function getStartY() {
return((-Math.round(ySpeed_ / 2)) - 1);
}
function setPosition(x, y) {
super.setPosition(x, y);
maskClip_._x = _root.boardlayer.myBoard._x - 2;
maskClip_._y = _root.boardlayer.myBoard._y;
backgroundFrameClip_._x = _root.boardlayer.myBoard._x - 4;
backgroundFrameClip_._y = _root.boardlayer.myBoard._y - 2;
}
function setClockTime(timeLeft) {
var _local3 = timeLeft / 60;
_local3 = Math.floor(_local3);
var _local4 = timeLeft - (_local3 * 60);
if (timeLeft == 15) {
com.midasplayer.game.startris.Game.playClock();
}
if (_local4 < 10) {
_local4 = "0" + _local4;
}
_root.timeleft.text = (_local3 + ":") + _local4;
if (timeLeft == 0) {
gameOverWhenAttached_ = true;
}
}
function keyDownActive() {
if (!fastMode_) {
fastMode_ = true;
}
}
function keyDownReleased() {
fastMode_ = false;
}
function keySpaceActive() {
if (keySpacePressed_ != true) {
keySpacePressed_ = true;
ultraFastMode_ = true;
}
}
function keySpaceReleased() {
keySpacePressed_ = false;
}
function keyLeftActive() {
if (keyLeftPressed_ != true) {
activeBrick_.moveLeft();
nextKeyCheck_ = keyCheckInterval_;
keyLeftPressed_ = true;
}
}
function keyLeftReleased() {
keyLeftPressed_ = false;
}
function keyRightActive() {
if (keyRightPressed_ != true) {
activeBrick_.moveRight();
nextKeyCheck_ = keyCheckInterval_;
keyRightPressed_ = true;
}
}
function keyRightReleased() {
keyRightPressed_ = false;
}
function keyUpActive() {
if (keyUpPressed_ != true) {
keyUpPressed_ = true;
activeBrick_.rotate();
}
}
function keyUpReleased() {
keyUpPressed_ = false;
}
function setSpeed(speed) {
ySpeed_ = speed;
}
function getSpeed() {
if (ultraFastMode_) {
return(ySpeed_ + ultraFastModeAdd_);
}
if (fastMode_) {
return(ySpeed_ + fastModeAdd_);
}
return(ySpeed_);
}
function getScore() {
return(score_);
}
function addScore(score) {
score_ = score_ + score;
_root.points.text = score_;
}
function addBrick() {
if (gameOver_ || (stopped_)) {
return(undefined);
}
ultraFastMode_ = false;
activeBrick_ = new com.midasplayer.game.startris.Brick(this, myClip_, "b" + brickCount_, clipCount_++, nextBrickType_, nextBrickStars_);
generateNextBrick();
updatePreviewPlate();
}
function generateNextBrick() {
if (nextBrick_ == null) {
nextStar_ = ((brickCount_ + STAR_INTERVAL) + getRandom(STAR_RANDOMNESS * 2)) - STAR_RANDOMNESS;
} else {
nextBrick_.remove();
}
nextBrickStars_ = [0, 0, 0, 0];
if (nextStar_ == brickCount_) {
nextStar_ = ((brickCount_ + STAR_INTERVAL) + getRandom(STAR_RANDOMNESS * 2)) - STAR_RANDOMNESS;
nextBrickStars_[getRandom(4)] = 1;
}
nextBrickType_ = getRandom(com.midasplayer.game.startris.Brick.NUM_BRICK_TYPES);
nextBrick_ = new com.midasplayer.game.startris.Brick(this, _root.previewPlate, "p" + brickCount_, clipCount_++, nextBrickType_, nextBrickStars_);
brickCount_++;
}
function gameOver() {
stopClock();
stopped_ = true;
gameOver_ = true;
maskClip_.myHeight = maskClip_._height;
maskClip_.delay = 20;
maskClip_.delayIndex = 0;
maskClip_.myMaxIndex = 50;
maskClip_.myIndex = 0;
backgroundFrameClip_.myY = backgroundFrameClip_._y;
backgroundFrameClip_.myHeight = backgroundFrameClip_._height;
gameOverIntervalId_ = setInterval(this, "gameOverDelay", 1000);
_root.previewPlate.removeMovieClip();
}
function gameOverDelay() {
clearInterval(gameOverIntervalId_);
gameOverIntervalId_ = setInterval(this, "doGameOver", 30);
com.midasplayer.game.startris.Game.playGameOver();
}
function doGameOver() {
if (maskClip_.myIndex >= maskClip_.myMaxIndex) {
clearInterval(gameOverIntervalId_);
game_.gameOver();
}
if (maskClip_.delayIndex < maskClip_.delay) {
maskClip_.delayIndex++;
} else {
maskClip_.myIndex++;
var _local4 = maskClip_.myIndex;
var _local5 = maskClip_.myMaxIndex;
var _local6 = 100 * (1 - ((_local4 * _local4) / (_local5 * _local5)));
backgroundFrameClip_._height = (_local6 * backgroundFrameClip_.myHeight) / 100;
var _local7 = backgroundFrameClip_.myHeight;
var _local3 = backgroundFrameClip_._height;
backgroundFrameClip_._y = backgroundFrameClip_.myY + ((_local7 - _local3) / 2);
maskClip_._height = (((_local3 - 4) < 0) ? 0 : (_local3 - 4));
maskClip_._y = backgroundFrameClip_._y + 2;
if ((_local4 % 1) == 0) {
var _local2 = com.midasplayer.fx.SoundManager.getVolume("soundLoop");
_local2 = ((_local2 > 0) ? (_local2 - 1) : 0);
com.midasplayer.fx.SoundManager.setVolume("soundLoop", _local2);
}
}
}
function updatePreviewPlate() {
var _local3 = (myClip_._x + backgroundClip_._x) + backgroundClip_._width;
var _local4 = _local3 + (((700 - _local3) - (com.midasplayer.game.startris.Brick.BLOCK_WIDTH * 2)) / 2);
_root.previewPlate._x = _local4;
_root.previewPlate._y = myClip_._y;
nextBrick_.setPosition(30, 50);
}
function attachBrick(brick) {
if (stopped_) {
return(undefined);
}
com.midasplayer.game.startris.Game.playLanding();
activeBrick_ = null;
ultraFastMode_ = false;
trace("attachBrick()");
reportString_ = String(brick.getType());
var _local7 = -1;
var _local3 = 0;
while (_local3 < 4) {
if (brick.getBlock(_local3).hasStar) {
_local7 = _local3;
}
var _local6 = brick.getBlockX(_local3);
var _local5 = brick.getBlockY(_local3);
reportString_ = reportString_ + (((" " + String(_local5)) + " ") + String(_local6));
_local3++;
}
reportString_ = reportString_ + (" " + String(_local7));
reportString_ = reportString_ + (" " + String(brick.getNumInstantFallingRows()));
super.attachBrick(brick);
}
function attachBrickCallback(ok, numLinesRemoved, numStarsRemoved, attachScore, isAttaching) {
if (ok) {
var _local3 = 0;
var _local6 = 0;
var _local7 = 0;
if (isAttaching) {
_local3 = LINE_SCORES[numLinesRemoved];
_local3 = _local3 + attachScore;
} else {
_local3 = LINE_SCORES[1] * numLinesRemoved;
}
_local6 = 100 + (10 * (((numStarsRemoved * numStarsRemoved) + numStarsRemoved) / 2));
_local7 = 100 + ((level_ - 1) * 50);
_local3 = Math.round((_local6 * _local3) / 100);
_local3 = Math.round((_local7 * _local3) / 100);
if (isAttaching) {
reportString_ = reportString_ + (((" " + numLinesRemoved) + " ") + numStarsRemoved);
_root.game.reportPlayData(33, reportString_, "" + _local3);
} else {
reportString_ = (numLinesRemoved + " ") + numStarsRemoved;
_root.game.reportPlayData(87, reportString_, "" + _local3);
}
addScore(_local3);
_root.lines.text = numLinesRemoved_;
_root.starPlate.addStars(numStarsRemoved);
if (numStarsRemoved_ >= starsRequired_) {
stopped_ = true;
stopClock();
game_.levelFinished(numStarsRemoved_ - starsRequired_, timeLeft_);
} else if (gameOverWhenAttached_) {
stopClock();
stopped_ = true;
_root.game.reportPlayData(9, "", "0");
gameOver();
} else {
addBrick();
}
} else {
stopClock();
stopped_ = true;
gameOver();
}
}
static var LINE_SCORES = [0, 100, 300, 750, 2000];
static var STAR_INTERVAL = 4;
static var STAR_RANDOMNESS = 3;
var brickCount_ = 0;
var nextBrick_ = null;
var tick_ = 0;
var fastMode_ = false;
var fastModeAdd_ = 12;
var ultraFastMode_ = false;
var ultraFastModeAdd_ = 25;
var ySpeed_ = 2;
var xSpeed_ = 15;
var lastTick_ = 0;
var stopped_ = false;
var doResize_ = false;
var keyUpPressed_ = false;
var keySpacePressed_ = false;
var keyLeftPressed_ = false;
var keyRightPressed_ = false;
var keyCheckInterval_ = 4;
var nextStar_ = 0;
var gameOver_ = false;
}
Symbol 118 MovieClip [__Packages.com.midasplayer.util.Random] Frame 0
class com.midasplayer.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
var _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = _local3.lsb + mti);
mti++;
}
var _local6 = getTimer();
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = getTimer();
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 119 MovieClip [__Packages.com.midasplayer.util.Integer64] Frame 0
class com.midasplayer.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new com.midasplayer.util.Integer64(value));
}
function toString() {
return(((((("Integer64[value=0x" + com.midasplayer.util.Numbers.dec2hex(msb)) + ":") + com.midasplayer.util.Numbers.dec2hex(lsb)) + ":(") + p) + ")]");
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 120 MovieClip [__Packages.com.midasplayer.util.Numbers] Frame 0
class com.midasplayer.util.Numbers
{
function Numbers () {
}
static function dec2hex(iValue, padding) {
var _local1 = "";
while (iValue != 0) {
_local1 = "0123456789abcdef".charAt(iValue & 15) + _local1;
iValue = iValue >>> 4;
}
if (padding) {
if (_local1.length == 0) {
_local1 = "00";
}
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
} else if (_local1.length == 0) {
_local1 = "0";
}
return(_local1);
}
static function itoa(value, numZeroPadding) {
var _local2 = "" + value;
if (numZeroPadding) {
var _local1 = numZeroPadding - 1;
while (_local1 > 0) {
if (value < Math.pow(10, _local1)) {
_local2 = "0" + _local2;
}
_local1--;
}
}
return(_local2);
}
static function asTime(millis, alwaysHours, alwaysMinutes) {
if (alwaysHours) {
alwaysMinutes = true;
}
if (millis < 0) {
millis = 0;
}
millis = millis / 1000;
millis = Math.floor(millis);
var _local3 = Math.floor(millis / 3600);
var _local4 = Math.floor(millis / 60) % 60;
var _local5 = millis % 60;
var _local1 = "";
if (alwaysHours || (_local3 > 0)) {
_local1 = _local1 + itoa(_local3, 2);
}
if (alwaysHours || (_local1.length > 0)) {
_local1 = _local1 + ":";
}
var _local6 = _local1.length;
if ((alwaysMinutes || (_local4 > 0)) || (_local3 > 0)) {
_local1 = _local1 + itoa(_local4, 2);
}
if (alwaysMinutes || (_local1.length != _local6)) {
_local1 = _local1 + ":";
}
return(_local1 + itoa(_local5, 2));
}
}
Symbol 121 MovieClip [__Packages.com.midasplayer.fx.SoundManager] Frame 0
class com.midasplayer.fx.SoundManager
{
function SoundManager () {
}
static function isSoundEnabled() {
return(soundEnabled);
}
static function enableSounds(enabled) {
soundEnabled = enabled;
if (!enabled) {
muteAll();
} else {
restoreMuteAll();
}
}
static function stopAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.stop();
soundEntry.playStatus = false;
});
}
static function muteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(0);
});
}
static function restoreMuteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(soundEntry.realVol);
});
}
static function stop(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.stop();
_local1.playStatus = false;
}
}
static function getCalibratedVolume(flashVolume) {
flashVolume = Math.min(100, flashVolume);
flashVolume = Math.max(0, flashVolume);
return(Math.ceil(Math.pow(flashVolume / 100, 1.46) * 100));
}
static function setVolume(resource, percent) {
var _local1 = sounds.get(resource);
if ((_local1 != undefined) && (_local1.playStatus == true)) {
var _local2 = getCalibratedVolume(percent);
_local1.sound.setVolume(_local2);
_local1.sound.volume = _local2;
}
}
static function getVolume(resource) {
var _local1 = sounds.get(resource);
if ((_local1 != undefined) && (_local1.playStatus == true)) {
return(_local1.sound.getVolume());
}
return(0);
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function initialize(list) {
for (var _local9 in list) {
var resource = list[_local9];
var _local3 = _root.getNextHighestDepth();
var _local2 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local3, _local3));
_local2.attachSound(resource);
_local2.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local2, playStatus:false});
}
}
static function play(resource, volume, isLoop, fn) {
if (volume == undefined) {
volume = 100;
}
if (isLoop == undefined) {
isLoop = false;
}
volume = getCalibratedVolume(volume);
var _local2 = sounds.get(resource);
if (_local2 != undefined) {
_local2.sound.setVolume((soundEnabled ? (volume) : 0));
_local2.realVol = volume;
_local2.playStatus = true;
_local2.onPlayedFn = fn;
_local2.sound.start(0, (isLoop ? 32767 : 1));
} else {
var _local6 = _root.getNextHighestDepth();
var _local4 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local6, _local6));
_local4.attachSound(resource);
_local4.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(resource);
};
_local4.setVolume((soundEnabled ? (volume) : 0));
_local4.start(0, (isLoop ? 32767 : 1));
sounds.put(resource, {realVol:volume, onPlayedFn:fn, sound:_local4, playStatus:true});
}
}
static function onPlayed_(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.onPlayedFn != undefined)) {
_local1.onPlayedFn();
}
}
static var sounds = new com.midasplayer.util.Map();
static var soundEnabled = true;
}
Symbol 122 MovieClip [__Packages.com.midasplayer.game.startris.Timer] Frame 0
class com.midasplayer.game.startris.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
fps = 1000 / _local3;
unprocessedTime = unprocessedTime + _local3;
var _local2 = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = unprocessedTime - millisPerGameTick;
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
}
var time = 0;
var lastTime = 0;
var unprocessedTime = 0;
var tick = 0;
var millisPerGameTick = 0;
var fps = 0;
}
Symbol 123 MovieClip [__Packages.com.midasplayer.game.startris.BigStarExplosion] Frame 0
class com.midasplayer.game.startris.BigStarExplosion extends MovieClip
{
var frame, smallStars, largeStars, smallStarsRadiusAdd_, smallStarsAngleAdd_, smallStarsFallHeight_, smallStarsRotation_, largeStarsRadiusAdd_, largeStarsAngleAdd_, largeStarsFallHeight_, largeStarsRotation_, attachMovie, removeMovieClip;
function BigStarExplosion () {
super();
frame = 0;
smallStars = new Array();
largeStars = new Array();
var _local5 = 0;
smallStarsRadiusAdd_ = 0.9 + (0.4 * Math.random());
smallStarsAngleAdd_ = 0.09;
smallStarsFallHeight_ = 0.04;
smallStarsRotation_ = 2 + Math.random(2);
largeStarsRadiusAdd_ = 0.7 + (0.2 * Math.random());
largeStarsAngleAdd_ = 0.1;
largeStarsFallHeight_ = 0.04;
largeStarsRotation_ = 2 + Math.random(4);
var _local4 = 0;
while (_local4 < NUM_SMALL_STARS) {
_local5++;
var _local3 = attachMovie("star2", "ss" + (_local4 + 1), _local5);
_local3._xscale = 50;
_local3._yscale = 50;
_local3._rotation = (_local4 * 360) / NUM_SMALL_STARS;
_local3.myAngle = ((_local4 * 2) * Math.PI) / NUM_SMALL_STARS;
_local3.myRadius = 0;
smallStars.push(_local3);
_local4++;
}
_local4 = 0;
while (_local4 < NUM_LARGE_STARS) {
_local5++;
var _local3 = attachMovie("star2", "ls" + (_local4 + 1), _local5);
_local3._xscale = 100;
_local3._yscale = 100;
_local3._rotation = (_local4 * 360) / NUM_LARGE_STARS;
_local3.myAngle = ((_local4 * 2) * Math.PI) / NUM_LARGE_STARS;
_local3.myRadius = 0;
largeStars.push(_local3);
_local4++;
}
}
function animate(maxFrame) {
frame++;
var _local7;
var _local6;
var _local3 = maxFrame * fallTime_;
var _local5 = 0;
while (_local5 < NUM_SMALL_STARS) {
var _local2 = smallStars[_local5];
_local2.myRadius = _local2.myRadius + smallStarsRadiusAdd_;
_local2.myAngle = _local2.myAngle + smallStarsAngleAdd_;
_local7 = Math.cos(_local2.myAngle) * _local2.myRadius;
_local6 = Math.sin(_local2.myAngle) * _local2.myRadius;
_local2._x = _local7;
_local2._y = _local6;
_local2._y = _local2._y + (frame - (smallStarsFallHeight_ * ((_local3 * _local3) - ((frame - _local3) * (frame - _local3)))));
_local2._rotation = _local2._rotation + smallStarsRotation_;
if (frame >= (maxFrame - 6)) {
_local2._xscale = ((maxFrame - frame) * 100) / 6;
_local2._yscale = ((maxFrame - frame) * 100) / 6;
}
_local5++;
}
_local5 = 0;
while (_local5 < NUM_LARGE_STARS) {
var _local2 = largeStars[_local5];
_local2.myRadius = _local2.myRadius + largeStarsRadiusAdd_;
_local2.myAngle = _local2.myAngle + largeStarsAngleAdd_;
_local7 = Math.cos(_local2.myAngle) * _local2.myRadius;
_local6 = Math.sin(_local2.myAngle) * _local2.myRadius;
_local2._x = _local7;
_local2._y = _local6;
_local2._y = _local2._y + (frame - (largeStarsFallHeight_ * ((_local3 * _local3) - ((frame - _local3) * (frame - _local3)))));
_local2._rotation = _local2._rotation + largeStarsRotation_;
if (frame >= (maxFrame - 6)) {
_local2._xscale = ((maxFrame - frame) * 100) / 6;
_local2._yscale = ((maxFrame - frame) * 100) / 6;
}
_local5++;
}
}
function remove() {
var _local2 = 0;
while (_local2 < NUM_SMALL_STARS) {
smallStars[_local2].removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < NUM_LARGE_STARS) {
largeStars[_local2].removeMovieClip();
_local2++;
}
removeMovieClip();
}
static var NUM_SMALL_STARS = 5;
static var NUM_LARGE_STARS = 5;
var fallTime_ = 0.7;
}
Symbol 124 MovieClip [__Packages.com.midasplayer.game.startris.StarPlate] Frame 0
class com.midasplayer.game.startris.StarPlate extends MovieClip
{
var stars_, indexArray_, starBackgrounds_, maxStars_;
function StarPlate () {
super();
stars_ = new Array();
indexArray_ = new Array();
starBackgrounds_ = new Array();
}
function setMaxStars(num) {
maxStars_ = num;
numStars_ = 0;
var i = 0;
while (i < NUM_STARS) {
indexArray_[i] = i;
i++;
}
if (num == 6) {
indexArray_[5] = 7;
indexArray_[7] = 5;
}
if (num == 12) {
indexArray_[10] = 11;
indexArray_[11] = 12;
indexArray_[12] = 10;
}
var i = 0;
while (i < NUM_STARS) {
stars_[i] = eval ("this.s" + (indexArray_[i] + 1));
stars_[i]._alpha = 0;
stars_[i].myStatus = "off";
stars_[i].myIndex = 0;
i++;
}
var i = 0;
while (i < maxStars_) {
starBackgrounds_[i] = eval ("this.b" + (indexArray_[i] + 1));
starBackgrounds_[i]._alpha = 100;
i++;
}
var i = maxStars_;
while (i < NUM_STARS) {
starBackgrounds_[i] = eval ("this.b" + (indexArray_[i] + 1));
starBackgrounds_[i]._alpha = 0;
i++;
}
}
function addStars(num) {
if (num > 0) {
numStars_ = numStars_ + num;
numStars_ = ((numStars_ > maxStars_) ? (maxStars_) : (numStars_));
var _local2 = 0;
while (_local2 < numStars_) {
if (stars_[_local2].myStatus == "off") {
stars_[_local2].myStatus = "up";
}
_local2++;
}
}
}
function onEnterFrame() {
var _local2 = 0;
while (_local2 < NUM_STARS) {
if (stars_[_local2].myStatus == "up") {
stars_[_local2].myIndex = stars_[_local2].myIndex + 1;
stars_[_local2]._alpha = stars_[_local2].myIndex * stars_[_local2].myIndex;
stars_[_local2]._xscale = stars_[_local2].myIndex * 20;
stars_[_local2]._yscale = stars_[_local2].myIndex * 20;
if (stars_[_local2].myIndex >= 10) {
stars_[_local2]._alpha = 100;
stars_[_local2]._xscale = 100;
stars_[_local2]._yscale = 100;
stars_[_local2].myStatus = "on";
}
}
_local2++;
}
}
static var NUM_STARS = 15;
var numStars_ = 0;
}