Updated to latest Node

This commit is contained in:
Nathan Kunicki 2017-02-23 21:02:08 +00:00
parent a903bd6aa3
commit 38744c399c
3 changed files with 26 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{
"name": "momentumengine",
"version": "0.7.0",
"version": "0.8.0",
"description": "An ES6 game and animation engine.",
"main": "src/es6.js",
"repository": {
@ -15,18 +15,17 @@
"author": "Nathan Kunicki <me@nathankunicki.com>",
"license": "MIT",
"engines": {
"node": "^4.2.3"
"node": "^7.6.0"
},
"dependencies": {
"babel-core": "6.7.4",
"babel-loader": "6.2.4",
"babel-plugin-transform-runtime": "6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-stage-0": "6.5.0",
"babel-runtime": "6.6.1",
"babel-core": "6.23.1",
"babel-loader": "6.3.2",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-es2015": "6.22.0",
"babel-preset-stage-0": "6.22.0",
"gulp": "3.9.1",
"gulp-jsdoc3": "0.2.1",
"gulp-util": "3.0.7",
"webpack": "1.12.14"
"gulp-jsdoc3": "1.0.1",
"gulp-util": "3.0.8",
"webpack": "2.2.1"
}
}

View File

@ -47,7 +47,13 @@ class Entity {
}
set left (val) {
return this.pos.x = val;
let res = (this.pos.x = val);
if (this._parent) {
this._relativePos.x = this.pos.x + this._parent.relativeLeft;
} else {
this._relativePos.x = this.pos.x;
}
return res;
}
@ -59,7 +65,13 @@ class Entity {
}
set top (val) {
return this.pos.y = val;
let res = (this.pos.y = val);
if (this._parent) {
this._relativePos.y = this.pos.y + this._parent.relativeTop;
} else {
this._relativePos.y = this.pos.y;
}
return res;
}

View File

@ -33,10 +33,10 @@ class Path extends Entity {
ctx.strokeStyle = this.color.toString();
ctx.beginPath();
ctx.moveTo(this.relativeLeft, this.relativeTop);
ctx.moveTo(this._scaleForLeft(this.relativeLeft), this._scaleForTop(this.relativeTop));
for (let coord in this.coords) {
ctx.lineTo(this.relativeLeft + this.coords[coord].x, this.relativeTop + this.coords[coord].y);
ctx.lineTo(this._scaleForWidth(this.relativeLeft + this.coords[coord].x), this._scaleForHeight(this.relativeTop + this.coords[coord].y));
}
//ctx.closePath();