From 74c90dd177fcdbd5a9a9a2c06c570a8bdc949e6f Mon Sep 17 00:00:00 2001 From: ttwilb Date: Wed, 4 Sep 2013 12:52:52 +0900 Subject: [PATCH] =?utf8?q?WarpItemClass.js=E5=AE=9F=E8=A3=85=E3=80=80?= =?utf8?q?=E6=9C=AA=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- www/corelib/classes/WarpItemClass.js | 42 ++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/www/corelib/classes/WarpItemClass.js b/www/corelib/classes/WarpItemClass.js index fead97e..c00712f 100644 --- a/www/corelib/classes/WarpItemClass.js +++ b/www/corelib/classes/WarpItemClass.js @@ -3,11 +3,40 @@ // args[2] : move_to y // args[3] : size_x // args[4] : size_y - -var WarpItemClass = function(){ - WarpItemClass.base.apply(this, [false, function(main, obj_x, obj_y){ - - }]); +// args[5] : saveInertia Šµ«ó‘Ô‚ð•Û‘¶ +var WarpItemClass = function(stage, args){ + + var moveToX = args[1]; + var moveToY = args[2]; + var stgName = args[0]; + var saveInertia = args[5] != undefined ? args[5] : false; + + WarpItemClass.base.apply(this, [stage, [false, function(main, obj_x, obj_y){ + var spdx, spdy; + if(saveInertia) + { + spdx = stage.userControlledCharacter.movingSpeed.x; + spdy = stage.userControlledCharacter.movingSpeed.y; + } + if(stgName) + { + stage.manager.loadStageFromNetwork(stgName); + } + var stg = stage.manager.runningStage; + if(moveToX != undefined) + { + stg.userControlledCharacter.origin.x = moveToX; + } + if(moveToY != undefined) + { + stg.userControlledCharacter.origin.y = moveToY; + } + if(saveInertia) + { + stg.userControlledCharacter.movingSpeed.x = spdx; + stg.userControlledCharacter.movingSpeed.y = spdy; + } + }]]); if(args[3]) { @@ -17,7 +46,6 @@ var WarpItemClass = function(){ { this.size.y = args[4]; } - }.extend(FreeItemClass, { - + }); \ No newline at end of file -- 2.11.0