Added the ability to disable rendering of an item internally

This commit is contained in:
Nathan Kunicki 2016-04-17 15:02:54 +01:00
parent d8b1411a3e
commit a903bd6aa3
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "momentumengine",
"version": "0.6.0",
"version": "0.7.0",
"description": "An ES6 game and animation engine.",
"main": "src/es6.js",
"repository": {

View File

@ -21,6 +21,7 @@ class Entity {
this.acceleration = new Vector2D(0, 0);
this.size = new Vector2D(0, 0);
this.rotation = 0;
this.display = true;
this.fields = [];
@ -347,7 +348,7 @@ class Entity {
_renderEntity () {
let rendered = this.render && this.render();
let rendered = this.display && this.render && this.render();
if (rendered) {
this._game._lastFrameTotalRenders++;