[flash开发者交流][2010.07.24]flash mmorpg游戏引擎及工具开发概述(张明光)

32
FLASH-MMORPG 游戏引擎及工具开 发概述 张明光 (saiman) 2010.7.1 QQ:457691057 Blog:http :// wxsr.blogbus.com /

Upload: shanda-innovation-institute

Post on 18-Nov-2014

6.113 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

FLASH WEBGAME

Flash-MMORPG

(saiman)2010.7.1QQ:457691057Blog:http://wxsr.blogbus.com/:WEBGAME ()1.:1.2.3.2:1.() ,2.() ,3.() 4.() (),,().----,().

,.

()1.:(), .. ---------,1.() ----,: IOrder,.(,)

,public interface IOrder {function get execHandler():Function;function get callbackHandler():Function;function setUp(execHandler:Function,args:Array, callbackHandler:Function)}:1. AS32. : 1. (Iorder) 2. ..public interface IOrder {function set id(value:int):void;function get id():intfunction execHandler():Object;function callbackHandler(args:Array):Object;function setUp(execHandler:Function,args:Array, callbackHandler:Function);},as3:

1.,..IEventDispatcher . ...

2.,,,2.,,.

.

AS3()

Target.addEventListener(EventType.EVENT_NAME,eventResponse) ,:.:

,:1. ( null)2.().3.: ,,,:,:,.:,.

:DisplayObject.ENTER_FRAME: :..().,.Timer :,.cpu.setInterval Timer.,Timer.as2as2setInterval,,. setTimeout,setInterval .

:timer.timertimer. ,,,,.,.,package flash.utils{ import flash.events.*; final class SetIntervalTimer extends Timer { var id:uint; private var rest:Array; private var closure:Function; private static var intervals:Array = []; function SetIntervalTimer(closure:Function, delay:Number, repeats:Boolean, rest:Array) { super(delay, repeats ? (0) : (1)); this.closure = closure; this.rest = rest; addEventListener(TimerEvent.TIMER, this.onTimer); start(); this.id = intervals.length + 1; intervals.push(this); return; }// end function private function onTimer(event:Event) : void { this.closure.apply(null, this.rest); if (repeatCount == 1) { if (intervals[(this.id - 1)] == this) { delete intervals[(this.id - 1)]; } } return; }// end function static function clearInterval(id_to_clear:uint) : void { id_to_clear = id_to_clear - 1; if (intervals[id_to_clear] is ) { intervals[id_to_clear].stop(); delete intervals[id_to_clear]; } return; }// end function }}

playerglobal.swcSetIntervalTimer

,: .:1.timer,timer.2.timer,.3.Timer,EnterFrame4.,-------1. -----Message=Head+Body

. 1., 2. 3.

.: ,send,: () : (2) 1. 2. 3.Message()Head(,,,)Body(,,Iorder)::MODULE(ModuleToModule)(ModuleToSevice)(SubModule--)

: () 2,. -Moudle (MVC)public interface IModule { function get view():IBaseSprite function set view(value:IBaseSprite):void function register(moduleName:String):void function send(message:IMessage):void function get proxy():IProxy}1.2.()3./, (,;)4. (bitmapdata )5.(,html,tree)6. (,,)7. (ui)8 (ui)9.:,,,,10.:,,,,,11. (,)12.(,)13.14.15.16. 17.::1.(,)2.(,,)3.(, )4.message --------SubModule( )mvc,.1.2.,.

SubModule,..,.SubModule, SubModule,SubModule().SubModule()..

1.WEBGAME ::IBaseSprite

1.,.2.(IBaseVo),. 3..

.1. webgame,.

2.catchAsBitmap(,,MovieClipcatchcatch)

3.,cpu(,catchAsBitmap)

Ui1.2.FlAsWing,Flex Spark

--41..2.3.4.ai5..

cpu1.mouseEnabledmouseChildren2.addChild(),addChildAt()()3.(,)4. :Array.push() < Ayray.unshift ()