littlejsengine 1.14.4 â 1.14.5
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 +3 -3
- package/dist/littlejs.d.ts +2 -2
- package/dist/littlejs.esm.js +7 -7
- package/dist/littlejs.esm.min.js +1 -1
- package/dist/littlejs.js +7 -7
- package/dist/littlejs.min.js +1 -1
- package/dist/littlejs.release.js +1 -1
- package/examples/shorts/music.js +3 -3
- package/package.json +1 -1
- package/reference.md +1 -1
- package/src/engine.js +1 -1
- package/src/engineDebug.js +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LittleJS - The Tiny Fast JavaScript Game Engine
|
|
2
2
|
|
|
3
|
-
<div align=center>
|
|
3
|
+
<div align='center'>
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ The code is clean and well documented with some fun examples to get you started
|
|
|
22
22
|
|
|
23
23
|
*The Second Annual LittleJS Game Jam will take place From Oct 3 to Nov 3! Unleash your creativity and develop amazing games using the LittleJS game engine. đšī¸đŽ [Sign up today and get more info about the jam on itch.io!](https://itch.io/jam/littlejs-game-jam-2025)*
|
|
24
24
|
|
|
25
|
-
<div align=center>
|
|
25
|
+
<div align='center'>
|
|
26
26
|
|
|
27
27
|
## [Demos](https://killedbyapixel.github.io/LittleJS/examples) | [Docs](https://killedbyapixel.github.io/LittleJS/docs) | [Trailer](https://youtu.be/chuBzGjv7Ms) | [Discord](https://discord.gg/zb7hcGkyZe) | [Tutorial](https://github.com/KilledByAPixel/LittleJS/blob/main/examples/breakoutTutorial/README.md) | [FAQ](https://github.com/KilledByAPixel/LittleJS/blob/main/FAQ.md)
|
|
28
28
|
|
|
@@ -80,7 +80,7 @@ LittleJS is a small but powerful game engine with many features and no dependenc
|
|
|
80
80
|
|
|
81
81
|
To get started download the latest LittleJS package from GitHub or install via npm: ```npm install littlejsengine```
|
|
82
82
|
|
|
83
|
-
*You need to run a local web server to run LittleJS games during development!* You may see a console error like
|
|
83
|
+
*You need to run a local web server to run LittleJS games during development!* You may see a console error like 'The image element contains cross-origin data.' Don't panic, it's easy to fix! If you are using [Visual Studio Code](https://code.visualstudio.com/) there is a [Live Preview Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) that will handle this for you automatically. Another option is to setup a simple local web server like [http-server](https://www.npmjs.com/package/http-server) via npm.
|
|
84
84
|
|
|
85
85
|
- [Watch this GitNation talk](https://youtu.be/_dXKU0WgAj8?si=ZDXLYAFDWp54hrGT) to hear more about LittleJS works and get some tips on how to use it.
|
|
86
86
|
- Learn how to make a simple game from scratch with [The Breakout Tutorial.](https://github.com/KilledByAPixel/LittleJS/tree/main/examples/breakoutTutorial)
|
package/dist/littlejs.d.ts
CHANGED
|
@@ -168,12 +168,12 @@ declare module "littlejsengine" {
|
|
|
168
168
|
export function debugPoly(pos: Vector2, points: Array<Vector2>, color?: string, time?: number, angle?: number, fill?: boolean): void;
|
|
169
169
|
/** Draw a debug circle in world space
|
|
170
170
|
* @param {Vector2} pos
|
|
171
|
-
* @param {number} [
|
|
171
|
+
* @param {number} [size] - diameter
|
|
172
172
|
* @param {string} [color]
|
|
173
173
|
* @param {number} [time]
|
|
174
174
|
* @param {boolean} [fill]
|
|
175
175
|
* @memberof Debug */
|
|
176
|
-
export function debugCircle(pos: Vector2,
|
|
176
|
+
export function debugCircle(pos: Vector2, size?: number, color?: string, time?: number, fill?: boolean): void;
|
|
177
177
|
/** Draw a debug point in world space
|
|
178
178
|
* @param {Vector2} pos
|
|
179
179
|
* @param {string} [color]
|
package/dist/littlejs.esm.js
CHANGED
|
@@ -33,7 +33,7 @@ const engineName = 'LittleJS';
|
|
|
33
33
|
* @type {string}
|
|
34
34
|
* @default
|
|
35
35
|
* @memberof Engine */
|
|
36
|
-
const engineVersion = '1.14.
|
|
36
|
+
const engineVersion = '1.14.5';
|
|
37
37
|
|
|
38
38
|
/** Frames per second to update
|
|
39
39
|
* @type {number}
|
|
@@ -749,15 +749,15 @@ function debugPoly(pos, points, color='#fff', time=0, angle=0, fill=false)
|
|
|
749
749
|
|
|
750
750
|
/** Draw a debug circle in world space
|
|
751
751
|
* @param {Vector2} pos
|
|
752
|
-
* @param {number} [
|
|
752
|
+
* @param {number} [size] - diameter
|
|
753
753
|
* @param {string} [color]
|
|
754
754
|
* @param {number} [time]
|
|
755
755
|
* @param {boolean} [fill]
|
|
756
756
|
* @memberof Debug */
|
|
757
|
-
function debugCircle(pos,
|
|
757
|
+
function debugCircle(pos, size=0, color='#fff', time=0, fill=false)
|
|
758
758
|
{
|
|
759
759
|
ASSERT(typeof color === 'string', 'pass in css color strings');
|
|
760
|
-
debugPrimitives.push({pos, size
|
|
760
|
+
debugPrimitives.push({pos, size, color, time:new Timer(time), angle:0, fill});
|
|
761
761
|
}
|
|
762
762
|
|
|
763
763
|
/** Draw a debug point in world space
|
|
@@ -957,7 +957,7 @@ function debugRender()
|
|
|
957
957
|
{
|
|
958
958
|
const drawPos = centerPos.add(vec2(j*stickScale*2, i*stickScale*3));
|
|
959
959
|
const stickPos = drawPos.add(sticks[j].scale(stickScale));
|
|
960
|
-
debugCircle(drawPos, stickScale, '#fff7',0,true);
|
|
960
|
+
debugCircle(drawPos, stickScale*2, '#fff7',0,true);
|
|
961
961
|
debugLine(drawPos, stickPos, '#f00');
|
|
962
962
|
debugPoint(stickPos, '#f00');
|
|
963
963
|
}
|
|
@@ -965,7 +965,7 @@ function debugRender()
|
|
|
965
965
|
{
|
|
966
966
|
const drawPos = centerPos.add(vec2(j*buttonScale*2, i*stickScale*3-stickScale-buttonScale));
|
|
967
967
|
const pressed = gamepad.buttons[j].pressed;
|
|
968
|
-
debugCircle(drawPos, buttonScale, pressed ? '#f00' : '#fff7', 0, true);
|
|
968
|
+
debugCircle(drawPos, buttonScale*2, pressed ? '#f00' : '#fff7', 0, true);
|
|
969
969
|
debugText(''+j, drawPos, .2);
|
|
970
970
|
}
|
|
971
971
|
}
|
|
@@ -1065,7 +1065,7 @@ function debugRender()
|
|
|
1065
1065
|
{
|
|
1066
1066
|
// circle
|
|
1067
1067
|
overlayContext.beginPath();
|
|
1068
|
-
overlayContext.arc(0, 0, p.size*cameraScale, 0, 9);
|
|
1068
|
+
overlayContext.arc(0, 0, p.size*cameraScale/2, 0, 9);
|
|
1069
1069
|
p.fill && overlayContext.fill();
|
|
1070
1070
|
overlayContext.stroke();
|
|
1071
1071
|
}
|