Skip to content

Commit 3393446

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents 319e4de + 824e224 commit 3393446

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/gameobjects/pathfollower/PathFollower.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var Vector2 = require('../../math/Vector2');
2323
* @property {boolean} [positionOnPath=false] - Whether to position the PathFollower on the Path using its path offset.
2424
* @property {boolean} [rotateToPath=false] - Should the PathFollower automatically rotate to point in the direction of the Path?
2525
* @property {number} [rotationOffset=0] - If the PathFollower is rotating to match the Path, this value is added to the rotation value. This allows you to rotate objects to a path but control the angle of the rotation as well.
26+
* @property {number} [startAt=0] - Current start position of the path follow, between 0 and 1.
2627
*/
2728

2829
/**
@@ -245,6 +246,7 @@ var PathFollower = new Class({
245246
// Override in case they've been specified in the config
246247
config.from = 0;
247248
config.to = 1;
249+
config.startAt = startAt;
248250

249251
// Can also read extra values out of the config:
250252

src/physics/arcade/StaticBody.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,10 +788,21 @@ var StaticBody = new Class({
788788
{
789789
var pos = this.position;
790790

791+
var x = pos.x + this.halfWidth;
792+
var y = pos.y + this.halfHeight;
793+
791794
if (this.debugShowBody)
792795
{
793796
graphic.lineStyle(1, this.debugBodyColor, 1);
794-
graphic.strokeRect(pos.x, pos.y, this.width, this.height);
797+
if (this.isCircle)
798+
{
799+
graphic.strokeCircle(x, y, this.width / 2);
800+
}
801+
else
802+
{
803+
graphic.strokeRect(pos.x, pos.y, this.width, this.height);
804+
}
805+
795806
}
796807
},
797808

src/tweens/builders/NumberTweenBuilder.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var NumberTweenBuilder = function (parent, config, defaults)
4545

4646
var from = GetValue(config, 'from', 0);
4747
var to = GetValue(config, 'to', 1);
48+
var current = GetValue(config, 'startAt', from);
4849

4950
var targets = [ { value: from } ];
5051

@@ -78,7 +79,7 @@ var NumberTweenBuilder = function (parent, config, defaults)
7879
);
7980

8081
tweenData.start = from;
81-
tweenData.current = from;
82+
tweenData.current = current;
8283
tweenData.to = to;
8384

8485
data.push(tweenData);

src/tweens/tween/Tween.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,10 @@ var Tween = new Class({
12081208
tweenData.state = TWEEN_CONST.COMPLETE;
12091209
break;
12101210
}
1211+
1212+
if (!tweenData.elapsed && tweenData.current) {
1213+
tweenData.elapsed = tweenData.duration * tweenData.current;
1214+
}
12111215

12121216
var elapsed = tweenData.elapsed;
12131217
var duration = tweenData.duration;
@@ -1319,7 +1323,7 @@ var Tween = new Class({
13191323

13201324
tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start);
13211325

1322-
tweenData.current = tweenData.start;
1326+
tweenData.current = tweenData.current || tweenData.start;
13231327

13241328
tweenData.target[tweenData.key] = tweenData.start;
13251329

0 commit comments

Comments
 (0)