littlejsengine 1.9.1 → 1.9.3

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.
Files changed (68) hide show
  1. package/README.md +11 -9
  2. package/{build → dist}/littlejs.d.ts +48 -43
  3. package/{build → dist}/littlejs.esm.js +256 -147
  4. package/dist/littlejs.esm.min.js +1 -0
  5. package/{build → dist}/littlejs.js +256 -147
  6. package/dist/littlejs.min.js +1 -0
  7. package/{build → dist}/littlejs.release.js +249 -144
  8. package/examples/breakout/game.js +2 -2
  9. package/examples/breakout/gameObjects.js +3 -3
  10. package/examples/breakout/index.html +3 -3
  11. package/examples/breakoutTutorial/index.html +2 -2
  12. package/examples/electron/build.js +1 -1
  13. package/examples/electron/game.js +49 -38
  14. package/examples/electron/index.html +2 -2
  15. package/examples/electron/tiles.png +0 -0
  16. package/examples/empty/index.html +1 -1
  17. package/examples/js13k/build.js +1 -1
  18. package/examples/js13k/game.js +10 -9
  19. package/examples/js13k/index.html +13 -13
  20. package/examples/js13k/tiles.png +0 -0
  21. package/examples/logo.png +0 -0
  22. package/examples/module/game.js +45 -41
  23. package/examples/module/index.html +1 -1
  24. package/examples/module/tiles.png +0 -0
  25. package/examples/particles/index.html +1 -1
  26. package/examples/platformer/data/gameLevelData.tmx +143 -0
  27. package/examples/platformer/data/gameLevelData.tsx +4 -0
  28. package/examples/platformer/game.js +31 -11
  29. package/examples/platformer/gameCharacter.js +9 -7
  30. package/examples/platformer/gameEffects.js +105 -164
  31. package/examples/platformer/gameLevel.js +164 -181
  32. package/examples/platformer/gameLevelData.js +181 -0
  33. package/examples/platformer/gameObjects.js +71 -26
  34. package/examples/platformer/gamePlayer.js +3 -2
  35. package/examples/platformer/index.html +8 -7
  36. package/examples/platformer/tiles.png +0 -0
  37. package/examples/platformer/tilesLevel.png +0 -0
  38. package/examples/puzzle/game.js +12 -12
  39. package/examples/puzzle/index.html +2 -2
  40. package/examples/screenshot.jpg +0 -0
  41. package/examples/starter/build.js +1 -1
  42. package/examples/starter/game.js +6 -6
  43. package/examples/starter/index.html +13 -13
  44. package/examples/starter/tiles.png +0 -0
  45. package/examples/stress/index.html +2 -2
  46. package/examples/typescript/build.bat +4 -1
  47. package/examples/typescript/game.js +34 -31
  48. package/examples/typescript/game.ts +40 -36
  49. package/examples/typescript/index.html +1 -1
  50. package/examples/typescript/tiles.png +0 -0
  51. package/package.json +3 -3
  52. package/reference.md +409 -0
  53. package/src/engine.js +46 -41
  54. package/src/engineAudio.js +22 -19
  55. package/src/engineBuild.js +9 -2
  56. package/src/engineDebug.js +7 -3
  57. package/src/engineDraw.js +8 -7
  58. package/src/engineInput.js +5 -5
  59. package/src/engineMedals.js +3 -3
  60. package/src/engineObject.js +2 -2
  61. package/src/engineParticles.js +16 -15
  62. package/src/engineSettings.js +3 -3
  63. package/src/engineTileLayer.js +3 -3
  64. package/src/engineUtilities.js +139 -38
  65. package/src/engineWebGL.js +2 -8
  66. package/build/littlejs.esm.min.js +0 -1
  67. package/build/littlejs.min.js +0 -1
  68. package/index.d.ts +0 -2094
@@ -16,7 +16,7 @@ setCanvasPixelated(false);
16
16
 
17
17
  const fallTime = .2;
18
18
  const cameraOffset = vec2(0,-.5);
19
- const backgroundColor = new Color(.2,.2,.2);
19
+ const backgroundColor = hsl(0,0,.2);
20
20
  const minMatchCount = 3;
21
21
  const highScoreKey = 'puzzleBestScore';
22
22
 
@@ -31,13 +31,13 @@ let level, levelSize, levelFall, fallTimer, dragStartPos, comboCount, score, bes
31
31
  // tiles
32
32
  const tileColors =
33
33
  [
34
- new Color(1,0,0),
35
- new Color(1,1,1),
36
- new Color(1,1,0),
37
- new Color(0,1,0),
38
- new Color(0,.6,1),
39
- new Color(.6,0,1),
40
- new Color(.5,.5,.5),
34
+ rgb(1,0,0),
35
+ rgb(1,1,1),
36
+ rgb(1,1,0),
37
+ rgb(0,1,0),
38
+ rgb(0,.6,1),
39
+ rgb(.6,0,1),
40
+ rgb(.5,.5,.5),
41
41
  ];
42
42
  const tileTypeCount = tileColors.length;
43
43
 
@@ -186,7 +186,7 @@ function gameUpdatePost()
186
186
  function gameRender()
187
187
  {
188
188
  // draw a black square for the background
189
- drawRect(cameraPos.subtract(cameraOffset), levelSize, new Color(0,0,0));
189
+ drawRect(cameraPos.subtract(cameraOffset), levelSize, hsl(0,0,0));
190
190
 
191
191
  // draw the blocks
192
192
  const pos = vec2();
@@ -223,8 +223,8 @@ function gameRender()
223
223
  function gameRenderPost()
224
224
  {
225
225
  // draw text on top of everything
226
- drawText('Score: ' + score, cameraPos.add(vec2(-3,-3.1)), .9, new Color, .1);
227
- drawText('Best: ' + bestScore, cameraPos.add(vec2( 3,-3.1)), .9, new Color, .1);
226
+ drawText('Score: ' + score, cameraPos.add(vec2(-3,-3.1)), .9, hsl(), .1);
227
+ drawText('Best: ' + bestScore, cameraPos.add(vec2( 3,-3.1)), .9, hsl(), .1);
228
228
  }
229
229
 
230
230
  ///////////////////////////////////////////////////////////////////////////////
@@ -290,7 +290,7 @@ function clearMatches()
290
290
 
291
291
  // spawn particles
292
292
  const color1 = tileColors[data];
293
- const color2 = color1.lerp(new Color, .5);
293
+ const color2 = color1.lerp(hsl(), .5);
294
294
  new ParticleEmitter(
295
295
  pos.add(vec2(.5)), 0, // pos, angle
296
296
  .5, .1, 200, PI, // emitSize, emitTime, emitRate, emiteCone
@@ -5,5 +5,5 @@
5
5
  <link rel=icon type=image/png href=../favicon.png>
6
6
  </head><body>
7
7
 
8
- <script src=../../build/littlejs.js?1812></script>
9
- <script src=game.js?1812></script>
8
+ <script src=../../dist/littlejs.js?192></script>
9
+ <script src=game.js?192></script>
Binary file
@@ -11,7 +11,7 @@ const PROGRAM_NAME = 'game';
11
11
  const BUILD_FOLDER = 'build';
12
12
  const sourceFiles =
13
13
  [
14
- '../../build/littlejs.release.js',
14
+ '../../dist/littlejs.release.js',
15
15
  'game.js',
16
16
  // add your game's files here
17
17
  ];
@@ -62,11 +62,11 @@ function gameInit()
62
62
 
63
63
  // create particle emitter
64
64
  particleEmitter = new ParticleEmitter(
65
- vec2(16,9), 0, // emitPos, emitAngle
66
- 1, 0, 500, PI, // emitSize, emitTime, emitRate, emiteCone
67
- tile(0, 16), // tileIndex, tileSize
68
- new Color(1,1,1), new Color(0,0,0), // colorStartA, colorStartB
69
- new Color(1,1,1,0), new Color(0,0,0,0), // colorEndA, colorEndB
65
+ vec2(16,9), 0, // emitPos, emitAngle
66
+ 1, 0, 500, PI, // emitSize, emitTime, emitRate, emiteCone
67
+ tile(0, 16), // tileIndex, tileSize
68
+ hsl(1,1,1), hsl(0,0,0), // colorStartA, colorStartB
69
+ hsl(0,0,0,0), hsl(0,0,0,0), // colorEndA, colorEndB
70
70
  2, .2, .2, .1, .05, // time, sizeStart, sizeEnd, speed, angleSpeed
71
71
  .99, 1, 1, PI, // damping, angleDamping, gravityScale, cone
72
72
  .05, .5, 1, 1 // fadeRate, randomness, collide, additive
@@ -84,7 +84,7 @@ function gameUpdate()
84
84
  sound_click.play(mousePos);
85
85
 
86
86
  // change particle color and set to fade out
87
- particleEmitter.colorStartA = new Color;
87
+ particleEmitter.colorStartA = hsl();
88
88
  particleEmitter.colorStartB = randColor();
89
89
  particleEmitter.colorEndA = particleEmitter.colorStartA.scale(1,0);
90
90
  particleEmitter.colorEndB = particleEmitter.colorStartB.scale(1,0);
@@ -6,18 +6,18 @@
6
6
  </head><body>
7
7
 
8
8
  <!-- LittleJS Engine -->
9
- <script src=../../src/engineDebug.js?1812></script>
10
- <script src=../../src/engineUtilities.js?1812></script>
11
- <script src=../../src/engineSettings.js?1812></script>
12
- <script src=../../src/engineObject.js?1812></script>
13
- <script src=../../src/engineDraw.js?1812></script>
14
- <script src=../../src/engineInput.js?1812></script>
15
- <script src=../../src/engineAudio.js?1812></script>
16
- <script src=../../src/engineTileLayer.js?1812></script>
17
- <script src=../../src/engineParticles.js?1812></script>
18
- <script src=../../src/engineMedals.js?1812></script>
19
- <script src=../../src/engineWebGL.js?1812></script>
20
- <script src=../../src/engine.js?1812></script>
9
+ <script src=../../src/engineDebug.js?192></script>
10
+ <script src=../../src/engineUtilities.js?192></script>
11
+ <script src=../../src/engineSettings.js?192></script>
12
+ <script src=../../src/engineObject.js?192></script>
13
+ <script src=../../src/engineDraw.js?192></script>
14
+ <script src=../../src/engineInput.js?192></script>
15
+ <script src=../../src/engineAudio.js?192></script>
16
+ <script src=../../src/engineTileLayer.js?192></script>
17
+ <script src=../../src/engineParticles.js?192></script>
18
+ <script src=../../src/engineMedals.js?192></script>
19
+ <script src=../../src/engineWebGL.js?192></script>
20
+ <script src=../../src/engine.js?192></script>
21
21
 
22
22
  <!-- Add your game scripts here -->
23
- <script src=game.js?1812></script>
23
+ <script src=game.js?192></script>
Binary file
@@ -6,12 +6,12 @@
6
6
  </head><body>
7
7
 
8
8
  <!-- LittleJS Engine -->
9
- <script src=../../build/littlejs.min.js?1812></script>
9
+ <script src=../../dist/littlejs.min.js?192></script>
10
10
  <script>
11
11
 
12
12
  /*
13
13
  LittleJS Stress Test
14
- - Render over 50,000 sprites at 60 fps in Chrome
14
+ - Render over 100,000 sprites at 60 fps in Chrome
15
15
  - Also plays music in the background with zzfxm
16
16
  - All code and the image is contained in this html file
17
17
  */
@@ -1,2 +1,5 @@
1
1
  rem LittleJS Build Script
2
- call node build.js
2
+ call node build.js
3
+
4
+ @echo off
5
+ if %ERRORLEVEL% neq 0 ( pause )
@@ -1,12 +1,12 @@
1
1
  /*
2
- Little TypeScript Demo
2
+ Little JS TypeScript Demo
3
3
  - A simple starter project
4
- - Builds to a JavaScript file from TypeScript
4
+ - Shows how to use LittleJS with TypeScript
5
5
  */
6
6
  'use strict';
7
7
  // import module
8
- import * as LittleJS from '../../build/littlejs.esm.js';
9
- const { Vector2, Color, Timer, vec2, tile } = LittleJS;
8
+ import * as LittleJS from '../../dist/littlejs.esm.js';
9
+ const { Vector2, Color, Timer, tile, vec2, hsl, rgb } = LittleJS;
10
10
  // show the LittleJS splash screen
11
11
  LittleJS.setShowSplashScreen(true);
12
12
  // sound effects
@@ -16,51 +16,52 @@ const medal_example = new LittleJS.Medal(0, 'Example Medal', 'Welcome to LittleJ
16
16
  LittleJS.medalsInit('Hello World');
17
17
  // game variables
18
18
  let particleEmitter;
19
- let gameTimer = new Timer;
20
19
  ///////////////////////////////////////////////////////////////////////////////
21
20
  function gameInit() {
22
21
  // create tile collision and visible tile layer
23
- LittleJS.initTileCollision(vec2(32, 16));
24
- const pos = new Vector2;
25
- const tileLayer = new LittleJS.TileLayer(pos, LittleJS.tileCollisionSize);
22
+ const tileCollisionSize = vec2(32, 16);
23
+ LittleJS.initTileCollision(tileCollisionSize);
24
+ const pos = vec2();
25
+ const tileLayer = new LittleJS.TileLayer(pos, tileCollisionSize);
26
26
  // get level data from the tiles image
27
- const imageLevelDataRow = 1;
28
27
  const mainContext = LittleJS.mainContext;
29
28
  const tileImage = LittleJS.textureInfos[0].image;
30
29
  mainContext.drawImage(tileImage, 0, 0);
31
- for (pos.x = LittleJS.tileCollisionSize.x; pos.x--;)
32
- for (pos.y = LittleJS.tileCollisionSize.y; pos.y--;) {
33
- const imageData = mainContext.getImageData(pos.x, 16 * (imageLevelDataRow + 1) - pos.y - 1, 1, 1).data;
34
- if (imageData[0]) {
35
- const tileIndex = 1;
36
- const direction = LittleJS.randInt(4);
37
- const mirror = LittleJS.randInt(2) ? true : false;
38
- const color = LittleJS.randColor();
39
- const data = new LittleJS.TileLayerData(tileIndex, direction, mirror, color);
40
- tileLayer.setData(pos, data);
41
- LittleJS.setTileCollisionData(pos, 1);
42
- }
30
+ const imageData = mainContext.getImageData(0, 0, tileImage.width, tileImage.height).data;
31
+ for (pos.x = tileCollisionSize.x; pos.x--;)
32
+ for (pos.y = tileCollisionSize.y; pos.y--;) {
33
+ // check if this pixel is set
34
+ const i = pos.x + tileImage.width * (15 + tileCollisionSize.y - pos.y);
35
+ if (!imageData[4 * i])
36
+ continue;
37
+ // set tile data
38
+ const tileIndex = 1;
39
+ const direction = LittleJS.randInt(4);
40
+ const mirror = !LittleJS.randInt(2);
41
+ const color = LittleJS.randColor();
42
+ const data = new LittleJS.TileLayerData(tileIndex, direction, mirror, color);
43
+ tileLayer.setData(pos, data);
44
+ LittleJS.setTileCollisionData(pos, 1);
43
45
  }
46
+ // draw tile layer with new data
44
47
  tileLayer.redraw();
45
48
  // move camera to center of collision
46
- LittleJS.setCameraPos(LittleJS.tileCollisionSize.scale(.5));
49
+ LittleJS.setCameraPos(tileCollisionSize.scale(.5));
50
+ LittleJS.setCameraScale(48);
47
51
  // enable gravity
48
52
  LittleJS.setGravity(-.01);
49
53
  // create particle emitter
50
- const center = LittleJS.tileCollisionSize.scale(.5).add(vec2(0, 9));
51
- particleEmitter = new LittleJS.ParticleEmitter(center, 0, // emitPos, emitAngle
54
+ particleEmitter = new LittleJS.ParticleEmitter(vec2(16, 9), 0, // emitPos, emitAngle
52
55
  1, 0, 500, Math.PI, // emitSize, emitTime, emitRate, emiteCone
53
- LittleJS.tile(0, 16), // tileIndex, tileSize
54
- new Color(1, 1, 1), new Color(0, 0, 0), // colorStartA, colorStartB
55
- new Color(1, 1, 1, 0), new Color(0, 0, 0, 0), // colorEndA, colorEndB
56
+ tile(0, 16), // tileIndex, tileSize
57
+ hsl(1, 1, 1), hsl(0, 0, 0), // colorStartA, colorStartB
58
+ hsl(0, 0, 0, 0), hsl(0, 0, 0, 0), // colorEndA, colorEndB
56
59
  2, .2, .2, .1, .05, // time, sizeStart, sizeEnd, speed, angleSpeed
57
60
  .99, 1, 1, Math.PI, // damping, angleDamping, gravityScale, cone
58
61
  .05, .5, true, true // fadeRate, randomness, collide, additive
59
62
  );
60
63
  particleEmitter.elasticity = .3; // bounce when it collides
61
64
  particleEmitter.trailScale = 2; // stretch in direction of motion
62
- // start the game timer
63
- gameTimer.set();
64
65
  }
65
66
  ///////////////////////////////////////////////////////////////////////////////
66
67
  function gameUpdate() {
@@ -68,7 +69,7 @@ function gameUpdate() {
68
69
  // play sound when mouse is pressed
69
70
  sound_click.play(LittleJS.mousePos);
70
71
  // change particle color and set to fade out
71
- particleEmitter.colorStartA = new Color;
72
+ particleEmitter.colorStartA = hsl();
72
73
  particleEmitter.colorStartB = LittleJS.randColor();
73
74
  particleEmitter.colorEndA = particleEmitter.colorStartA.scale(1, 0);
74
75
  particleEmitter.colorEndB = particleEmitter.colorStartB.scale(1, 0);
@@ -85,7 +86,9 @@ function gameUpdatePost() {
85
86
  ///////////////////////////////////////////////////////////////////////////////
86
87
  function gameRender() {
87
88
  // draw a grey square in the background without using webgl
88
- LittleJS.drawRect(LittleJS.cameraPos, LittleJS.tileCollisionSize.add(vec2(5)), new Color(.2, .2, .2), 0, false);
89
+ LittleJS.drawRect(vec2(16, 8), vec2(20, 14), hsl(0, 0, .6), 0, false);
90
+ // draw the logo as a tile
91
+ LittleJS.drawTile(vec2(21, 5), vec2(4.5), tile(3, 128));
89
92
  }
90
93
  ///////////////////////////////////////////////////////////////////////////////
91
94
  function gameRenderPost() {
@@ -1,14 +1,14 @@
1
1
  /*
2
- Little TypeScript Demo
2
+ Little JS TypeScript Demo
3
3
  - A simple starter project
4
- - Builds to a JavaScript file from TypeScript
4
+ - Shows how to use LittleJS with TypeScript
5
5
  */
6
6
 
7
7
  'use strict';
8
8
 
9
9
  // import module
10
- import * as LittleJS from '../../build/littlejs.esm.js';
11
- const {Vector2, Color, Timer, vec2, tile} = LittleJS;
10
+ import * as LittleJS from '../../dist/littlejs.esm.js';
11
+ const {Vector2, Color, Timer, tile, vec2, hsl, rgb} = LittleJS;
12
12
 
13
13
  // show the LittleJS splash screen
14
14
  LittleJS.setShowSplashScreen(true);
@@ -21,62 +21,63 @@ const medal_example = new LittleJS.Medal(0, 'Example Medal', 'Welcome to LittleJ
21
21
  LittleJS.medalsInit('Hello World');
22
22
 
23
23
  // game variables
24
- let particleEmitter: LittleJS.ParticleEmitter;
25
- let gameTimer = new Timer;
24
+ let particleEmitter;
26
25
 
27
26
  ///////////////////////////////////////////////////////////////////////////////
28
27
  function gameInit()
29
28
  {
30
29
  // create tile collision and visible tile layer
31
- LittleJS.initTileCollision(vec2(32, 16));
32
- const pos = new Vector2;
33
- const tileLayer = new LittleJS.TileLayer(pos, LittleJS.tileCollisionSize);
30
+ const tileCollisionSize = vec2(32, 16);
31
+ LittleJS.initTileCollision(tileCollisionSize);
32
+ const pos = vec2();
33
+ const tileLayer = new LittleJS.TileLayer(pos, tileCollisionSize);
34
34
 
35
35
  // get level data from the tiles image
36
- const imageLevelDataRow = 1;
37
36
  const mainContext = LittleJS.mainContext;
38
37
  const tileImage = LittleJS.textureInfos[0].image;
39
38
  mainContext.drawImage(tileImage, 0, 0);
40
- for (pos.x = LittleJS.tileCollisionSize.x; pos.x--;)
41
- for (pos.y = LittleJS.tileCollisionSize.y; pos.y--;)
39
+ const imageData = mainContext.getImageData(0,0,tileImage.width,tileImage.height).data;
40
+ for (pos.x = tileCollisionSize.x; pos.x--;)
41
+ for (pos.y = tileCollisionSize.y; pos.y--;)
42
42
  {
43
- const imageData = mainContext.getImageData(pos.x, 16*(imageLevelDataRow+1)-pos.y-1, 1, 1).data;
44
- if (imageData[0])
45
- {
46
- const tileIndex = 1;
47
- const direction = LittleJS.randInt(4)
48
- const mirror = LittleJS.randInt(2) ? true : false;
49
- const color = LittleJS.randColor();
50
- const data = new LittleJS.TileLayerData(tileIndex, direction, mirror, color);
51
- tileLayer.setData(pos, data);
52
- LittleJS.setTileCollisionData(pos, 1);
53
- }
43
+ // check if this pixel is set
44
+ const i = pos.x + tileImage.width*(15 + tileCollisionSize.y - pos.y);
45
+ if (!imageData[4*i])
46
+ continue;
47
+
48
+ // set tile data
49
+ const tileIndex = 1;
50
+ const direction = LittleJS.randInt(4)
51
+ const mirror = !LittleJS.randInt(2);
52
+ const color = LittleJS.randColor();
53
+ const data = new LittleJS.TileLayerData(tileIndex, direction, mirror, color);
54
+ tileLayer.setData(pos, data);
55
+ LittleJS.setTileCollisionData(pos, 1);
54
56
  }
57
+
58
+ // draw tile layer with new data
55
59
  tileLayer.redraw();
56
60
 
57
61
  // move camera to center of collision
58
- LittleJS.setCameraPos(LittleJS.tileCollisionSize.scale(.5));
62
+ LittleJS.setCameraPos(tileCollisionSize.scale(.5));
63
+ LittleJS.setCameraScale(48);
59
64
 
60
65
  // enable gravity
61
66
  LittleJS.setGravity(-.01);
62
67
 
63
68
  // create particle emitter
64
- const center = LittleJS.tileCollisionSize.scale(.5).add(vec2(0,9));
65
69
  particleEmitter = new LittleJS.ParticleEmitter(
66
- center, 0, // emitPos, emitAngle
67
- 1, 0, 500, Math.PI, // emitSize, emitTime, emitRate, emiteCone
68
- LittleJS.tile(0, 16), // tileIndex, tileSize
69
- new Color(1,1,1), new Color(0,0,0), // colorStartA, colorStartB
70
- new Color(1,1,1,0), new Color(0,0,0,0), // colorEndA, colorEndB
70
+ vec2(16,9), 0, // emitPos, emitAngle
71
+ 1, 0, 500, Math.PI, // emitSize, emitTime, emitRate, emiteCone
72
+ tile(0, 16), // tileIndex, tileSize
73
+ hsl(1,1,1), hsl(0,0,0), // colorStartA, colorStartB
74
+ hsl(0,0,0,0), hsl(0,0,0,0), // colorEndA, colorEndB
71
75
  2, .2, .2, .1, .05, // time, sizeStart, sizeEnd, speed, angleSpeed
72
76
  .99, 1, 1, Math.PI, // damping, angleDamping, gravityScale, cone
73
- .05, .5, true, true // fadeRate, randomness, collide, additive
77
+ .05, .5, true, true // fadeRate, randomness, collide, additive
74
78
  );
75
79
  particleEmitter.elasticity = .3; // bounce when it collides
76
80
  particleEmitter.trailScale = 2; // stretch in direction of motion
77
-
78
- // start the game timer
79
- gameTimer.set();
80
81
  }
81
82
 
82
83
  ///////////////////////////////////////////////////////////////////////////////
@@ -88,7 +89,7 @@ function gameUpdate()
88
89
  sound_click.play(LittleJS.mousePos);
89
90
 
90
91
  // change particle color and set to fade out
91
- particleEmitter.colorStartA = new Color;
92
+ particleEmitter.colorStartA = hsl();
92
93
  particleEmitter.colorStartB = LittleJS.randColor();
93
94
  particleEmitter.colorEndA = particleEmitter.colorStartA.scale(1,0);
94
95
  particleEmitter.colorEndB = particleEmitter.colorStartB.scale(1,0);
@@ -112,7 +113,10 @@ function gameUpdatePost()
112
113
  function gameRender()
113
114
  {
114
115
  // draw a grey square in the background without using webgl
115
- LittleJS.drawRect(LittleJS.cameraPos, LittleJS.tileCollisionSize.add(vec2(5)), new Color(.2,.2,.2), 0, false);
116
+ LittleJS.drawRect(vec2(16,8), vec2(20,14), hsl(0,0,.6), 0, false);
117
+
118
+ // draw the logo as a tile
119
+ LittleJS.drawTile(vec2(21,5), vec2(4.5), tile(3,128));
116
120
  }
117
121
 
118
122
  ///////////////////////////////////////////////////////////////////////////////
@@ -6,4 +6,4 @@
6
6
  </head><body>
7
7
 
8
8
  <!-- Add your game scripts here -->
9
- <script src=game.js?1812 type=module></script>
9
+ <script src=game.js?192 type=module></script>
Binary file
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "littlejsengine",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "LittleJS - Tiny and Fast HTML5 Game Engine",
5
- "main": "build/littlejs.esm.js",
6
- "types": "build/littlejs.esm.js",
5
+ "main": "dist/littlejs.esm.js",
6
+ "types": "dist/littlejs.d.ts",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/KilledByAPixel/LittleJS.git"