MCPcopy Index your code
hub / github.com/phaserjs/phaser / createFollower

Function createFollower

tests/gameobjects/components/PathFollower.test.js:43–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43function createFollower ()
44{
45 var addCounterResult = createMockTween(true, false);
46
47 var follower = Object.assign({}, PathFollower);
48
49 follower.x = 0;
50 follower.y = 0;
51 follower.rotation = 0;
52 follower.path = null;
53 follower.pathTween = null;
54 follower.pathOffset = null;
55 follower.pathVector = null;
56 follower.pathDelta = null;
57 follower.pathConfig = null;
58 follower.rotateToPath = false;
59 follower.pathRotationOffset = 0;
60 follower._prevDirection = TWEEN_CONST.PLAYING_FORWARD;
61
62 follower.setPosition = vi.fn(function (x, y)
63 {
64 follower.x = x;
65 follower.y = y;
66 });
67
68 follower.scene = {
69 sys: {
70 tweens: {
71 addCounter: vi.fn(function () { return addCounterResult; })
72 }
73 }
74 };
75
76 follower._addCounterResult = addCounterResult;
77
78 return follower;
79}
80
81describe('PathFollower', function ()
82{

Callers 1

Calls 1

createMockTweenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…