brick-engine-cli 1.0.4 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brick-engine-cli",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "CLI to scaffold Brick Game projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@types/inquirer": "^8.2.12",
16
- "brick-engine-js": "^1.0.14",
16
+ "brick-engine-js": "^1.0.18",
17
17
  "chalk": "^4.1.2",
18
18
  "commander": "^11.1.0",
19
19
  "dotenv": "^17.3.1",
@@ -12,7 +12,7 @@ export default class MyGame extends Game {
12
12
  const { grid, control, sound } = this.modules;
13
13
 
14
14
  // Example: Subscriber to ACTION button
15
- control.subscribe(ControlKey.ACTION, ControlEventType.PRESSED, () => {
15
+ control.subscribeForPlayingScreen(ControlKey.ACTION, ControlEventType.PRESSED, () => {
16
16
  sound.play(Sound.ACTION_1);
17
17
  grid.stampCell({
18
18
  coordinate: { x: this.x, y: this.y },
@@ -97,8 +97,4 @@ export default class MyGame extends Game {
97
97
  this.modules.text.setTextSize(FontSize.MEDIUM);
98
98
  this.modules.text.textOnDisplay('PRESS START', { x: 0.5, y: 0.8 });
99
99
  }
100
-
101
- getGameId() {
102
- return 'tetris';
103
- }
104
100
  }
@@ -1,6 +1,5 @@
1
1
  import path from 'path';
2
2
  import { fileURLToPath } from 'url';
3
- import webpack from 'webpack';
4
3
  import HtmlWebpackPlugin from 'html-webpack-plugin';
5
4
  import MiniCssExtractPlugin from 'mini-css-extract-plugin';
6
5
  import CopyWebpackPlugin from 'copy-webpack-plugin';
@@ -22,12 +21,19 @@ export default (env = {}, argv) => {
22
21
  // In 'bundle' mode, we bundle ONLY the game class
23
22
  // In 'standalone' mode, we load the engine with the user's game
24
23
  entry: {
25
- app: path.resolve(__dirname, 'src/bootstrap.ts'),
24
+ app: bundleMode === 'bundle' ? path.resolve(__dirname, 'src/index.ts') : path.resolve(__dirname, 'src/bootstrap.ts'),
26
25
  },
27
26
  output: {
28
27
  filename: 'game.bundle.js',
29
28
  path: path.resolve(__dirname, 'dist'),
30
29
  clean: true,
30
+ ...(bundleMode === 'bundle'
31
+ ? {
32
+ library: 'BrickEngineGame',
33
+ libraryTarget: 'window',
34
+ libraryExport: 'default',
35
+ }
36
+ : {}),
31
37
  },
32
38
  devtool: isProduction ? false : 'source-map',
33
39
  module: {