Section 1
//wav (erase.wav)
package erase {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package erase
Section 2
//Timeline_1 (fla2flan_fla.Timeline_1)
package fla2flan_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_1 extends MovieClip {
public var scoreTextArea:TextField;
public var scoreExtraTextArea:TextField;
public var score:int;
public var button_startGame:SimpleButton;
public var button_manual:SimpleButton;
public var scoreExtra:int;
public var button_extra:SimpleButton;
public var button_return:SimpleButton;
public function Timeline_1(){
addFrameScript(0, frame1, 10, frame11, 20, frame21, 30, frame31);
}
public function checkBytes(_arg1:Event){
var _local2:int;
_local2 = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
if (_local2 >= 100){
this.removeEventListener(Event.ENTER_FRAME, checkBytes);
this.gotoAndStop("title");
};
}
public function extraAction(_arg1:MouseEvent):void{
Globals.extraMode = true;
Globals.startLevel = Globals.STARTLEVEL_EXTRA;
(parent as MovieClip).gotoAndStop("game");
}
function frame1(){
stop();
this.addEventListener(Event.ENTER_FRAME, checkBytes);
}
function frame21(){
stop();
score = SaveData.getInstance().score;
this.scoreTextArea.text = String(score);
scoreExtra = SaveData.getInstance().scoreExtra;
this.scoreExtraTextArea.text = String(scoreExtra);
button_extra.addEventListener(MouseEvent.CLICK, extraAction);
}
function frame31(){
stop();
button_return.addEventListener(MouseEvent.CLICK, returnAction);
}
function frame11(){
stop();
score = SaveData.getInstance().score;
this.scoreTextArea.text = String(score);
button_startGame.addEventListener(MouseEvent.CLICK, startGameAction);
button_manual.addEventListener(MouseEvent.CLICK, manualAction);
if (score >= Globals.SCORE_TO_EXTRA){
this.gotoAndStop("title_extra");
};
}
public function returnAction(_arg1:MouseEvent):void{
this.gotoAndStop("title");
}
public function manualAction(_arg1:MouseEvent):void{
this.gotoAndStop("manual");
}
public function startGameAction(_arg1:MouseEvent):void{
Globals.extraMode = false;
Globals.startLevel = Globals.STARTLEVEL_NORMAL;
(parent as MovieClip).gotoAndStop("game");
}
}
}//package fla2flan_fla
Section 3
//Timeline_13 (fla2flan_fla.Timeline_13)
package fla2flan_fla {
import flash.events.*;
import flash.display.*;
public dynamic class Timeline_13 extends MovieClip {
public var eye_mc:MovieClip;
public var eyeFrame:int;
public function Timeline_13(){
addFrameScript(0, frame1, 10, frame11);
}
public function repaintEye(_arg1:Event):void{
this.eye_mc.gotoAndStop((eyeFrame + 1));
eyeFrame = ((eyeFrame + 1) % 70);
}
function frame1(){
stop();
eyeFrame = 0;
this.addEventListener(Event.ENTER_FRAME, repaintEye);
}
function frame11(){
this.removeEventListener(Event.ENTER_FRAME, repaintEye);
}
}
}//package fla2flan_fla
Section 4
//FPSMC (net.chibitami.customMC.FPSMC)
package net.chibitami.customMC {
import flash.events.*;
import net.chibitami.gameUtil.*;
import flash.display.*;
import flash.text.*;
public dynamic class FPSMC extends MovieClip {
public var currentFPSTextArea:TextField;
public var maxFPSTextArea:TextField;
private var _fpsBalancer:FPSBalancer;
public function FPSMC(){
this._fpsBalancer = FPSBalancer.getInstance();
this.maxFPSTextArea.text = String(this.stage.frameRate);
this.currentFPSTextArea.text = String(this.stage.frameRate);
this.addEventListener(Event.ENTER_FRAME, enterFrame);
}
private function enterFrame(_arg1:Event):void{
this.currentFPSTextArea.text = String(this._fpsBalancer.fps);
this.gotoAndStop(this._fpsBalancer.quality);
}
}
}//package net.chibitami.customMC
Section 5
//ElapsedTimer (net.chibitami.gameUtil.ElapsedTimer)
package net.chibitami.gameUtil {
import flash.utils.*;
public class ElapsedTimer {
private var previousTime:int;
private var currentTime:int;
public function ElapsedTimer(){
this.currentTime = getTimer();
this.previousTime = -1;
}
public function getElapsedTime():int{
this.previousTime = this.currentTime;
this.currentTime = getTimer();
return ((this.currentTime - this.previousTime));
}
}
}//package net.chibitami.gameUtil
Section 6
//FPSBalancer (net.chibitami.gameUtil.FPSBalancer)
package net.chibitami.gameUtil {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class FPSBalancer extends MovieClip {
private var lowFPSCount:int;
private var timer:Timer;
private var enterFrameCount:int;
private var currentFps:int;
private static const CHECK_COUNT:int = 5;
private static const LOWFPS_RATE:Number = 0.833333333333333;
private static const SINGLETON_KEY:Object = new Object();
private static var instance:FPSBalancer;
public function FPSBalancer(_arg1:Object=null){
if (_arg1 != SINGLETON_KEY){
throw (new Error("エラー:FPSBalancerはSingletonです。getInstance()を使用してください。"));
};
this.currentFps = 0;
this.enterFrameCount = 0;
this.lowFPSCount = 0;
}
private function decreaseQuality():void{
if (this.stage.quality == "BEST"){
this.stage.quality = "HIGH";
} else {
if (this.stage.quality == "HIGH"){
this.stage.quality = "MEDIUM";
} else {
if (this.stage.quality == "MEDIUM"){
this.stage.quality = "LOW";
};
};
};
}
private function onTimer(_arg1:TimerEvent):void{
this.currentFps = this.enterFrameCount;
this.enterFrameCount = 0;
if (this.currentFps < (this.stage.frameRate * LOWFPS_RATE)){
this.lowFPSCount++;
if (this.lowFPSCount >= CHECK_COUNT){
this.decreaseQuality();
this.lowFPSCount = 0;
};
} else {
this.lowFPSCount = 0;
};
}
public function attachTo(_arg1:DisplayObjectContainer):void{
_arg1.addChild(this);
this.currentFps = this.stage.frameRate;
this.enterFrameCount = 0;
this.lowFPSCount = 0;
this.timer = new Timer(1000);
this.timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
this.timer.start();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
private function onEnterFrame(_arg1:Event):void{
this.enterFrameCount++;
}
public function get fps():int{
return (this.currentFps);
}
public function get quality():String{
return (stage.quality);
}
public static function getInstance():FPSBalancer{
if (!instance){
instance = new FPSBalancer(SINGLETON_KEY);
};
return (instance);
}
}
}//package net.chibitami.gameUtil
Section 7
//GameTimer (net.chibitami.gameUtil.GameTimer)
package net.chibitami.gameUtil {
import flash.events.*;
import flash.utils.*;
public class GameTimer {
private var timer:Timer;
private var time:int;
private var checkTime:int;
private var startTime:int;
private static const TIMER_INTERVAL_DEFAULT:int = 50;
public function GameTimer(_arg1:int=50){
this.time = 0;
this.timer = new Timer(_arg1);
this.timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
}
public function start():void{
this.startTime = getTimer();
this.time = 0;
this.checkTime = this.startTime;
this.timer.start();
}
public function getMillSecond():int{
return (this.time);
}
private function onTimer(_arg1:TimerEvent):void{
this.updateTime();
}
public function getString():String{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = "";
_local2 = this.getSecond();
_local3 = Math.floor((_local2 / 3600));
_local2 = (_local2 % 3600);
_local4 = Math.floor((_local2 / 60));
_local2 = (_local2 % 60);
if (_local3 > 0){
if (_local3 < 10){
_local1 = (_local1 + "0");
};
_local1 = (_local1 + (_local3 + ":"));
};
if (_local4 < 10){
_local1 = (_local1 + "0");
};
_local1 = (_local1 + (_local4 + ":"));
if (_local2 < 10){
_local1 = (_local1 + "0");
};
_local1 = (_local1 + _local2);
return (_local1);
}
public function resume():void{
this.checkTime = getTimer();
this.timer.start();
}
private function updateTime():void{
var _local1:int;
_local1 = getTimer();
this.time = (this.time + (_local1 - this.checkTime));
this.checkTime = _local1;
}
public function getSecond():int{
return (Math.floor((this.time / 1000)));
}
public function pause():void{
this.updateTime();
this.timer.stop();
}
}
}//package net.chibitami.gameUtil
Section 8
//KeyChecker (net.chibitami.gameUtil.KeyChecker)
package net.chibitami.gameUtil {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class KeyChecker extends MovieClip {
private var keyActionBuffer:Object;
private var elapsedTime:int;
private var previousTime:int;
private var doublePushInterval:int;
private var releasedTimeBuffer:Object;
private var currentTime:int;
private var currentStateBuffer:Object;
private static const KEYACTION_UP:int = 2;
private static const STATE_PUSHED:int = 3;
private static const STATE_UP:int = 2;
private static const STATE_RELEASED:int = 5;
private static const KEYACTION_DOWN:int = 1;
private static const STATE_DOWN:int = 1;
private static const KEYACTION_NONE:int = 0;
private static const STATE_DOUBLEPUSHED:int = 4;
private static const DOUBLEPUSHINTERVAL_DEFAULT:int = 200;
private static const SINGLETON_KEY:Object = new Object();
private static var instance:KeyChecker;
public function KeyChecker(_arg1:Object=null){
if (_arg1 != SINGLETON_KEY){
throw (new Error("エラー:KeyCheckerはSingletonです。getInstance()を使用してください。"));
};
this.currentStateBuffer = new Object();
this.releasedTimeBuffer = new Object();
this.keyActionBuffer = new Object();
this.doublePushInterval = DOUBLEPUSHINTERVAL_DEFAULT;
this.currentTime = getTimer();
this.previousTime = this.currentTime;
this.elapsedTime = 0;
}
public function isDown(_arg1:uint):Boolean{
var _local2:int;
_local2 = this.currentStateBuffer[_arg1.toString()];
if ((((((_local2 == STATE_DOWN)) || ((_local2 == STATE_PUSHED)))) || ((_local2 == STATE_DOUBLEPUSHED)))){
return (true);
};
return (false);
}
public function addKey(_arg1:uint):Boolean{
var _local2:String;
_local2 = _arg1.toString();
if (this.currentStateBuffer[_local2] != undefined){
return (false);
};
this.currentStateBuffer[_local2] = STATE_UP;
this.releasedTimeBuffer[_local2] = this.doublePushInterval;
this.keyActionBuffer[_local2] = KEYACTION_NONE;
return (true);
}
public function isPushed(_arg1:uint):Boolean{
var _local2:int;
_local2 = this.currentStateBuffer[_arg1.toString()];
if ((((_local2 == STATE_PUSHED)) || ((_local2 == STATE_DOUBLEPUSHED)))){
return (true);
};
return (false);
}
private function keyDownFunc(_arg1:KeyboardEvent):void{
var _local2:String;
_local2 = _arg1.keyCode.toString();
if (this.keyActionBuffer[_local2] != undefined){
this.keyActionBuffer[_local2] = KEYACTION_DOWN;
};
}
private function keyUpFunc(_arg1:KeyboardEvent):void{
var _local2:String;
_local2 = _arg1.keyCode.toString();
if (this.keyActionBuffer[_local2] != undefined){
this.keyActionBuffer[_local2] = KEYACTION_UP;
};
}
public function isUp(_arg1:uint):Boolean{
var _local2:int;
_local2 = this.currentStateBuffer[_arg1.toString()];
if ((((_local2 == STATE_UP)) || ((_local2 == STATE_RELEASED)))){
return (true);
};
return (false);
}
public function setDoublePushInterval(_arg1:int):void{
this.doublePushInterval = _arg1;
}
public function attachTo(_arg1:DisplayObjectContainer):void{
_arg1.addChild(this);
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunc, false, 0, true);
this.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpFunc, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
public function isReleased(_arg1:uint):Boolean{
var _local2:int;
_local2 = this.currentStateBuffer[_arg1.toString()];
if (_local2 == STATE_RELEASED){
return (true);
};
return (false);
}
public function isDoublePushed(_arg1:uint):Boolean{
var _local2:int;
_local2 = this.currentStateBuffer[_arg1.toString()];
if (_local2 == STATE_DOUBLEPUSHED){
return (true);
};
return (false);
}
private function update(_arg1:Event):void{
var _local2:String;
var _local3:int;
this.previousTime = this.currentTime;
this.currentTime = getTimer();
this.elapsedTime = (this.currentTime - this.previousTime);
for (_local2 in this.currentStateBuffer) {
_local3 = this.currentStateBuffer[_local2];
if (this.keyActionBuffer[_local2] == KEYACTION_DOWN){
if ((((_local3 == STATE_UP)) || ((_local3 == STATE_RELEASED)))){
if (this.releasedTimeBuffer[_local2] < this.doublePushInterval){
this.currentStateBuffer[_local2] = STATE_DOUBLEPUSHED;
} else {
this.currentStateBuffer[_local2] = STATE_PUSHED;
};
};
} else {
if (this.keyActionBuffer[_local2] == KEYACTION_UP){
if ((((((_local3 == STATE_DOWN)) || ((_local3 == STATE_PUSHED)))) || ((_local3 == STATE_DOUBLEPUSHED)))){
this.releasedTimeBuffer[_local2] = 0;
this.currentStateBuffer[_local2] = STATE_RELEASED;
};
} else {
if ((((_local3 == STATE_PUSHED)) || ((_local3 == STATE_DOUBLEPUSHED)))){
this.currentStateBuffer[_local2] = STATE_DOWN;
} else {
if (_local3 == STATE_RELEASED){
this.currentStateBuffer[_local2] = STATE_UP;
} else {
if (_local3 == STATE_UP){
this.releasedTimeBuffer[_local2] = Math.min((this.releasedTimeBuffer[_local2] + this.elapsedTime), this.doublePushInterval);
};
};
};
};
};
this.keyActionBuffer[_local2] = KEYACTION_NONE;
};
}
public static function getInstance():KeyChecker{
if (!instance){
instance = new KeyChecker(SINGLETON_KEY);
};
return (instance);
}
}
}//package net.chibitami.gameUtil
Section 9
//wav (set.wav)
package set {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package set
Section 10
//Block (Block)
package {
import flash.display.*;
public dynamic class Block extends MovieClip {
private var _color:int;
public function Block(_arg1:int=1){
this._color = _arg1;
this.gotoAndStop(this._color);
}
public function get color():int{
return (this._color);
}
}
}//package
Section 11
//BlockLine (BlockLine)
package {
import flash.display.*;
public dynamic class BlockLine extends MovieClip {
public var currentBlock_mc:MovieClip;
private var _currentColor:int;
private var _blockArray:Array;
private static const BLOCK_HEIGHT:int = 60;
private static const ARRAY_MAX:int = 15;
public function setCurrentColor(_arg1:int):void{
if (_arg1 == 0){
this.currentBlock_mc.visible = false;
} else {
this.currentBlock_mc.visible = true;
this._currentColor = _arg1;
this.currentBlock_mc.gotoAndStop(_arg1);
};
}
public function init(_arg1:int):void{
var _local2:Block;
var _local3:Block;
if (this._blockArray != null){
while (this._blockArray.length != 0) {
_local3 = Block(this._blockArray.pop());
this.removeChild(_local3);
};
};
this._blockArray = new Array();
this.currentBlock_mc.x = 0;
this.currentBlock_mc.y = BLOCK_HEIGHT;
this.currentBlock_mc.visible = false;
_local2 = new Block(_arg1);
_local2.x = 0;
_local2.y = (this._blockArray.length * BLOCK_HEIGHT);
this._blockArray.push(_local2);
this.addChild(_local2);
}
public function getBlockNum():int{
if (this._blockArray.length <= 13){
return (this._blockArray.length);
};
return (40);
}
public function setBlock():int{
var _local1:Block;
var _local2:Boolean;
var _local3:int;
var _local4:Block;
var _local5:*;
_local1 = new Block(this._currentColor);
_local1.x = 0;
_local1.y = (this._blockArray.length * BLOCK_HEIGHT);
if (this._blockArray.length < ARRAY_MAX){
this._blockArray.push(_local1);
};
this.addChild(_local1);
_local2 = false;
_local3 = 0;
if ((((this._blockArray.length >= 3)) && ((Block(this._blockArray[(this._blockArray.length - 3)]).color == this._currentColor)))){
_local3 = 3;
_local5 = 0;
while (_local5 < 3) {
_local4 = Block(this._blockArray.pop());
this.removeChild(_local4);
_local5++;
};
};
this.currentBlock_mc.y = (this._blockArray.length * BLOCK_HEIGHT);
return (_local3);
}
}
}//package
Section 12
//CurrentBlock (CurrentBlock)
package {
import flash.display.*;
public dynamic class CurrentBlock extends MovieClip {
}
}//package
Section 13
//DocumentClass (DocumentClass)
package {
import flash.events.*;
import net.chibitami.gameUtil.*;
import flash.display.*;
import flash.ui.*;
import flash.system.*;
public class DocumentClass extends MovieClip {
private var _keyChecker:KeyChecker;
private var _fpsBalancer:FPSBalancer;
public var game:Game;
public function DocumentClass(){
var _local1:KeyChecker;
var _local2:ContextMenu;
super();
addFrameScript(0, frame1, 9, frame10);
this._keyChecker = KeyChecker.getInstance();
this._keyChecker.attachTo(this.stage);
_local1 = KeyChecker.getInstance();
_local1.addKey(Key.UP);
_local1.addKey(Key.DOWN);
_local1.addKey(Key.LEFT);
_local1.addKey(Key.RIGHT);
_local1.addKey(Key.OK1);
_local1.addKey(Key.OK2);
this._fpsBalancer = FPSBalancer.getInstance();
this._fpsBalancer.attachTo(this.stage);
_local2 = new ContextMenu();
_local2.hideBuiltInItems();
MovieClip(this.root).contextMenu = _local2;
this.disableIME();
}
function frame10(){
this.stop();
this.disableIME();
this.game.init(Globals.startLevel);
this.addEventListener(Event.ENTER_FRAME, enterFrame);
}
function frame1(){
this.stop();
}
public function enterFrame(_arg1:Event):void{
this.game.enterFrame();
}
public function disableIME():void{
try {
if (Capabilities.hasIME){
IME.enabled = false;
};
} catch(error:Error) {
};
}
}
}//package
Section 14
//Game (Game)
package {
import flash.events.*;
import net.chibitami.gameUtil.*;
import flash.display.*;
public dynamic class Game extends MovieClip {
private var _keyChecker:KeyChecker;
public var blockLine1_mc:BlockLine;
public var blockLine4_mc:BlockLine;
private var _sePlayer:SEPlayer;
public var blockLine7_mc:BlockLine;
private var _currentColor:int;
public var blockLine2_mc:BlockLine;
public var blockLine5_mc:BlockLine;
private var _state:int;
public var blockLine8_mc:BlockLine;
private var _currentPos:int;
public var blockLine3_mc:BlockLine;
public var gameState:GameState;
private var _blockLineArray:Array;
public var blockLine6_mc:BlockLine;
public static const STATE_GAMEOVER:int = 3;
private static const INIT_COLORS:Array = new Array(1, 2, 3, 4, 4, 3, 2, 1);
private static const BLOCKLINE_NUM:int = 4;
public static const STATE_RETRY:int = 4;
public static const STATE_ACTIVE:int = 2;
public function Game(){
addFrameScript(439, frame440, 470, frame471, 480, frame481);
}
public function init(_arg1:int=1):void{
var _local2:int;
var _local3:BlockLine;
this._state = STATE_ACTIVE;
this.gameState.init(_arg1);
this._sePlayer = new SEPlayer();
this._keyChecker = KeyChecker.getInstance();
this._blockLineArray = new Array((BLOCKLINE_NUM * 2));
_local2 = 0;
while (_local2 < (BLOCKLINE_NUM * 2)) {
_local3 = BlockLine(getChildByName((("blockLine" + (_local2 + 1)) + "_mc")));
_local3.init(INIT_COLORS[_local2]);
this._blockLineArray[_local2] = _local3;
_local2++;
};
this._currentColor = this.gameState.getNextColor();
this._currentPos = (BLOCKLINE_NUM - 1);
this.gotoAndStop((GameState.BALANCE_MAX + 1));
BlockLine(this._blockLineArray[this._currentPos]).setCurrentColor(this._currentColor);
this.gotoAndStop((GameState.BALANCE_MAX + 1));
}
private function checkKeys():void{
if (this._keyChecker.isPushed(Key.LEFT)){
BlockLine(this._blockLineArray[this._currentPos]).setCurrentColor(0);
this._currentPos = Math.max(0, (this._currentPos - 1));
BlockLine(this._blockLineArray[this._currentPos]).setCurrentColor(this._currentColor);
} else {
if (this._keyChecker.isPushed(Key.RIGHT)){
BlockLine(this._blockLineArray[this._currentPos]).setCurrentColor(0);
this._currentPos = Math.min(((BLOCKLINE_NUM * 2) - 1), (this._currentPos + 1));
BlockLine(this._blockLineArray[this._currentPos]).setCurrentColor(this._currentColor);
};
};
if (((this._keyChecker.isPushed(Key.OK1)) || (this._keyChecker.isPushed(Key.OK2)))){
this.setBlock();
this.gameState.resetForceSetTime();
};
}
function frame440(){
this.gotoAndStop("retryCheck");
}
private function setBlock():void{
var _local1:int;
_local1 = BlockLine(this._blockLineArray[this._currentPos]).setBlock();
this._currentColor = this.gameState.getNextColor();
this._sePlayer.play(SEPlayer.SET);
if (_local1 > 0){
this._sePlayer.play(SEPlayer.ERASE);
this.gameState.score = (this.gameState.score + _local1);
};
BlockLine(this._blockLineArray[this._currentPos]).setCurrentColor(this._currentColor);
}
public function enterFrame():void{
var _local1:int;
if (this._state == STATE_ACTIVE){
this.checkKeys();
if (this.gameState.checkForceSet()){
this.setBlock();
};
_local1 = this.getMoment();
this.gameState.setMoment(_local1);
this.gameState.update();
this.gotoAndStop(((int(this.gameState.balance) + GameState.BALANCE_MAX) + 1));
if (this.gameState.gameOverFlag){
this._state = STATE_GAMEOVER;
if (Globals.extraMode){
if (SaveData.getInstance().scoreExtra < this.gameState.score){
SaveData.getInstance().scoreExtra = this.gameState.score;
};
} else {
if (SaveData.getInstance().score < this.gameState.score){
SaveData.getInstance().score = this.gameState.score;
};
};
if (this.gameState.balance > 0){
this.gotoAndPlay("gameOver_right");
} else {
this.gotoAndPlay("gameOver_left");
};
};
} else {
if (this._state == STATE_RETRY){
if (((this._keyChecker.isPushed(Key.OK1)) || (this._keyChecker.isPushed(Key.OK2)))){
this.init(Globals.startLevel);
};
};
};
}
public function get state():int{
return (this._state);
}
function frame481(){
stop();
this._state = Game.STATE_RETRY;
}
function frame471(){
this.gotoAndStop("retryCheck");
}
private function getMoment():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < BLOCKLINE_NUM) {
_local1 = (_local1 - (BlockLine(this._blockLineArray[_local2]).getBlockNum() * ((BLOCKLINE_NUM - _local2) + 1)));
_local2++;
};
_local2 = BLOCKLINE_NUM;
while (_local2 < (BLOCKLINE_NUM * 2)) {
_local1 = (_local1 + (BlockLine(this._blockLineArray[_local2]).getBlockNum() * (((_local2 - BLOCKLINE_NUM) + 1) + 1)));
_local2++;
};
return (_local1);
}
}
}//package
Section 15
//GameState (GameState)
package {
import net.chibitami.gameUtil.*;
import flash.display.*;
import flash.text.*;
public dynamic class GameState extends MovieClip {
public var nextColor_mc:Block;
private var _elapsedTimer:ElapsedTimer;
public var scoreTextArea:TextField;
private var _gameTimer:GameTimer;
private var _forceSetTimeRest:int;
private var _vBalancePerMoment:Number;
public var timeTextArea:TextField;
private var _gameOverFlag:Boolean;
private var _color:int;
public var timeGauge_mc:MovieClip;
private var _colorMax:int;
private var _level:int;
public var score:int;
private var _forceSetTimeInterval:int;
private var _balance:Number;
private var _startLevel:int;
public static const BALANCE_MAX:int = 200;
public function get balance():Number{
return (this._balance);
}
public function init(_arg1:int):void{
this.score = 0;
this._gameTimer = new GameTimer();
this._gameTimer.start();
this._elapsedTimer = new ElapsedTimer();
this._balance = 0;
this._vBalancePerMoment = 0;
this._gameOverFlag = false;
this._startLevel = _arg1;
this.setLevel(0);
this._forceSetTimeRest = this._forceSetTimeInterval;
this._color = (Math.floor((Math.random() * this._colorMax)) + 1);
this.nextColor_mc.gotoAndStop(this._color);
}
public function setMoment(_arg1:int){
if (_arg1 == 0){
if (this._balance > 0){
this._balance = (this._balance - Math.min(this._balance, 0.4));
} else {
if (this._balance < 0){
this._balance = (this._balance + Math.min((-1 * this._balance), 0.4));
};
};
};
this._balance = (this._balance + (_arg1 * this._vBalancePerMoment));
if ((((this._balance > BALANCE_MAX)) || ((this._balance < (-1 * BALANCE_MAX))))){
this._gameOverFlag = true;
};
}
private function setLevel(_arg1:int):void{
this._level = (Math.floor((_arg1 / 6)) + this._startLevel);
this._vBalancePerMoment = (0.004 * (20 + this.level));
this._forceSetTimeInterval = Math.max(1500, (5000 - (this._level * 40)));
if (level <= 50){
this._colorMax = 6;
} else {
if (level <= 100){
this._colorMax = 7;
} else {
this._colorMax = 8;
};
};
}
public function get level():int{
return (this._level);
}
public function get gameOverFlag():Boolean{
return (this._gameOverFlag);
}
public function checkForceSet():Boolean{
var _local1:Boolean;
_local1 = false;
this._forceSetTimeRest = (this._forceSetTimeRest - this._elapsedTimer.getElapsedTime());
if (this._forceSetTimeRest < 0){
_local1 = true;
this._forceSetTimeRest = this._forceSetTimeInterval;
};
return (_local1);
}
public function getNextColor():int{
var _local1:int;
_local1 = this._color;
this._color = (Math.floor((Math.random() * this._colorMax)) + 1);
this.nextColor_mc.gotoAndStop(this._color);
return (_local1);
}
public function update():void{
this.setLevel(this._gameTimer.getSecond());
this.timeTextArea.text = this._gameTimer.getString();
this.scoreTextArea.text = String(this.score);
this.timeGauge_mc.width = ((250 * this._forceSetTimeRest) / this._forceSetTimeInterval);
}
public function resetForceSetTime():void{
this._forceSetTimeRest = this._forceSetTimeInterval;
}
}
}//package
Section 16
//Globals (Globals)
package {
public class Globals {
public static const STARTLEVEL_EXTRA:int = 101;
public static const SCORE_TO_EXTRA:int = 500;
public static const STARTLEVEL_NORMAL:int = 1;
public static var startLevel:int = 1;
public static var extraMode:Boolean = false;
}
}//package
Section 17
//Key (Key)
package {
public class Key {
public static const DOWN:uint = 40;
public static const LEFT:uint = 37;
public static const OK1:uint = 32;
public static const UP:uint = 38;
public static const RIGHT:uint = 39;
public static const OK2:uint = 90;
}
}//package
Section 18
//SaveData (SaveData)
package {
import flash.net.*;
public class SaveData {
private var shared_so:SharedObject;
private static const SINGLETON_KEY:Object = new Object();
private static var instance:SaveData;
public function SaveData(_arg1:Object=null){
if (_arg1 != SINGLETON_KEY){
throw (new Error("SingletonError"));
};
shared_so = SharedObject.getLocal("net.chibitami.fla2flan", "/");
if (this.shared_so.data.score == null){
this.shared_so.data.score = 0;
};
if (this.shared_so.data.scoreExtra == null){
this.shared_so.data.scoreExtra = 0;
};
}
public function get score():int{
return (this.shared_so.data.score);
}
public function set score(_arg1:int):void{
this.shared_so.data.score = _arg1;
}
public function set scoreExtra(_arg1:int):void{
this.shared_so.data.scoreExtra = _arg1;
}
public function get scoreExtra():int{
return (this.shared_so.data.scoreExtra);
}
public static function getInstance():SaveData{
if (!instance){
instance = new SaveData(SINGLETON_KEY);
};
return (instance);
}
}
}//package
Section 19
//SEPlayer (SEPlayer)
package {
import flash.utils.*;
import flash.media.*;
public class SEPlayer {
private var soundArray:Array;
public static const SET:int = 0;
public static const ERASE:int = 1;
private static const SOUNDNAME:Array = new Array("set", "erase");
private static const NUM_SOUND:int = 2;
public function SEPlayer(){
var _local1:int;
var _local2:Class;
super();
this.soundArray = new Array(NUM_SOUND);
this.soundArray = new Array(NUM_SOUND);
_local1 = 0;
while (_local1 < NUM_SOUND) {
_local2 = Class(getDefinitionByName((SOUNDNAME[_local1] + ".wav")));
this.soundArray[_local1] = (new (_local2) as Sound);
_local1++;
};
}
public function play(_arg1:int):void{
(this.soundArray[_arg1] as Sound).play();
}
}
}//package