File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1073,7 +1073,7 @@ cc.JumpBy = cc.ActionInterval.extend(/** @lends cc.JumpBy# */{
10731073 */
10741074 startWithTarget :function ( target ) {
10751075 cc . ActionInterval . prototype . startWithTarget . call ( this , target ) ;
1076- this . _startPosition = target . getPosition ( ) ;
1076+ this . _previousPosition = this . _startPosition = target . getPosition ( ) ;
10771077 } ,
10781078
10791079 /**
@@ -1084,8 +1084,16 @@ cc.JumpBy = cc.ActionInterval.extend(/** @lends cc.JumpBy# */{
10841084 var frac = time * this . _jumps % 1.0 ;
10851085 var y = this . _height * 4 * frac * ( 1 - frac ) ;
10861086 y += this . _delta . y * time ;
1087+
10871088 var x = this . _delta . x * time ;
1088- this . _target . setPosition ( cc . p ( this . _startPosition . x + x , this . _startPosition . y + y ) ) ;
1089+
1090+ var currentPos = this . _target . getPosition ( ) ;
1091+
1092+ var diff = cc . pSub ( currentPos , this . _previousPosition ) ;
1093+ this . _startPosition = cc . pAdd ( diff , this . _startPosition ) ;
1094+ var newPos = cc . pAdd ( this . _startPosition , cc . p ( x , y ) ) ;
1095+ this . _target . setPosition ( newPos ) ;
1096+ this . _previousPosition = newPos ;
10891097 }
10901098 } ,
10911099
Original file line number Diff line number Diff line change @@ -98,7 +98,6 @@ cc.ActionManager = cc.Class.extend({
9898 }
9999 //creates a array for that eleemnt to hold the actions
100100 this . _actionAllocWithHashElement ( element ) ;
101- cc . Assert ( ( element . actions . indexOf ( action ) == - 1 ) , "ActionManager.addAction()," ) ;
102101
103102 element . actions . push ( action ) ;
104103 action . startWithTarget ( target ) ;
You can’t perform that action at this time.
0 commit comments