@cjcoding-git/gamelib 0.0.0-stage → 1.1.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.
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/dependabot.yml +6 -0
- package/.github/workflows/build.yml +54 -0
- package/.github/workflows/release.yml +79 -0
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/assets/test-frog.gltf +1921 -0
- package/assets/test-frog.gml +0 -0
- package/buildtime.txt +1 -0
- package/buildversion.txt +1 -0
- package/dist/GameLib.js +71599 -0
- package/dist/GameLib.min.js +8 -0
- package/docs/2D/API.md +1 -0
- package/docs/2D/GETTING_STARTED.md +1 -0
- package/docs/3D/API.md +1 -0
- package/docs/3D/GETTING_STARTED.md +23 -0
- package/docs/Core/API.md +1 -0
- package/docs/Core/GETTING_STARTED.md +1 -0
- package/docs/README.md +32 -0
- package/package.json +21 -4
- package/scripts/gltf2gml.html +312 -0
- package/src/2D/Box.js +42 -0
- package/src/2D/Coord.js +17 -0
- package/src/2D/GameLib.js +317 -0
- package/src/2D/Renderable.js +31 -0
- package/src/2D/Rotation.js +42 -0
- package/src/2D/Size.js +17 -0
- package/src/2D/Sprite.js +56 -0
- package/src/2D/UI/Button.js +52 -0
- package/src/2D/UI/TextInput.js +77 -0
- package/src/2D/UI/UIElement.js +10 -0
- package/src/2D/UI/index.js +15 -0
- package/src/2D/index.js +24 -0
- package/src/3D/Camera.js +25 -0
- package/src/3D/GameLib.js +202 -0
- package/src/3D/Geometry/Box.js +39 -0
- package/src/3D/Geometry/Cone.js +45 -0
- package/src/3D/Geometry/ModelLoaders/GLBLoader.js +12 -0
- package/src/3D/Geometry/ModelLoaders/GLTFLoader.js +12 -0
- package/src/3D/Geometry/ModelLoaders/GMLLoader.js +114 -0
- package/src/3D/Geometry/ModelLoaders/OBJLoader.js +12 -0
- package/src/3D/Geometry/ModelLoaders/index.js +17 -0
- package/src/3D/Geometry/Pyramid.js +55 -0
- package/src/3D/Geometry/Sphere.js +37 -0
- package/src/3D/Geometry/index.js +19 -0
- package/src/3D/Lighting/AmbientLight.js +17 -0
- package/src/3D/Lighting/DirectionalLight.js +17 -0
- package/src/3D/Lighting/PointLight.js +17 -0
- package/src/3D/Lighting/index.js +15 -0
- package/src/3D/Material.js +181 -0
- package/src/3D/Mesh.js +142 -0
- package/src/3D/Object.js +13 -0
- package/src/3D/Position.js +15 -0
- package/src/3D/Rotation.js +21 -0
- package/src/3D/Scale.js +10 -0
- package/src/3D/ShaderFactory/FunctionParam.js +14 -0
- package/src/3D/ShaderFactory/Modifiers/Variable.js +85 -0
- package/src/3D/ShaderFactory/Modifiers/index.js +11 -0
- package/src/3D/ShaderFactory/Node.js +25 -0
- package/src/3D/ShaderFactory/NodeTypes/A.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/Add.js +13 -0
- package/src/3D/ShaderFactory/NodeTypes/AssignVariable.js +11 -0
- package/src/3D/ShaderFactory/NodeTypes/Clamp.js +14 -0
- package/src/3D/ShaderFactory/NodeTypes/Constant.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/Define.js +11 -0
- package/src/3D/ShaderFactory/NodeTypes/Divide.js +13 -0
- package/src/3D/ShaderFactory/NodeTypes/Dot.js +14 -0
- package/src/3D/ShaderFactory/NodeTypes/Exp2.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/Function.js +36 -0
- package/src/3D/ShaderFactory/NodeTypes/Group.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/Header.js +12 -0
- package/src/3D/ShaderFactory/NodeTypes/Length.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/MainFunction.js +7 -0
- package/src/3D/ShaderFactory/NodeTypes/Max.js +14 -0
- package/src/3D/ShaderFactory/NodeTypes/Mix.js +14 -0
- package/src/3D/ShaderFactory/NodeTypes/Multiply.js +13 -0
- package/src/3D/ShaderFactory/NodeTypes/Negative.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/NodeTypes.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/Normalize.js +10 -0
- package/src/3D/ShaderFactory/NodeTypes/Precision.js +11 -0
- package/src/3D/ShaderFactory/NodeTypes/RGB.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/Subtract.js +13 -0
- package/src/3D/ShaderFactory/NodeTypes/Symbol.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/Texture2D.js +10 -0
- package/src/3D/ShaderFactory/NodeTypes/Variable.js +22 -0
- package/src/3D/ShaderFactory/NodeTypes/Vector.js +15 -0
- package/src/3D/ShaderFactory/NodeTypes/XYZ.js +9 -0
- package/src/3D/ShaderFactory/NodeTypes/index.js +32 -0
- package/src/3D/ShaderFactory/PrecisionTypes.js +8 -0
- package/src/3D/ShaderFactory/Program.js +41 -0
- package/src/3D/ShaderFactory/VariableTypes.js +49 -0
- package/src/3D/ShaderFactory/index.js +45 -0
- package/src/3D/Texture.js +59 -0
- package/src/3D/TextureFactory.js +22 -0
- package/src/3D/Transform.js +35 -0
- package/src/3D/UI/UIImage.js +24 -0
- package/src/3D/UI/UILoading.js +41 -0
- package/src/3D/UI/UIObject.js +16 -0
- package/src/3D/UI/UIPath.js +25 -0
- package/src/3D/UI/UIRenderer.js +207 -0
- package/src/3D/UI/UIText.js +35 -0
- package/src/3D/UI/index.js +19 -0
- package/src/3D/Utils.js +9 -0
- package/src/3D/index.js +43 -0
- package/src/Core/AssetManager.js +116 -0
- package/src/Core/AudioManager.js +151 -0
- package/src/Core/Error.js +9 -0
- package/src/Core/FullscreenManager.js +49 -0
- package/src/Core/GameLibBase.js +29 -0
- package/src/Core/InputManager.js +195 -0
- package/src/Core/Loading.js +111 -0
- package/src/Core/Matrix/index.js +11 -0
- package/src/Core/Matrix/mat4.js +178 -0
- package/src/Core/Multiplayer.js +54 -0
- package/src/Core/Network/PeerNetwork.js +410 -0
- package/src/Core/Network/index.js +11 -0
- package/src/Core/Storage.js +45 -0
- package/src/Core/Store.js +45 -0
- package/src/Core/Utils.js +34 -0
- package/src/Core/index.js +30 -0
- package/src/Lib/Ammo.js +72 -0
- package/src/Lib/Matter.js +1 -0
- package/src/Shaders/Material/Fragment/GL1.glsl +49 -0
- package/src/Shaders/Material/Fragment/GL2.glsl +51 -0
- package/src/Shaders/Material/Vertex/GL1.glsl +19 -0
- package/src/Shaders/Material/Vertex/GL2.glsl +20 -0
- package/src/Shaders/UI/Fragment/GL1.glsl +5 -0
- package/src/Shaders/UI/Fragment/GL2.glsl +7 -0
- package/src/Shaders/UI/Vertex/GL1.glsl +10 -0
- package/src/Shaders/UI/Vertex/GL2.glsl +11 -0
- package/src/Shaders/UITexture/Fragment/GL1.glsl +6 -0
- package/src/Shaders/UITexture/Fragment/GL2.glsl +8 -0
- package/src/Shaders/UITexture/Vertex/GL1.glsl +10 -0
- package/src/Shaders/UITexture/Vertex/GL2.glsl +11 -0
- package/src/index.js +19 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
inputs:
|
|
5
|
+
version:
|
|
6
|
+
description: 'Version (x.x.x)'
|
|
7
|
+
required: true
|
|
8
|
+
default: ''
|
|
9
|
+
type: string
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout Code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
- name: Update package.json
|
|
19
|
+
run: |
|
|
20
|
+
npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
|
|
21
|
+
date > buildtime.txt
|
|
22
|
+
echo "${{ inputs.version }}" > buildversion.txt
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: '20'
|
|
27
|
+
cache: 'npm'
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
npm install
|
|
31
|
+
npm install -g esbuild
|
|
32
|
+
npm install -g terser
|
|
33
|
+
- name: Clean dist directory
|
|
34
|
+
run: |
|
|
35
|
+
rm -rf dist/*
|
|
36
|
+
mkdir -p dist/
|
|
37
|
+
- name: Create build files
|
|
38
|
+
run: |
|
|
39
|
+
VERSION="${{ inputs.version }}"
|
|
40
|
+
UNMINIFIED_OUT="dist/GameLib.js"
|
|
41
|
+
MINIFIED_OUT="dist/GameLib.min.js"
|
|
42
|
+
esbuild src/index.js --bundle --format=iife --platform=browser --outfile=$UNMINIFIED_OUT --external:ws --external:crypto --external:path --external:fs --loader:.glsl=text
|
|
43
|
+
npx terser $UNMINIFIED_OUT -o $MINIFIED_OUT --compress --mangle --mangle-props regex=/^_/
|
|
44
|
+
- name: Push changes
|
|
45
|
+
run: |
|
|
46
|
+
git config --global user.name "github-actions[bot]"
|
|
47
|
+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
48
|
+
git add package.json
|
|
49
|
+
git add package-lock.json
|
|
50
|
+
git add buildtime.txt
|
|
51
|
+
git add buildversion.txt
|
|
52
|
+
git add dist/
|
|
53
|
+
git diff-index --quiet HEAD || git commit -m "chore: build version ${{ inputs.version }}"
|
|
54
|
+
git push origin main
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Build and Release
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
inputs:
|
|
5
|
+
version:
|
|
6
|
+
description: 'Version (x.x.x)'
|
|
7
|
+
required: true
|
|
8
|
+
default: ''
|
|
9
|
+
type: string
|
|
10
|
+
body:
|
|
11
|
+
description: 'Release Notes'
|
|
12
|
+
required: true
|
|
13
|
+
default: 'No Release Notes'
|
|
14
|
+
type: string
|
|
15
|
+
jobs:
|
|
16
|
+
release:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
contents: write
|
|
20
|
+
id-token: write
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout Code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
- name: Update package.json
|
|
25
|
+
run: |
|
|
26
|
+
npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
|
|
27
|
+
date > buildtime.txt
|
|
28
|
+
echo "${{ inputs.version }}" > buildversion.txt
|
|
29
|
+
- name: Setup Node.js
|
|
30
|
+
uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: '22'
|
|
33
|
+
cache: 'npm'
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: |
|
|
36
|
+
npm install
|
|
37
|
+
npm install -g esbuild
|
|
38
|
+
npm install -g terser
|
|
39
|
+
- name: Clean dist directory
|
|
40
|
+
run: |
|
|
41
|
+
rm -rf dist/*
|
|
42
|
+
mkdir -p dist/
|
|
43
|
+
- name: Create build files
|
|
44
|
+
run: |
|
|
45
|
+
VERSION="${{ inputs.version }}"
|
|
46
|
+
UNMINIFIED_OUT="dist/GameLib.js"
|
|
47
|
+
MINIFIED_OUT="dist/GameLib.min.js"
|
|
48
|
+
esbuild src/index.js --bundle --format=iife --platform=browser --outfile=$UNMINIFIED_OUT --external:ws --external:crypto --external:path --external:fs --loader:.glsl=text
|
|
49
|
+
npx terser $UNMINIFIED_OUT -o $MINIFIED_OUT --compress --mangle --mangle-props regex=/^_/
|
|
50
|
+
- name: Push changes
|
|
51
|
+
run: |
|
|
52
|
+
git config --global user.name "github-actions[bot]"
|
|
53
|
+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
54
|
+
git add package.json
|
|
55
|
+
git add package-lock.json
|
|
56
|
+
git add buildtime.txt
|
|
57
|
+
git add buildversion.txt
|
|
58
|
+
git add dist/
|
|
59
|
+
git diff-index --quiet HEAD || git commit -m "chore: release version ${{ inputs.version }}"
|
|
60
|
+
git push origin main
|
|
61
|
+
- name: Create GitHub release
|
|
62
|
+
uses: softprops/action-gh-release@v2
|
|
63
|
+
with:
|
|
64
|
+
tag_name: "v${{ inputs.version }}"
|
|
65
|
+
name: "Release v${{ inputs.version }}"
|
|
66
|
+
body: "Release Notes: ${{ inputs.body }}"
|
|
67
|
+
files: |
|
|
68
|
+
dist/GameLib.js
|
|
69
|
+
dist/GameLib.min.js
|
|
70
|
+
env:
|
|
71
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
72
|
+
- name: Debug npm auth
|
|
73
|
+
run: |
|
|
74
|
+
echo "Checking npm registry auth configuration:"
|
|
75
|
+
npm config get registry
|
|
76
|
+
ls -la ~/.npmrc 2>/dev/null || echo "No global .npmrc found"
|
|
77
|
+
- name: Release to NPM
|
|
78
|
+
run: |
|
|
79
|
+
npx npm@latest publish --provenance --access public
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Charles Jager
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GameLib
|
|
2
|
+
[](https://www.jsdelivr.com/package/gh/cjCoding-git/GameLib)
|
|
3
|
+

|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
A basic game library that simplifies development while still allowing for complete control.
|
|
6
|
+
|
|
7
|
+
[Read the Docs](docs/README.md)
|