2 u014139945 u014139945 于 2014.05.25 10:44 提问

AS3 请问如何让怪物顺着这个数组中的路线坐标行走??

package
{
import flash.display.MovieClip;

import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.Stage;

public class Monster extends MovieClip
{
    //怪物行走路线
    private var _Monster_Route_Array:Array = [[700,130],[380,130],[380,200],[250,200],[250,460],[38,460]];
    private var _Monster1_Run:MovieClip;
    public function Monster():void
    {
        //初始化10只怪物的坐标
        for(var i:uint = 0;i < 10;i++)
        {
            _Monster1_Run = new Monster1();
            _Monster1_Run.gotoAndStop(1);
            _Monster1_Run.x = 700;
            _Monster1_Run.y = 130;
            addChild(_Monster1_Run);
            _Monster_Route_Array.push(_Monster1_Run);
        }
    }
}

}

Csdn user default icon
上传中...
上传图片
插入图片