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

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

forked from: 雑魚ゲー

実はゲームになってません。
Mouseで移動 
Zで攻撃 
Xでジャンプ
MRSSつかってみました。いろんなところで戦えます。
雑魚絵は友人作成です。
死亡演出追加
体力を3にしたり、ツイートボタン追加したり。
Get Adobe Flash player
by hacker_brf0gepu 25 Aug 2010
/**
 * Copyright hacker_brf0gepu ( http://wonderfl.net/user/hacker_brf0gepu )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/dNzc
 */

// forked from kuma360's 雑魚ゲー
//実はゲームになってません。
//
//Mouseで移動 
//Zで攻撃 
//Xでジャンプ
//
//MRSSつかってみました。いろんなところで戦えます。
//雑魚絵は友人作成です。
//
//死亡演出追加
//体力を3にしたり、ツイートボタン追加したり。
package 
{
    import flash.display.*;
    import flash.events.*;
    import flash.geom.ColorTransform;
    import flash.net.URLRequest;
    import flash.system.LoaderContext;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import com.bit101.components.PushButton;
    import flash.net.navigateToURL;
    import flash.utils.escapeMultiByte;
    
    [SWF(width=465 , height=465 , backgroundColor='#000000' , frameRate='60')]
    public class Main extends Sprite 
    {
        private var _canvas:BitmapData = null ;
        private var _key:Array = null ;
        
        private var _mainHero:Hero = null ;
        private var _h:Vector.<Hero> = null ;
        private var _effect:Effect = null ;
        private var _back:MRSS = null ;
        
        private var _scoreText:TextField = new TextField ;
        private var _button:PushButton ;
        
        ////////////////////////////////////
        public function Main() {
            
            var I:int = 0 ;
            
            //キャンバス用意
            _canvas = new BitmapData ( stage.stageWidth , stage.stageHeight , false , 0 ) ;
            addChild ( new Bitmap ( _canvas ) ) ;
            
            //背景用
            _back = new MRSS ;
            
            //キャラクター用t
            _h = new Vector.<Hero>;
            
            //ヒットマーク用
            _effect = new Effect ;
            
            //スコア
            _score = 0 ;
            
            _scoreText.autoSize = "left" ;
            _scoreText.defaultTextFormat = new TextFormat ( null , 15 , 0xFFFFFF ) ;
            _scoreText.text = _score.toString () ;
            addChild ( _scoreText ) ;
            
            //送信ボタン
            _button = new PushButton ( this , 0 , 0 , "Tweet" );
            _button.x = ( 465 - _button.width  ) / 2 ;
            _button.y = ( 465 - _button.height ) / 2 ;
            _button.visible = false ;
            _button.addEventListener ( MouseEvent.CLICK , function ():void { navigateToURL ( new URLRequest ( "http://twitter.com/home?status=" + escapeMultiByte ( "雑魚ゲー http://wonderfl.net/c/vAlp   がんばりました。 score=" + _score ) ) ); } ) ;
            
            //入力用
            _key = new Array ( 256 ) ;
            for ( I = 0; I < 256; ++I ) { _key[I] = false; }
            stage.addEventListener( KeyboardEvent.KEY_DOWN, function ( E:KeyboardEvent ):void { _key[ E.keyCode ] = true;  } );
            stage.addEventListener( KeyboardEvent.KEY_UP  , function ( E:KeyboardEvent ):void { _key[ E.keyCode ] = false; } );
            
            //キャラクタ画像読み込み
            var L:Loader = new Loader;
            L.contentLoaderInfo.addEventListener ( Event.COMPLETE, compLoad ) ;
            L.contentLoaderInfo.addEventListener ( IOErrorEvent.IO_ERROR , function ():void { } ) ;
            L.load ( new URLRequest ( FILENAME ) , new LoaderContext ( true ) ) ;
            
        }
        
        ////////////////////////////////////
        private function compLoad( e:Event ):void {
            
            var B:Bitmap = e.target.content as Bitmap ;
            
            _mainHero = new Hero ( B ) ;
            _h.push ( _mainHero ) ;
            
            _h.push ( new Hero ( B , new ColorTransform ( .2 , 1 , .4 , 1 ) ) ) ;
            _h.push ( new Hero ( B , new ColorTransform ( .2 , 1 , .4 , 1 ) ) ) ;
            _h.push ( new Hero ( B , new ColorTransform ( .2 , 1 , .4 , 1 ) ) ) ;
            _h.push ( new Hero ( B , new ColorTransform ( .2 , 1 , .4 , 1 ) ) ) ;
            
            addEventListener ( Event.ENTER_FRAME , run ) ;
            
        }
                
        ////////////////////////////////////
        private function run ( e:Event ):void {
            
            var TH1:Hero ;
            var TH2:Hero ;
            
            //背景
            _back.render ( _canvas ) ;
            
            //入力
            for each ( TH1 in _h ) {
                if ( TH1 == _mainHero ) {
                    _mainHero.input ( mouseX , mouseY , _key[90] , _key[88] ) ;
                } else {
                    TH1.inputAuto() ;
                }
            }
            
            //更新
            for each ( TH1 in _h ) {
                TH1.update () ;
            }
            
            //攻撃判定
            for each ( TH1 in _h ) {
                for each ( TH2 in _h ) {
                    TH1.attackChk ( TH2 , _effect ) ;
                }
            }
            
            //移動判定
            for each ( TH1 in _h ) {
                for each ( TH2 in _h ) {
                    TH1.moveChk ( TH2 ) ;
                }
            }
            
            //影描画
            for each ( TH1 in _h ) {
                TH1.render_shadow ( _canvas ) ;
            }
            
            //描画
           _h.sort ( function ( A:Hero , B:Hero ) :Number { return A.z - B.z ; } ) ;
            for each ( TH1 in _h ) {
                TH1.render ( _canvas ) ;
            }
            
            _effect.update () ;
            _effect.render ( _canvas ) ;
            
            _scoreText.text = _score.toString () ;
            
            if ( _end ) {
                _button.visible = true ;
            }
            
            
        }
        
    }
    
}



import flash.display.*;
import flash.geom.*;
import flash.events.Event;
import flash.filters.BlurFilter;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.system.LoaderContext;


class MRSS {
    
    //landscape
    private const _feed:String = "http://api.flickr.com/services/feeds/photos_public.gne?tags=grass,plain,landscape&format=rss_200";
    private const _media:Namespace = new Namespace ( "http://search.yahoo.com/mrss/" ) ;
    
    private var _length:uint = 0 ;
    private var _cnt:int = 0 ;
    private var _V:Vector.<BitmapData> = new Vector.<BitmapData> ;
    private var _now:BitmapData = null ;
    
    ////////////////////////////////////
    public function MRSS() {
        
        _cnt = 60 * 5 ;
        
        var s:Sprite = new Sprite ;
        var G:Graphics = s.graphics ;
        G.beginFill ( 0x91ACCE , 1 ) ; G.drawRect  ( 0 , 0 , 465 , ZMAX ) ; G.endFill   () ;
        G.beginFill ( 0x75D36D , 1 ) ; G.drawRect  ( 0 , ZMAX , 465 , 465 ) ; G.endFill   () ;
        _now = new BitmapData ( 465 , 465 , false , 0 ) ;
        _now.draw ( s ) ;
        
        var ldr:URLLoader = new URLLoader;
        ldr.addEventListener ( Event.COMPLETE, function _load(e:Event):void {
            ldr.removeEventListener(Event.COMPLETE, _load);
            Loaded ( XML(ldr.data).._media::thumbnail.@url.toXMLString().split('\n') );
        } );
        ldr.load ( new URLRequest ( _feed ) ) ;
        
    }
    
    
    ////////////////////////////////////
    private function Loaded ( $images:Array ) :void {
        
        _length = $images.length ;
        for ( var i:int = 0; i < _length ; ++i ) {
            
            var ldr:Loader;
            ldr = new Loader;
            ldr.contentLoaderInfo.addEventListener ( Event.COMPLETE , Loadcomp ) ;
            
            var strArray:String = $images[ i ].replace ( "_s" , "" ) ;
            ldr.load ( new URLRequest ( strArray ) , new LoaderContext ( true ) ) ;
            
        }
        
    }
    
    
    ////////////////////////////////////
    private function Loadcomp ( e:Event ) :void {
        
        var data:Bitmap = e.target.content as Bitmap ;
        
        if ( data ) {
            
            var m:Matrix = new Matrix;
            m.scale ( 465 / data.width , 465 / data.height ) ;
            
            var b:BitmapData = new BitmapData ( 465 , 465 , false , 0 ) ;
            b.draw ( data , m ) ;
            
            _V.push ( b ) ;
            
        }
        
    }
    
    
    
    ////////////////////////////////////
    public function render ( canvas:BitmapData ) :void {
        
        if ( 60 * 5 < ++ _cnt && _V.length ) {
            _cnt = 0 ;
            _now = _V [ Math.floor ( Math.random() * _V.length ) ] ;
        }
        
        canvas.copyPixels ( _now , _now.rect , ZERO_POINT ) ;
        
    }
    
}

class Effect {
    
    private var _img:BitmapData = null ;
    private var _V:Vector.<Object> = new Vector.<Object> ;
    
    ////////////////////////////////////
    public function Effect() {
    
        _img = new BitmapData ( 50 , 50 , true , 0 ) ;
        
        var S:Sprite = new Sprite ;
        var G:Graphics = S.graphics ;
        var M:Matrix = new Matrix ;
        M.createGradientBox ( 50 , 50 , 0 , 0 , 0 ) ;
        G.lineStyle ( 1 ) ;
        G.lineGradientStyle ( "radial" , [ 0xFFFFFF , 0xFFA020 ] , [ 1 , 0 ] , [ 0 , 255 ] , M ) ;
        for ( var I:int = 0 ; I < 50 ; ++ I ) {
            G.moveTo ( 25 , 25 ) ;
            var R:Number = I / 50 * 360 * Math.PI / 180 ;
            G.lineTo ( Math.cos ( R ) * 25 + 25 , Math.sin ( R ) * 25 + 25 ) ;
        }
        S.filters = [ new BlurFilter ] ;
        _img.draw ( S ) ;
        
    }
    
    ////////////////////////////////////
    public function push ( x:int , y:int ) :void {
        _V.push ( { P:new Point ( x - _img.width * .5 , y - _img.height * 1.5 ) , T:6 } ) ;
    }
    
    ////////////////////////////////////
    public function update () :void {
        for ( var I:int = 0 ; I < _V.length ; ++ I ) {
            if ( -- _V[I].T < 0 ) {
                _V.splice ( I , 1 ) ;
            }
        }
    }
    
    ////////////////////////////////////
    public function render ( canvas:BitmapData ) :void {
        for each ( var O:Object in _V ) {
            canvas.copyPixels ( _img , _img.rect , O.P ) ;
        }
    }
    
}

class Hero {
    
    //キャラクタのスケール
    private const SCALE:Number = 1.5 ;
    
    //キャラクタの実サイズ
    private const SIZE :int = 64 * SCALE ;
    
    //ユニークID管理
    private static var _UNIQUE:int = 0 ;
    private var _id:int = 0 ;
    
    //体力
    private var _hp:int = 0 ;
    private var _death:Boolean = false ;
    private var _death_cnt:int = 0;
    
    //画像
    private var _img:BitmapData = null ;
    private var _img_r:BitmapData = null ;
    private var _shadow:BitmapData = null ;
    
    //アニメーション用
    private var _animrect:Rectangle = null ;
    private var _animwait:int = 0 ;
    private var _anim:int = 0 ;
    private var _action:int = 0 ;
    private var _actionstep:int = 0 ;
    private var _dirc:Boolean = false;
    
    //移動用
    private var _speed:Number = 0 ;
    private var _target_x:int = 0 ;
    private var _target_z:int = 0 ;
    private var _pos:Vector3D = null ;
    private var _velocity:Vector3D = null ;
    
    //描画用
    private var _renderpos:Point = null ;
    private var _shadowpos:Point = null ;
    
    //入力用
    private var _input_damage:Boolean = false ;
    private var _input_attack:Boolean = false ;
    private var _input_jump  :Boolean = false ;
    
    //ジャンプ管理
    private var _jump_state:Boolean = false;
    
    //攻撃管理
    private var _attack_state:int = 0 ;
    private var _attack_shake:int = 0 ;
    private var _hitRegist:Vector.<int> = null ;
    
    //被ダメージ管理
    private var _damage_action:int = 0 ;
    private var _damage_shake:int = 0 ;
    
    ////////////////////////////////////
    public function Hero ( B:Bitmap , C:ColorTransform = null ) {
        
        _id = _UNIQUE ++ ;
        
        var M:Matrix = new Matrix ;
        var S:Sprite = new Sprite;
        var G:Graphics = S.graphics;
        var I:int = 0 ;
        var J:int = 0 ;
        
        var S1:Number = 30 * SCALE ;
        var S2:Number = 12 * SCALE ;
        var S3:Number = B.width * SCALE ;
        var S4:Number = B.height * SCALE ;
        
        //スケーリング
        M.scale ( SCALE , SCALE ) ;
        
        //影
        G.beginFill ( 0 , .5 ) ;
        G.drawEllipse ( 0 , 0 , S1 , S2 ) ;
        G.endFill () ;
        _shadow = new BitmapData ( S1 , S2 , true , 0 ) ;
        _shadow.draw ( S ) ;
        
        //キャラクタ-
        _img = new BitmapData ( S3 , S4 , true , 0 ) ;
        _img.draw ( B , M , C ) ;
        
        //反転キャラクター
        _img_r = new BitmapData ( S3 , S4 , true , 0 ) ;
        for ( I = 0 ; I < S3 ; I += SIZE ) {
            for ( J = 0 ; J < SIZE ; ++ J ) {
                _img_r.copyPixels ( 
                    _img , 
                    new Rectangle ( I + J , 0 , 1 , S4 ) , 
                    new Point ( I + SIZE - J , 0 ) 
                ) ;
            }
        }
        
        //
        _renderpos = new Point ;
        _shadowpos = new Point ;
        _velocity  = new Vector3D ;
        _pos       = new Vector3D ( Math.random()*465 , 0 , Math.random() * 100 + 300 ) ;
        _animrect  = new Rectangle ( 0 , 0 , SIZE , SIZE ) ;
        _hitRegist = new Vector.<int> ;
        
        //
        input ( Math.random() * 400 , 300 + Math.random() * 150 , false , false ) ;
        
        //
        _hp = 3 ;
        _death = false ;
        _death_cnt = 0 ;
        
    }
    
    ////////////////////////////////////
    public function get z():Number {
        return _pos.z;
    }
    
    ////////////////////////////////////
    public function input ( x:int , y:int , keyA:Boolean , keyJ:Boolean ):void {
        _input_attack = keyA ;
        _input_jump   = keyJ ;
        _target_x     = x ;
        _target_z     = y ;
    }
    
    ////////////////////////////////////
    public function inputAuto ( ):void {
        
        _input_attack = Math.random() < 0.01 ;
        _input_jump   = Math.random() < 0.01 ;
        
        var V:Vector3D = _pos.clone() ;
        V.x -= _target_x ;
        V.z -= _target_z ;
        if ( V.length < 20 * SCALE ) {
            _target_x = Math.random() * 465 ;
            _target_z = Math.random() * 120 + 300 ;
        }
    }
    
    ////////////////////////////////////
    public function update ( ):void {
        
        var CHK:Boolean = true ;
        var TC:int = $C[_action][_actionstep] ;
        var Ba:int = _action;
        var Bas:int = _actionstep;
        var X:Number = 0 ;
        var Y:Number = 0 ;
        var L:Number = 0 ;
        
        if ( _death ) {
            
            if ( 60 < ++ _death_cnt ) {
                
                if ( _id ) {
                    
                    _hp = 3 ;
                    _death = false ;
                    _death_cnt = 0 ;
                    
                    _pos.x = ( Math.random() < .5 )? -100 : 500 ;
                    _pos.y = 0 ;
                    _velocity.y = 0 ;
                    
                    _action = 12 ;
                    
                } else {
                    
                    _end = true ;
                    
                }
                
            }
            
        }
        
        if ( 0 < _damage_shake ) {
            CHK = false ;
            -- _damage_shake ;
        }
        
        if ( 0 < _attack_shake ) {
            CHK = false ;
            -- _attack_shake ;
        }
        
        {//入力の反映
            
            if ( 1 & TC ) {
                
                X = _pos.x - _target_x ;
                Y = _pos.z - _target_z ;
                L = X * X + Y * Y ;
                _action = ( 10 * 10 < L )? 1 : 0 ;
                
            }
            
            if ( 2 & TC ) {
                
                if ( _input_attack ) {
                    
                    if ( _jump_state ) {
                        
                        _action = 6 ;
                        
                    } else {
                        
                        switch ( _attack_state ) {
                            case 0 : _attack_state = 1 ;  _action = 3 ; break ;
                            case 1 : _attack_state = 2 ;  _action = 7 ; break ;
                            case 2 : _attack_state = 0 ;  _action = 4 ; break ;
                        }
                    }
                    
                } else {
                    
                    _attack_state = 0 ; 
                    
                }
                
            }
            
            if ( 4 & TC ) {
                if ( _input_jump ) {
                    _action = 2 ;
                }
            }
            
            //強制動作
            if ( _damage_action ) {
                _action = _damage_action ;
                _damage_action = 0 ;
            }
            
            if ( Ba != _action ) {
                
                _actionstep = 0 ;
                _animwait = 0 ;
                
            }
            
        }
        
        if ( CHK ) 
        {//アニメーション
            
            var TD:int = $D[_action][_actionstep];
            switch ( TD ) {
                
                case 0 :
                    ++ _animwait;
                    break ;
                
                case 1 :
                    if ( 0 < _velocity.y ) {
                        ++ _animwait ;
                    }
                    break ;
                
                case 2:
                    if ( false == _jump_state ) {
                        ++ _animwait ;
                    }
                    break;
                    
                case 3:
                    break;
            }
            
            if ( $B[_action][_actionstep] <= _animwait ) {
                
                _animwait = 0 ;
                
                switch ( $E[_action][_actionstep] ) {
                    case  1: _velocity.y = -5 ; break;
                    case  2: _action = (_jump_state)? 12 : 0 ; break ;
                    default: break;
                }
                
                if ( $A[_action].length <= ++ _actionstep ) {
                    _actionstep = 0 ;
                }
                
                while ( _hitRegist.length ) {
                    _hitRegist.pop () ;
                }
                
            }
            
        }
        
        if ( CHK && ( 1 & TC ) )
        {//加速
            
            _dirc = ( _target_x < _pos.x ) ;
            
            var ty:Number = _velocity.y;
            _velocity.y = 0 ;
            
            X = ( _target_x - _pos.x ) ;
            Y = ( _target_z - _pos.z ) ;
            L = X * X + Y * Y ;
            if ( 10 * 10 < L ) {
                _velocity.x += X * .01 ;
                _velocity.z += Y * .01 ;
            }
            
            _speed = _velocity.length ;
            _speed = ( 2 < _speed )? 2 : _speed ;
            
            _velocity.normalize ( ) ;
            _velocity.scaleBy ( _speed ) ;
            
            _velocity.y = ty ;
            
        }
        
        if ( CHK ) 
        {//移動
            
            _pos.x += _velocity.x * SCALE ;
            _pos.y += _velocity.y * SCALE ;
            _pos.z += _velocity.z * SCALE *.5 ;
            _velocity.y += .2 ;
            
            if ( false == _jump_state ) {
                _velocity.x *= .9 ;
                _velocity.z *= .9 ;
            }
            
            if ( 0 <= _pos.y ) {
                _pos.y = 0 ;
                _jump_state = false ;
            } else {
                _jump_state = true ;
            }
            
            if ( _pos.z < ZMAX ) {
                _pos.z = ZMAX ;
            }
            
        }
        
        _anim = $A[_action][_actionstep] ;
        
    }
    
    ////////////////////////////////////
    public function attackChk ( e:Hero , effect:Effect ):void {
        
        if ( this == e ) {
            return ;
        }
        
        if ( e._death ) {
            return ;
        }
        
        for each ( var N:int in _hitRegist ) {
            if ( N == e._id ) {
                return ;
            }
        }
        
        //普通の攻撃判定
        var temp:int = $F[_action][_actionstep] ;
        if ( temp != 0 ) {
            
            var V:Vector3D = _pos.subtract ( e._pos ) ;
            
            if ( _dirc ) {
                V.x -= 16 * SCALE ;
            } else {
                V.x += 16 * SCALE ;
            }
            
            if ( V.length < 30 ) {
                
                _attack_shake = 10 ;
                _hitRegist.push ( e._id ) ;
                
                //死亡チェック
                if ( -- e._hp <= 0 ) {
                    
                    e._death = true ;
                    e._death_cnt = 0 ;
                    e._damage_action = 11 ;
                    
                    ++ _score ;
                    
                } else {
                    
                    e._damage_action = 8 + Math.floor ( Math.random() * 3 ) ;
                    
                }
                
                //ノックバック
                e._velocity.x = (_dirc)? -1 : 1 ;
                e._damage_shake = 15 ;
                
                effect.push ( e._pos.x , e._pos.z + e._pos.y ) ;
                
            }
            
        }
        
    }
    
    ////////////////////////////////////
    public function moveChk ( e:Hero ):void {
        
        if ( this == e ) {
            return ;
        }
    
        var V:Vector3D = _pos.subtract ( e._pos ) ;
        if ( V.length < 20 * SCALE ) {
            V.normalize();
            _velocity.x = V.x * 1 ;
            _velocity.z = V.z * 1 ;
        }
        
    }

    ////////////////////////////////////
    public function render_shadow ( canvas:BitmapData ):void {
        
        _shadowpos.x = _pos.x - 15 * SCALE ;
        _shadowpos.y = _pos.z -  7 * SCALE ;
        canvas.copyPixels ( _shadow , _shadow.rect , _shadowpos ) ;
        
    }
    
    ////////////////////////////////////
    public function render ( canvas:BitmapData ):void {
                
        if ( _death ) {
            if ( _death_cnt % 10 < 5 ) {
                return ;
            }
        }

        _anim %= 40 ;
        _animrect.x = Math.floor ( _anim % 8 ) * SIZE ;
        _animrect.y = Math.floor ( _anim / 8 ) * SIZE ;
        
        _renderpos.x = _pos.x          - SIZE /2 ;
        _renderpos.y = _pos.z + _pos.y - SIZE ;
        
        if ( _damage_shake ) {
            _renderpos.x += Math.random() * 10 - 5 ;
            _renderpos.y += Math.random() * 10 - 5 ;
        }
        
        if ( _dirc ) {
            canvas.copyPixels ( _img_r , _animrect , _renderpos ) ;
        } else {
            canvas.copyPixels ( _img   , _animrect , _renderpos ) ;
        }
        
    }
    
}




////////////////////////////////////
const FILENAME:String = "http://assets.wonderfl.net/images/related_images/a/a7/a79f/a79f6550f46ab03e548ec7fee72569ee99b89823" ;
const ZERO_POINT:Point = new Point ( 0 , 0 ) ;
const ZMAX:int = 300 ;

//アニメパターン
const $A:Array = [
    [ 0 , 1 , 2 , 3 ] , //歩く
    [ 32 , 33 , 34 , 35 , 36 , 37 ] , //走る
    [ 4 , 5 , 6 , 7 , 4 ] , //飛ぶ
    [ 8 , 9 ] , //パンチ
    [ 10 , 11 , 12 ] , //強いパンチ
    [ 13 , 4 ] , //ジャンプパンチ
    [ 14 , 4 ] , //ジャンプキック
    [ 29 , 15 ] , //キック
    [ 16 ] , //弱ダメージ
    [ 17 ] , //中ダメージ
    [ 18 ] , //強ダメージ
    [ 19 , 20 , 21 , 22 , 22 ] , //ダウン
    [ 7 , 4 ] //落下
];

//ウェイト
const $B:Array = [
    [ 8 , 8 , 8 , 8 ] , //歩く
    [ 5 , 5 , 5 , 5 , 5 , 5 ] , //走る
    [ 2 , 2 , 5 , 2 , 5 ] , //飛ぶ
    [ 9 , 9 ] , //パンチ
    [ 7, 7, 8 ] , //強いパンチ
    [ 2 , 5 ] , //ジャンプパンチ
    [ 2 , 5 ] , //ジャンプキック
    [ 3 , 6 ] , //キック
    [ 15 ] , //弱ダメージ
    [ 15 ] , //中ダメージ
    [ 15 ] , //強ダメージ
    [ 9 , 9 , 9 , 9 , 99 ] , //ダウン
    [ 2 , 5 ] //落下
] ;

//入力の許可 1=移動 + 2=攻撃 + 4=ジャンプ
const $C:Array = [
    [ 7 , 7 , 7 , 7 ] , //歩く
    [ 7 , 7 , 7 , 7 , 7 , 7 ] , //走る
    [ 0 , 2 , 2 , 2 , 0 ] , //飛ぶ
    [ 0 , 0 ] , //パンチ
    [ 0 , 0 , 0 ] , //強いパンチ
    [ 0 , 0 ] , //ジャンプパンチ
    [ 0 , 0 ] , //ジャンプキック
    [ 0 , 0 ] , //キック
    [ 0 ] , //弱ダメージ
    [ 0 ] , //中ダメージ
    [ 0 ] , //強ダメージ
    [ 0 , 0 , 0 , 0 , 0 ] , //ダウン
    [ 0 , 0 ] //落下
] ;

//アニメーションの条件 0=ウェイト 1=_velocity.yが+方向 2=地面に接地 3=終わらない
const $D:Array = [
    [ 0 , 0 , 0 , 0 ] , //歩く
    [ 0 , 0 , 0 , 0 , 0 , 0 ] , //走る
    [ 0 , 1 , 0 , 2 , 0 ] , //飛ぶ
    [ 0 , 0 ] , //パンチ
    [ 0 , 0 , 0 ] , //強いパンチ
    [ 2 , 0 ] , //ジャンプパンチ
    [ 2 , 0 ] , //ジャンプキック
    [ 0 , 0 ] , //キック
    [ 0 ] , //弱ダメージ
    [ 0 ] , //中ダメージ
    [ 0 ] , //強ダメージ
    [ 0 , 0 , 0 , 0 , 3 ] , //ダウン
    [ 2 , 0 ] //落下
] ;

//アニメーション切り替わりの際の特殊動作ID 1=ジャンプ 2=[歩くor落下]状態に戻る
const $E:Array = [
    [ 0 , 0 , 0 , 0 ] , //歩く
    [ 0 , 0 , 0 , 0 , 0 , 0 ] , //走る
    [ 1 , 0 , 0 , 0 , 2 ] , //飛ぶ
    [ 0 , 2 ] , //パンチ
    [ 0 , 0 , 2 ] , //強いパンチ
    [ 0 , 2 ] , //ジャンプパンチ
    [ 0 , 2 ] , //ジャンプキック
    [ 0 , 2 ] , //キック
    [ 2 ] , //弱ダメージ
    [ 2 ] , //中ダメージ
    [ 2 ] , //強ダメージ
    [ 0 , 0 , 0 , 0 , 2 ] , //ダウン
    [ 0 , 2 ] //落下
] ;

//攻撃判定
const $F:Array = [
    [ 0 , 0 , 0 , 0 ] , //歩く
    [ 0 , 0 , 0 , 0 , 0 , 0 ] , //走る
    [ 0 , 0 , 0 , 0 , 0 ] , //飛ぶ
    [ 0 , 1 ] , //パンチ
    [ 0 , 1 , 0 ] , //強いパンチ
    [ 1 , 0 ] , //ジャンプパンチ
    [ 1 , 0 ] , //ジャンプキック
    [ 0 , 1 ] , //キック
    [ 0 ] , //弱xダメージ
    [ 0 ] , //中ダメージ
    [ 0 ] , //強ダメージ
    [ 0 , 0 , 0 , 0 , 0 ] , //ダウン
    [ 0 , 0 ] //落下
] ;


var _end:Boolean = false ;
var _score:int = 0 ;