littlejsengine 1.11.9 → 1.11.10

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 (37) hide show
  1. package/README.md +3 -3
  2. package/dist/littlejs.d.ts +482 -479
  3. package/dist/littlejs.esm.js +512 -501
  4. package/dist/littlejs.esm.min.js +1 -1
  5. package/dist/littlejs.js +510 -499
  6. package/dist/littlejs.min.js +1 -1
  7. package/dist/littlejs.release.js +466 -458
  8. package/examples/module/game.js +2 -2
  9. package/examples/shorts/base.html +1 -1
  10. package/examples/starter/game.js +8 -1
  11. package/examples/typescript/build/dist/littlejs.esm.js +4834 -0
  12. package/examples/typescript/build/examples/typescript/build.js +24 -0
  13. package/examples/typescript/build/examples/typescript/game.js +102 -0
  14. package/examples/typescript/build.bat +5 -0
  15. package/examples/typescript/build.js +33 -0
  16. package/examples/typescript/game.js +102 -0
  17. package/examples/typescript/game.ts +134 -0
  18. package/examples/typescript/index.html +10 -0
  19. package/examples/typescript/tiles.png +0 -0
  20. package/examples/typescript/tsconfig.json +8 -0
  21. package/package.json +1 -1
  22. package/plugins/newgrounds.js +38 -34
  23. package/plugins/postProcess.js +18 -4
  24. package/plugins/uiSystem.js +196 -30
  25. package/src/engine.js +21 -20
  26. package/src/engineAudio.js +59 -59
  27. package/src/engineDebug.js +44 -41
  28. package/src/engineDraw.js +58 -58
  29. package/src/engineExport.js +2 -2
  30. package/src/engineInput.js +30 -30
  31. package/src/engineMedals.js +1 -1
  32. package/src/engineObject.js +39 -34
  33. package/src/engineParticles.js +10 -10
  34. package/src/engineSettings.js +74 -72
  35. package/src/engineTileLayer.js +21 -21
  36. package/src/engineUtilities.js +150 -150
  37. package/src/engineWebGL.js +3 -3
@@ -63,7 +63,7 @@ function gameInit()
63
63
 
64
64
  // move camera to center of collision
65
65
  LittleJS.setCameraPos(tileCollisionSize.scale(.5));
66
- LittleJS.setCameraScale(48);
66
+ LittleJS.setCameraScale(32);
67
67
 
68
68
  // enable gravity
69
69
  LittleJS.setGravity(-.01);
@@ -126,7 +126,7 @@ function gameRender()
126
126
  function gameRenderPost()
127
127
  {
128
128
  // draw to overlay canvas for hud rendering
129
- LittleJS.drawTextOverlay('LittleJS with Modules', vec2(LittleJS.mainCanvasSize.x/2, 80), 80);
129
+ LittleJS.drawTextScreen('LittleJS with Modules', vec2(LittleJS.mainCanvasSize.x/2, 80), 80);
130
130
  }
131
131
 
132
132
  ///////////////////////////////////////////////////////////////////////////////
@@ -10,7 +10,7 @@ canvasFixedSize = vec2(960, 540);
10
10
  // fix bleeding from neighboring pixels
11
11
  tileFixBleedScale = .5;
12
12
 
13
- // allow improved scaling
13
+ // allow improved canvas scaling for smoother graphics
14
14
  canvasPixelated = false;
15
15
 
16
16
  // disable watermark
@@ -58,7 +58,7 @@ function gameInit()
58
58
 
59
59
  // setup camera
60
60
  cameraPos = vec2(16,8);
61
- cameraScale = 48;
61
+ cameraScale = 32;
62
62
 
63
63
  // enable gravity
64
64
  gravity = -.01;
@@ -96,6 +96,13 @@ function gameUpdate()
96
96
  medal_example.unlock();
97
97
  }
98
98
 
99
+ if (mouseWheel)
100
+ {
101
+ // zoom in and out with mouse wheel
102
+ cameraScale -= sign(mouseWheel)*cameraScale/5;
103
+ cameraScale = clamp(cameraScale, 10, 300);
104
+ }
105
+
99
106
  // move particles to mouse location if on screen
100
107
  if (mousePosScreen.x)
101
108
  particleEmitter.pos = mousePos;