]> git.r.bdr.sh - rbdr/serpentity/commitdiff
Update usage in README
authorBen Beltran <redacted>
Mon, 9 Mar 2020 18:24:02 +0000 (13:24 -0500)
committerBen Beltran <redacted>
Mon, 9 Mar 2020 18:24:02 +0000 (13:24 -0500)
README.md

index 50b8f868e182d2eea4911750ada2327d6b5ee342..f46e132815082c9ccbcac6203952028abf2a4b56 100644 (file)
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Serpentity is a simple entity framework inspired by [Ash][ash].
 
 Usage:
 
-    const Serpentity = require('serpentity');
+    import Serpentity from '@serpentity/serpentity';
 
 ## Instantiating an engine
 
@@ -29,7 +29,8 @@ Remove entities or systems:
 
 Entities are the basic object of Serpentity, and they do nothing.
 
-    const entity = new Serpentity.Entity();
+    import { Entity } from '@serpentity/serpentity';
+    const entity = new Entity();
 
 All the behavior is added through components
 
@@ -38,7 +39,8 @@ All the behavior is added through components
 Components define data that we can add to an entity. This data will
 eventually be consumed by "Systems"
 
-    const PositionComponent = class PositionComponent extends Serpentity.Component {
+    import { Component } from '@serpentity/serpentity';
+    const PositionComponent = class PositionComponent extends Component {
       constructor(config) {
 
         this.x = 0;
@@ -60,7 +62,8 @@ Systems can refer to entities by requesting nodes.
 Nodes are sets of components that you define, so your system can require
 entities that always follow the API defined in the node.
 
-    const MovementNode = class MovementNode extends Serpentity.Node;
+    import { Node } from '@serpentity/serpentity';
+    const MovementNode = class MovementNode extends Node;
     MovementNode.position = PositionComponent;
     MovementNode.motion = MotionComponent;
 
@@ -73,7 +76,8 @@ that comply with that API
 
 Systems are called on every update, and they use components through nodes.
 
-    const TestSystem = class TestSystem extends Serpentity.System {
+    import { System } from '@serpentity/serpentity';
+    const TestSystem = class TestSystem extends System {
       added(engine){
 
         this.nodeList = engine.getNodes(MovementNode);