angry-pixel 2.3.7 → 2.4.1
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 +7 -10
- package/lib/index.cjs.js +1 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +91 -82
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
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
|
-
|
|
161
|
-
this.
|
|
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
|
-
|
|
179
|
-
|
|
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
|
|