From 509e372f9ccbc49344493fdb36b2afb17103f4da Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Wed, 20 Aug 2014 09:27:23 -0500 Subject: Normalizes API for entities --- lib/serpentity/entity.js | 2 +- lib/serpentity/serpentity.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/serpentity/entity.js b/lib/serpentity/entity.js index d03f16b..c020f05 100644 --- a/lib/serpentity/entity.js +++ b/lib/serpentity/entity.js @@ -25,7 +25,7 @@ Class(Serpentity, "Entity")({ * * returns true if added, false if already present */ - add : function add(component) { + addComponent : function addComponent(component) { if (this._componentKeys.indexOf(component.constructor) >= 0) { return false; } diff --git a/lib/serpentity/serpentity.js b/lib/serpentity/serpentity.js index 18985c5..ed1a9df 100644 --- a/lib/serpentity/serpentity.js +++ b/lib/serpentity/serpentity.js @@ -50,7 +50,7 @@ eventually be consumed by "Systems" You can add components to entities by using the add method: - entity.add(new PositionComponent()); + entity.addComponent(new PositionComponent()); Systems can refer to entities by requesting nodes. -- cgit