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

Commit

Permalink
Merge branch 'dev' of https://github.com/PBS-KIDS/Platypus into dev a…
Browse files Browse the repository at this point in the history
…nd bumped version to 0.6.7

Conflicts:
	lib/platypus.combined.js
	lib/platypus.min.js
  • Loading branch information
probityrules committed Dec 4, 2015
2 parents 30fbcf0 + f79ce44 commit 5f67682
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 103 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Platypus",
"version": "0.6.6",
"version": "0.6.7",
"homepage": "https://github.com/PBS-KIDS/Platypus",
"authors": [
"probityrules",
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Platypus",
"version": "0.6.6",
"version": "0.6.7",
"description": "Platypus Docs",
"url": "https://github.com/PBS-KIDS/Platypus",
"logo": "assets/platypus-title.png",
Expand Down
Binary file removed docs/Platypus_docs-0.6.5.zip
Binary file not shown.
Binary file removed docs/Platypus_docs-0.6.6.zip
Binary file not shown.
Binary file added docs/Platypus_docs-0.6.7.zip
Binary file not shown.
103 changes: 54 additions & 49 deletions lib/platypus.combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ this.platypus = this.platypus || {};
* @type String
* @static
**/
platypus.version = /*=version*/"NEXT"; // injected by build process
platypus.version = /*=version*/"0.6.7"; // injected by build process

/**
* The build date for this release in UTC format.
* @property buildDate
* @type String
* @static
**/
platypus.buildDate = /*=date*/"Fri, 04 Dec 2015 13:20:56 GMT"; // injected by build process
platypus.buildDate = /*=date*/"Fri, 04 Dec 2015 18:19:08 GMT"; // injected by build process

})();

Expand Down Expand Up @@ -10290,70 +10290,75 @@ platypus.Entity = (function () {
this.message.delta = this.stepLength;
this.leftoverTime = Math.max(this.leftoverTime - (cycles * this.stepLength), 0);

if (this.paused > 0) {
this.paused -= resp.delta;
if (this.paused < 0) {
this.paused = 0;



this.message.tick = resp;

//if (this.updateNeeded) {//causes blocks to fall through dirt - not sure the connection here, so leaving out this optimization for now. - DDD
if (this.activeEntities === this.entities) {
this.message.movers = this.activeEntities = [];
}

this.activeEntities.length = 0;
for (j = this.entities.length - 1; j > -1; j--) {
child = this.entities[j];
if (child.alwaysOn || (typeof child.x === 'undefined') || ((child.x >= this.camera.left - this.camera.buffer) && (child.x <= this.camera.left + this.camera.width + this.camera.buffer) && (child.y >= this.camera.top - this.camera.buffer) && (child.y <= this.camera.top + this.camera.height + this.camera.buffer))) {
this.activeEntities.push(child);
}
}
//}

//Prevents game lockdown when processing takes longer than time alotted.
cycles = Math.min(cycles, this.maxStepsPerTick);

if (!this.paused) {
this.message.tick = resp;
for (i = 0; i < cycles; i++) {

//if (this.updateNeeded) {//causes blocks to fall through dirt - not sure the connection here, so leaving out this optimization for now. - DDD
if (this.activeEntities === this.entities) {
this.message.movers = this.activeEntities = [];
}

this.activeEntities.length = 0;
for (j = this.entities.length - 1; j > -1; j--) {
child = this.entities[j];
if (child.alwaysOn || (typeof child.x === 'undefined') || ((child.x >= this.camera.left - this.camera.buffer) && (child.x <= this.camera.left + this.camera.width + this.camera.buffer) && (child.y >= this.camera.top - this.camera.buffer) && (child.y <= this.camera.top + this.camera.height + this.camera.buffer))) {
this.activeEntities.push(child);
if (this.paused > 0) {
this.paused -= this.stepLength;
if (this.paused < 0) {
this.paused = 0;
}
}
//}

//Prevents game lockdown when processing takes longer than time alotted.
cycles = Math.min(cycles, this.maxStepsPerTick);
if (!this.paused) {

for (i = 0; i < cycles; i++) {
if (this.owner.triggerEventOnChildren) {
this.owner.triggerEventOnChildren('handle-ai', this.message);
}
/**
* This event is triggered on children entities to run their logic.
*
* @event 'handle-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
* This event is triggered on children entities to run their logic.
*
* @event 'handle-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
for (j = this.activeEntities.length - 1; j > -1; j--) {
this.activeEntities[j].triggerEvent('handle-logic', this.message);
}

/**
* This event is triggered on the entity (layer) to test collisions once logic has been completed.
*
* @event 'check-collision-group'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
* This event is triggered on the entity (layer) to test collisions once logic has been completed.
*
* @event 'check-collision-group'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
if (this.owner.triggerEvent('check-collision-group', this.message)) { // If a collision group is attached, make sure collision is processed on each logic tick.
/**
* This event is triggered on entities to run logic that may depend upon collision responses.
*
* @event 'handle-post-collision-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/

* This event is triggered on entities to run logic that may depend upon collision responses.
*
* @event 'handle-post-collision-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
/**
* Triggered on entities when the entity's state has been changed.
*
* @event 'state-changed'
* @param state {Object} A list of key/value pairs representing the owner's state (this value equals `entity.state`).
*/
* Triggered on entities when the entity's state has been changed.
*
* @event 'state-changed'
* @param state {Object} A list of key/value pairs representing the owner's state (this value equals `entity.state`).
*/
for (j = this.activeEntities.length - 1; j > -1; j--) {
child = this.activeEntities[j];
child.triggerEvent('handle-post-collision-logic', this.message);
Expand Down Expand Up @@ -13337,7 +13342,7 @@ This component changes the (x, y) position of an object according to its current
constructor: function (definition) {
this.speed = definition.speed || 0.3;
this.magnitude = 0;
this.degree = (definition.degree || 1) * pi / 180;
this.degree = definition.degree || 1;
this.angle = definition.angle || 0;

this.state = this.owner.state;
Expand Down Expand Up @@ -13381,8 +13386,8 @@ This component changes the (x, y) position of an object according to its current
if (this.state.turningRight !== this.turningRight) {
this.state.turningRight = this.turningRight;
}
if (this.owner.orientation !== this.angle) {
this.owner.orientation = this.angle;
if (this.owner.rotation !== this.angle) {
this.owner.rotation = this.angle;
}
},
"turn-right": function (state) {
Expand Down
10 changes: 5 additions & 5 deletions lib/platypus.min.js

Large diffs are not rendered by default.

93 changes: 49 additions & 44 deletions src/components/HandlerLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,70 +187,75 @@
this.message.delta = this.stepLength;
this.leftoverTime = Math.max(this.leftoverTime - (cycles * this.stepLength), 0);

if (this.paused > 0) {
this.paused -= resp.delta;
if (this.paused < 0) {
this.paused = 0;



this.message.tick = resp;

//if (this.updateNeeded) {//causes blocks to fall through dirt - not sure the connection here, so leaving out this optimization for now. - DDD
if (this.activeEntities === this.entities) {
this.message.movers = this.activeEntities = [];
}

this.activeEntities.length = 0;
for (j = this.entities.length - 1; j > -1; j--) {
child = this.entities[j];
if (child.alwaysOn || (typeof child.x === 'undefined') || ((child.x >= this.camera.left - this.camera.buffer) && (child.x <= this.camera.left + this.camera.width + this.camera.buffer) && (child.y >= this.camera.top - this.camera.buffer) && (child.y <= this.camera.top + this.camera.height + this.camera.buffer))) {
this.activeEntities.push(child);
}
}
//}

//Prevents game lockdown when processing takes longer than time alotted.
cycles = Math.min(cycles, this.maxStepsPerTick);

if (!this.paused) {
this.message.tick = resp;
for (i = 0; i < cycles; i++) {

//if (this.updateNeeded) {//causes blocks to fall through dirt - not sure the connection here, so leaving out this optimization for now. - DDD
if (this.activeEntities === this.entities) {
this.message.movers = this.activeEntities = [];
}

this.activeEntities.length = 0;
for (j = this.entities.length - 1; j > -1; j--) {
child = this.entities[j];
if (child.alwaysOn || (typeof child.x === 'undefined') || ((child.x >= this.camera.left - this.camera.buffer) && (child.x <= this.camera.left + this.camera.width + this.camera.buffer) && (child.y >= this.camera.top - this.camera.buffer) && (child.y <= this.camera.top + this.camera.height + this.camera.buffer))) {
this.activeEntities.push(child);
if (this.paused > 0) {
this.paused -= this.stepLength;
if (this.paused < 0) {
this.paused = 0;
}
}
//}

//Prevents game lockdown when processing takes longer than time alotted.
cycles = Math.min(cycles, this.maxStepsPerTick);
if (!this.paused) {

for (i = 0; i < cycles; i++) {
if (this.owner.triggerEventOnChildren) {
this.owner.triggerEventOnChildren('handle-ai', this.message);
}
/**
* This event is triggered on children entities to run their logic.
*
* @event 'handle-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
* This event is triggered on children entities to run their logic.
*
* @event 'handle-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
for (j = this.activeEntities.length - 1; j > -1; j--) {
this.activeEntities[j].triggerEvent('handle-logic', this.message);
}

/**
* This event is triggered on the entity (layer) to test collisions once logic has been completed.
*
* @event 'check-collision-group'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
* This event is triggered on the entity (layer) to test collisions once logic has been completed.
*
* @event 'check-collision-group'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
if (this.owner.triggerEvent('check-collision-group', this.message)) { // If a collision group is attached, make sure collision is processed on each logic tick.
/**
* This event is triggered on entities to run logic that may depend upon collision responses.
*
* @event 'handle-post-collision-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/

* This event is triggered on entities to run logic that may depend upon collision responses.
*
* @event 'handle-post-collision-logic'
* @param tick {Object}
* @param tick.delta {Number} The time that has passed since the last tick.
*/
/**
* Triggered on entities when the entity's state has been changed.
*
* @event 'state-changed'
* @param state {Object} A list of key/value pairs representing the owner's state (this value equals `entity.state`).
*/
* Triggered on entities when the entity's state has been changed.
*
* @event 'state-changed'
* @param state {Object} A list of key/value pairs representing the owner's state (this value equals `entity.state`).
*/
for (j = this.activeEntities.length - 1; j > -1; j--) {
child = this.activeEntities[j];
child.triggerEvent('handle-post-collision-logic', this.message);
Expand Down
6 changes: 3 additions & 3 deletions src/components/LogicRotationalMovement.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This component changes the (x, y) position of an object according to its current
constructor: function (definition) {
this.speed = definition.speed || 0.3;
this.magnitude = 0;
this.degree = (definition.degree || 1) * pi / 180;
this.degree = definition.degree || 1;
this.angle = definition.angle || 0;

this.state = this.owner.state;
Expand Down Expand Up @@ -96,8 +96,8 @@ This component changes the (x, y) position of an object according to its current
if (this.state.turningRight !== this.turningRight) {
this.state.turningRight = this.turningRight;
}
if (this.owner.orientation !== this.angle) {
this.owner.orientation = this.angle;
if (this.owner.rotation !== this.angle) {
this.owner.rotation = this.angle;
}
},
"turn-right": function (state) {
Expand Down

0 comments on commit 5f67682

Please sign in to comment.