angry-pixel 2.3.6 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,11 +78,10 @@ const game = new Game(config);
78
78
 
79
79
  ### Create a Scene
80
80
 
81
- Then we will create the `MainScene` class, which extends the `Scene` base class. This class represents a scene in our game, and has three main functions:
81
+ Then we will create the `MainScene` class, which extends the `Scene` base class. This class represents a scene in our game, and has two main functions:
82
82
 
83
83
  - To load assets.
84
- - To create the initial entities.
85
- - To know which are the necessary systems.
84
+ - To register the necessary systems and create the initial entities.
86
85
 
87
86
  For the moment we only implement the function loadAssets to load an image that we will use later:
88
87
 
@@ -157,8 +156,8 @@ class MainScene extends Scene {
157
156
  }
158
157
 
159
158
  // within this method we register the systems of the scene
160
- registerSystems(): void {
161
- this.addSystem(MoveAndBounceSystem);
159
+ setup(): void {
160
+ this.systems = [MoveAndBounceSystem];
162
161
  }
163
162
  }
164
163
  ```
@@ -175,12 +174,10 @@ class MainScene extends Scene {
175
174
  this.assetManager.loadImage("sprite.png");
176
175
  }
177
176
 
178
- registerSystems(): void {
179
- this.addSystem(MoveAndBounceSystem);
180
- }
177
+ // within this method we register the systems and create the entities
178
+ setup(): void {
179
+ this.systems = [MoveAndBounceSystem];
181
180
 
182
- // within this method we create the entities
183
- createEntities(): void {
184
181
  // camera
185
182
  this.entityManager.createEntity([new Transform(), new Camera({ layers: ["Sprite"] })]);
186
183