Skip to content

Commit 02a06bc

Browse files
committed
Moved the Animation functions into the components folder where they are a better fit.
1 parent 08a5b49 commit 02a06bc

24 files changed

Lines changed: 13 additions & 12 deletions

v3/src/animation/frame/Animation.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var GetFrames = require('./GetFrames');
55
// This consists of a key, some default values (like the frame rate) and a bunch of Frame objects.
66
// The Animation Manager creates these
77
// Game Objects don't own an instance of these directly
8-
// Game Objects have Animation Components, which are like playheads to global Animations (these objects)
8+
// Game Objects have the Animation Component, which are like playheads to global Animations (these objects)
99
// So multiple Game Objects can have playheads all pointing to this one Animation instance
1010

1111
var Animation = function (manager, key, config)
@@ -100,22 +100,22 @@ Animation.prototype.constructor = Animation;
100100

101101
Animation.prototype = {
102102

103-
load: require('./Load'),
104103
addFrame: require('./AddFrame'),
105104
addFrameAt: require('./AddFrameAt'),
106-
getFrameAt: require('./GetFrameAt'),
107-
removeFrame: require('./RemoveFrame'),
108-
removeFrameAt: require('./RemoveFrameAt'),
109-
updateFrameSequence: require('./UpdateFrameSequence'),
110105
checkFrame: require('./CheckFrame'),
106+
completeAnimation: require('./CompleteAnimation'),
111107
getFirstTick: require('./GetFirstTick'),
108+
getFrameAt: require('./GetFrameAt'),
112109
getNextTick: require('./GetNextTick'),
110+
load: require('./Load'),
113111
nextFrame: require('./NextFrame'),
114112
previousFrame: require('./PreviousFrame'),
113+
removeFrame: require('./RemoveFrame'),
114+
removeFrameAt: require('./RemoveFrameAt'),
115115
repeatAnimation: require('./RepeatAnimation'),
116-
completeAnimation: require('./CompleteAnimation'),
117116
setFrame: require('./SetFrame'),
118117
toJSON: require('./ToJSON'),
118+
updateFrameSequence: require('./UpdateFrameSequence'),
119119

120120
pause: function ()
121121
{

v3/src/boot/VariableTimeStep.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var VariableTimeStep = function (game, framerate)
2020
this.time = 0;
2121
this.startTime = 0;
2222
this.lastTime = 0;
23+
this.runOff = 0;
2324

2425
this.delta = 0;
2526
this.deltaIndex = 0;
@@ -46,6 +47,7 @@ VariableTimeStep.prototype = {
4647
this.time = now;
4748
this.startTime = now;
4849
this.lastTime = now;
50+
this.runOff = 0;
4951

5052
// Pre-populate smoothing array
5153

@@ -74,14 +76,15 @@ VariableTimeStep.prototype = {
7476
if (dt < 0 || dt > 1)
7577
{
7678
// Loop skip, probably super bad start time
79+
this.runOff = time - this.lastTime;
7780
this.lastTime = time;
7881
return;
7982
}
8083

8184
// clamp delta to 0.0001 to 0.5 range
8285
dt = Math.max(Math.min(dt, 0.5), 0.0001);
8386

84-
// Smooth out the delta over the previous X frames
87+
// Smooth out the delta over the previous X frames
8588

8689
var idx = this.deltaIndex;
8790
var history = this.deltaHistory;

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: '253a8370-2f8f-11e7-8cb0-75ca1491836b'
2+
build: '77d3f640-2f92-11e7-94cb-df78655b45e3'
33
};
44
module.exports = CHECKSUM;

v3/src/components/Animation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
var Class = require('../utils/Class');
3-
var Components = require('../animation/frame/components/');
3+
var Components = require('./animation/');
44

55
// Game Object Animation Controller
66

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)