Added the ability to disable rendering of an item internally
This commit is contained in:
parent
d8b1411a3e
commit
a903bd6aa3
@ -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": {
|
||||
|
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user