Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
Changed new Date().getTime()'s to Date.now().
Browse files Browse the repository at this point in the history
  • Loading branch information
probityrules committed Dec 18, 2015
1 parent d78e4f6 commit f1c1417
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
16 changes: 1 addition & 15 deletions src/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ platypus.Scene = (function () {
}
messages.length = 0;

this.time = new Date().getTime();
this.time = Date.now();
this.timeElapsed = {
name: '',
time: 0
Expand All @@ -118,23 +118,9 @@ platypus.Scene = (function () {
value: event
});
} else {
if (eventId === 'tick') {
time = new Date().getTime();
this.timeElapsed.name = 'Non-Engine';
this.timeElapsed.time = time - this.time;
this.trigger('time-elapsed', this.timeElapsed);
this.time = time;
}
for (i = 0; i < this.layers.length; i++) {
this.layers[i].trigger(eventId, event);
}
if (eventId === 'tick') {
time = new Date().getTime();
this.timeElapsed.name = 'Engine Total';
this.timeElapsed.time = time - this.time;
this.trigger('time-elapsed', this.timeElapsed);
this.time = time;
}
}
};

Expand Down
10 changes: 6 additions & 4 deletions src/components/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
* @class Camera
* @uses platypus.Component
*/
/*global console, createjs, PIXI, platypus, springroll */
/*global console, createjs, PIXI, platypus, include */
/*jslint plusplus:true */
(function () {
"use strict";

var Application = include("springroll.Application");

return platypus.createComponentClass({
id: 'Camera',
properties: {
Expand Down Expand Up @@ -215,7 +217,7 @@
if (this.owner.container) {
this.parentContainer = this.owner.container;
} else if (this.owner.stage) {
this.canvas = this.canvas || springroll.Application.instance.display.canvas; //TODO: Probably need to find a better way to handle resizing - DDD 10/4/2015
this.canvas = this.canvas || Application.instance.display.canvas; //TODO: Probably need to find a better way to handle resizing - DDD 10/4/2015
this.parentContainer = this.owner.stage;
this.owner.width = this.canvas.width;
this.owner.height = this.canvas.height;
Expand Down Expand Up @@ -398,7 +400,7 @@
}

if (this.lastFollow.begin) {
if (this.lastFollow.begin < new Date().getTime()) {
if (this.lastFollow.begin < Date.now()) {
this.follow(this.lastFollow);
}
}
Expand Down Expand Up @@ -522,7 +524,7 @@
this.lastFollow.offsetX = this.offsetX;
this.lastFollow.offsetY = this.offsetY;
}
this.lastFollow.begin = new Date().getTime() + def.time;
this.lastFollow.begin = Date.now() + def.time;
} else {
if (this.lastFollow.begin) {
this.lastFollow.begin = 0;
Expand Down

0 comments on commit f1c1417

Please sign in to comment.