frigame3 3.0.0 → 3.0.1
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/dist/Animation.d.ts +42 -0
- package/dist/Animation.js +189 -0
- package/dist/BaseSprite.d.ts +116 -0
- package/dist/BaseSprite.js +518 -0
- package/dist/Gradient.d.ts +31 -0
- package/dist/Gradient.js +89 -0
- package/dist/Playground.d.ts +48 -0
- package/dist/Playground.js +167 -0
- package/dist/Rect.d.ts +63 -0
- package/dist/Rect.js +155 -0
- package/dist/Rectangle.d.ts +31 -0
- package/dist/Rectangle.js +69 -0
- package/dist/Renderer.d.ts +23 -0
- package/dist/Renderer.js +1 -0
- package/dist/ResourceManager.d.ts +21 -0
- package/dist/ResourceManager.js +100 -0
- package/dist/Sprite.d.ts +56 -0
- package/dist/Sprite.js +437 -0
- package/dist/SpriteGroup.d.ts +39 -0
- package/dist/SpriteGroup.js +176 -0
- package/dist/canvasRenderer/renderGroup.d.ts +15 -0
- package/dist/canvasRenderer/renderGroup.js +134 -0
- package/dist/canvasRenderer/renderPlayground.d.ts +9 -0
- package/dist/canvasRenderer/renderPlayground.js +67 -0
- package/dist/canvasRenderer/renderRectangle.d.ts +15 -0
- package/dist/canvasRenderer/renderRectangle.js +287 -0
- package/dist/canvasRenderer/renderSprite.d.ts +4 -0
- package/dist/canvasRenderer/renderSprite.js +93 -0
- package/dist/canvasRenderer.d.ts +2 -0
- package/dist/canvasRenderer.js +19 -0
- package/dist/dummyRenderer.d.ts +2 -0
- package/dist/dummyRenderer.js +41 -0
- package/dist/plugins/GamepadTracker.d.ts +15 -0
- package/dist/plugins/GamepadTracker.js +74 -0
- package/dist/plugins/Tilemap.d.ts +26 -0
- package/dist/plugins/Tilemap.js +85 -0
- package/dist/plugins/Vec2.d.ts +69 -0
- package/dist/plugins/Vec2.js +296 -0
- package/dist/plugins/fx/Shaker.d.ts +46 -0
- package/dist/plugins/fx/Shaker.js +190 -0
- package/dist/plugins/fx/Tweener.d.ts +42 -0
- package/dist/plugins/fx/Tweener.js +166 -0
- package/dist/plugins/fx/easing.d.ts +32 -0
- package/dist/plugins/fx/easing.js +192 -0
- package/dist/plugins/isometric/ISOMixin.d.ts +138 -0
- package/dist/plugins/isometric/ISOMixin.js +322 -0
- package/dist/plugins/isometric/ISORectangle.d.ts +151 -0
- package/dist/plugins/isometric/ISORectangle.js +127 -0
- package/dist/plugins/isometric/ISOSprite.d.ts +157 -0
- package/dist/plugins/isometric/ISOSprite.js +176 -0
- package/dist/plugins/isometric/ISOSpriteGroup.d.ts +151 -0
- package/dist/plugins/isometric/ISOSpriteGroup.js +116 -0
- package/dist/plugins/isometric/ISOTilemap.d.ts +24 -0
- package/dist/plugins/isometric/ISOTilemap.js +85 -0
- package/dist/plugins/isometric/utils.d.ts +2 -0
- package/dist/plugins/isometric/utils.js +10 -0
- package/dist/plugins/keyTracker.d.ts +3 -0
- package/dist/plugins/keyTracker.js +23 -0
- package/dist/plugins/mixer.d.ts +72 -0
- package/dist/plugins/mixer.js +396 -0
- package/dist/plugins/sorted/SortedAnimation.d.ts +13 -0
- package/dist/plugins/sorted/SortedAnimation.js +27 -0
- package/dist/plugins/sorted/SortedGroup.d.ts +137 -0
- package/dist/plugins/sorted/SortedGroup.js +61 -0
- package/dist/plugins/sorted/SortedMixin.d.ts +122 -0
- package/dist/plugins/sorted/SortedMixin.js +153 -0
- package/dist/plugins/sorted/SortedRectangle.d.ts +127 -0
- package/dist/plugins/sorted/SortedRectangle.js +17 -0
- package/dist/plugins/sorted/SortedSprite.d.ts +130 -0
- package/dist/plugins/sorted/SortedSprite.js +35 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +33 -0
- package/package.json +6 -2
- package/CHANGELOG.md +0 -13
- package/biome.json +0 -93
- package/demo/package-lock.json +0 -515
- package/demo/package.json +0 -19
- package/demo/snake/index.html +0 -16
- package/demo/snake/index.ts +0 -110
- package/demo/tetris/index.html +0 -16
- package/demo/tetris/index.ts +0 -536
- package/demo/tsconfig.json +0 -53
- package/src/Animation.ts +0 -266
- package/src/BaseSprite.ts +0 -682
- package/src/Gradient.ts +0 -120
- package/src/Playground.ts +0 -247
- package/src/Rect.ts +0 -237
- package/src/Rectangle.ts +0 -108
- package/src/Renderer.ts +0 -28
- package/src/ResourceManager.ts +0 -145
- package/src/Sprite.ts +0 -484
- package/src/SpriteGroup.ts +0 -258
- package/src/canvasRenderer/renderGroup.ts +0 -194
- package/src/canvasRenderer/renderPlayground.ts +0 -103
- package/src/canvasRenderer/renderRectangle.ts +0 -421
- package/src/canvasRenderer/renderSprite.ts +0 -148
- package/src/canvasRenderer.ts +0 -38
- package/src/dummyRenderer.ts +0 -62
- package/src/plugins/GamepadTracker.ts +0 -97
- package/src/plugins/Tilemap.ts +0 -123
- package/src/plugins/Vec2.ts +0 -420
- package/src/plugins/fx/Shaker.ts +0 -293
- package/src/plugins/fx/Tweener.ts +0 -252
- package/src/plugins/fx/easing.ts +0 -276
- package/src/plugins/isometric/ISOMixin.ts +0 -444
- package/src/plugins/isometric/ISORectangle.ts +0 -183
- package/src/plugins/isometric/ISOSprite.ts +0 -228
- package/src/plugins/isometric/ISOSpriteGroup.ts +0 -155
- package/src/plugins/isometric/ISOTilemap.ts +0 -122
- package/src/plugins/isometric/utils.ts +0 -19
- package/src/plugins/keyTracker.ts +0 -31
- package/src/plugins/mixer.ts +0 -523
- package/src/plugins/sorted/SortedAnimation.ts +0 -53
- package/src/plugins/sorted/SortedGroup.ts +0 -94
- package/src/plugins/sorted/SortedMixin.ts +0 -203
- package/src/plugins/sorted/SortedRectangle.ts +0 -35
- package/src/plugins/sorted/SortedSprite.ts +0 -56
- package/src/utils.ts +0 -53
- package/test/animation/index.html +0 -20
- package/test/animation/index.ts +0 -253
- package/test/animation/mh.png +0 -0
- package/test/animation/moh.png +0 -0
- package/test/animation/mov.png +0 -0
- package/test/animation/mv.png +0 -0
- package/test/animation/rebound.png +0 -0
- package/test/animation/reboundm.png +0 -0
- package/test/animation/sh.png +0 -0
- package/test/animation/soh.png +0 -0
- package/test/animation/sov.png +0 -0
- package/test/animation/sv.png +0 -0
- package/test/isometric1/beach.png +0 -0
- package/test/isometric1/foglie.png +0 -0
- package/test/isometric1/grass.png +0 -0
- package/test/isometric1/index.html +0 -17
- package/test/isometric1/index.ts +0 -68
- package/test/isometric1/tronco.png +0 -0
- package/test/isometric1/untitled.tmx +0 -25
- package/test/isometric1/water.png +0 -0
- package/test/isometric2/banner.png +0 -0
- package/test/isometric2/books.png +0 -0
- package/test/isometric2/candlestick.png +0 -0
- package/test/isometric2/ice.png +0 -0
- package/test/isometric2/index.html +0 -16
- package/test/isometric2/index.ts +0 -129
- package/test/isometric2/knight_se.png +0 -0
- package/test/isometric2/tile.png +0 -0
- package/test/isometric2/untitled.tmx +0 -36
- package/test/isometric2/wall.png +0 -0
- package/test/layers/boy.png +0 -0
- package/test/layers/catgirl.png +0 -0
- package/test/layers/fri1.svg +0 -8
- package/test/layers/grassblock.png +0 -0
- package/test/layers/horngirl.png +0 -0
- package/test/layers/index.html +0 -17
- package/test/layers/index.ts +0 -191
- package/test/layers/pinkgirl.png +0 -0
- package/test/layers/render_ruler.py +0 -57
- package/test/layers/ruler.png +0 -0
- package/test/layers/sh.png +0 -0
- package/test/mixer/dieci.opus +0 -0
- package/test/mixer/dieci.wav +0 -0
- package/test/mixer/index.html +0 -33
- package/test/mixer/index.ts +0 -206
- package/test/mixer/news_intro.mp3 +0 -0
- package/test/mixer/news_intro.ogg +0 -0
- package/test/mixer/prova.mp3 +0 -0
- package/test/mixer/prova.ogg +0 -0
- package/test/package-lock.json +0 -515
- package/test/package.json +0 -19
- package/test/sorted/Brown Block.png +0 -0
- package/test/sorted/index.html +0 -16
- package/test/sorted/index.ts +0 -38
- package/test/transformation1/index.html +0 -17
- package/test/transformation1/index.ts +0 -51
- package/test/transformation1/sh.png +0 -0
- package/test/transformation2/index.html +0 -20
- package/test/transformation2/index.ts +0 -71
- package/test/transformation2/sh.png +0 -0
- package/test/tsconfig.json +0 -53
- package/tsconfig.json +0 -51
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Animation } from "frigame3/dist/Animation.js";
|
|
2
|
-
import { canvasRenderer } from "frigame3/dist/canvasRenderer.js";
|
|
3
|
-
import { Playground } from "frigame3/dist/Playground.js";
|
|
4
|
-
import { ResourceManager } from "frigame3/dist/ResourceManager.js";
|
|
5
|
-
import { Sprite } from "frigame3/dist/Sprite.js";
|
|
6
|
-
|
|
7
|
-
void (async (): Promise<void> => {
|
|
8
|
-
const rm = new ResourceManager();
|
|
9
|
-
|
|
10
|
-
const animation = rm.addResource(
|
|
11
|
-
new Animation({
|
|
12
|
-
imageURL: "sh.png",
|
|
13
|
-
type: "horizontal",
|
|
14
|
-
numberOfFrame: 4,
|
|
15
|
-
rate: 300,
|
|
16
|
-
}),
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
await rm.preload();
|
|
20
|
-
|
|
21
|
-
const playground = new Playground(canvasRenderer);
|
|
22
|
-
const sg = playground.scenegraph;
|
|
23
|
-
|
|
24
|
-
let angle = 45;
|
|
25
|
-
let angle_rad = (angle * Math.PI) / 180;
|
|
26
|
-
|
|
27
|
-
const aRotateScale = sg.addChild(
|
|
28
|
-
new Sprite({
|
|
29
|
-
animation: animation,
|
|
30
|
-
left: 16,
|
|
31
|
-
top: 16,
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
34
|
-
const scaleARotate = sg.addChild(
|
|
35
|
-
new Sprite({
|
|
36
|
-
animation: animation,
|
|
37
|
-
left: 80,
|
|
38
|
-
top: 16,
|
|
39
|
-
}),
|
|
40
|
-
);
|
|
41
|
-
const rotateAScale = sg.addChild(
|
|
42
|
-
new Sprite({
|
|
43
|
-
animation: animation,
|
|
44
|
-
left: 180,
|
|
45
|
-
top: 16,
|
|
46
|
-
}),
|
|
47
|
-
);
|
|
48
|
-
const aScaleRotate = sg.addChild(
|
|
49
|
-
new Sprite({
|
|
50
|
-
animation: animation,
|
|
51
|
-
left: 240,
|
|
52
|
-
top: 16,
|
|
53
|
-
}),
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
playground.registerCallback(() => {
|
|
57
|
-
aRotateScale.angle = angle_rad;
|
|
58
|
-
aRotateScale.scale = 2;
|
|
59
|
-
scaleARotate.scale = 2;
|
|
60
|
-
scaleARotate.angle = -angle_rad;
|
|
61
|
-
rotateAScale.angle = Math.PI / 4;
|
|
62
|
-
rotateAScale.scale = Math.cos(angle_rad) * 2;
|
|
63
|
-
aScaleRotate.scale = -Math.cos(angle_rad) * 2;
|
|
64
|
-
aScaleRotate.angle = Math.PI / 4;
|
|
65
|
-
angle -= 1;
|
|
66
|
-
if (angle < -180) {
|
|
67
|
-
angle = 180;
|
|
68
|
-
}
|
|
69
|
-
angle_rad = (angle * Math.PI) / 180;
|
|
70
|
-
}, 30);
|
|
71
|
-
})();
|
|
Binary file
|
package/test/tsconfig.json
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
|
-
// "rootDir": "./src",
|
|
6
|
-
// "outDir": "./dist",
|
|
7
|
-
|
|
8
|
-
// Environment Settings
|
|
9
|
-
// See also https://aka.ms/tsconfig/module
|
|
10
|
-
"module": "nodenext",
|
|
11
|
-
"target": "esnext",
|
|
12
|
-
"types": [],
|
|
13
|
-
// For nodejs:
|
|
14
|
-
// "lib": ["esnext"],
|
|
15
|
-
// "types": ["node"],
|
|
16
|
-
// and npm install -D @types/node
|
|
17
|
-
|
|
18
|
-
// Other Outputs
|
|
19
|
-
// "sourceMap": true,
|
|
20
|
-
// "declaration": true,
|
|
21
|
-
// "declarationMap": true,
|
|
22
|
-
"noEmit": true,
|
|
23
|
-
|
|
24
|
-
// Stricter Typechecking Options
|
|
25
|
-
"noUncheckedIndexedAccess": true,
|
|
26
|
-
"exactOptionalPropertyTypes": true,
|
|
27
|
-
|
|
28
|
-
// Style Options
|
|
29
|
-
"noImplicitReturns": true,
|
|
30
|
-
"noImplicitOverride": true,
|
|
31
|
-
"noUnusedLocals": true,
|
|
32
|
-
"noUnusedParameters": true,
|
|
33
|
-
"noFallthroughCasesInSwitch": true,
|
|
34
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
35
|
-
|
|
36
|
-
// Recommended Options
|
|
37
|
-
"strict": true,
|
|
38
|
-
"jsx": "react-jsx",
|
|
39
|
-
"verbatimModuleSyntax": true,
|
|
40
|
-
"isolatedModules": true,
|
|
41
|
-
"noUncheckedSideEffectImports": true,
|
|
42
|
-
"moduleDetection": "force",
|
|
43
|
-
"skipLibCheck": true,
|
|
44
|
-
|
|
45
|
-
// Customizations
|
|
46
|
-
"allowUnreachableCode": false,
|
|
47
|
-
"allowUnusedLabels": false,
|
|
48
|
-
"erasableSyntaxOnly": true,
|
|
49
|
-
// "isolatedDeclarations": true,
|
|
50
|
-
},
|
|
51
|
-
"include": ["./**/*"],
|
|
52
|
-
"exclude": ["node_modules"]
|
|
53
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
|
-
"rootDir": "./src",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
|
|
8
|
-
// Environment Settings
|
|
9
|
-
// See also https://aka.ms/tsconfig/module
|
|
10
|
-
"module": "nodenext",
|
|
11
|
-
"target": "esnext",
|
|
12
|
-
"types": [],
|
|
13
|
-
// For nodejs:
|
|
14
|
-
// "lib": ["esnext"],
|
|
15
|
-
// "types": ["node"],
|
|
16
|
-
// and npm install -D @types/node
|
|
17
|
-
|
|
18
|
-
// Other Outputs
|
|
19
|
-
// "sourceMap": true,
|
|
20
|
-
"declaration": true,
|
|
21
|
-
// "declarationMap": true,
|
|
22
|
-
|
|
23
|
-
// Stricter Typechecking Options
|
|
24
|
-
"noUncheckedIndexedAccess": true,
|
|
25
|
-
"exactOptionalPropertyTypes": true,
|
|
26
|
-
|
|
27
|
-
// Style Options
|
|
28
|
-
"noImplicitReturns": true,
|
|
29
|
-
"noImplicitOverride": true,
|
|
30
|
-
"noUnusedLocals": true,
|
|
31
|
-
"noUnusedParameters": true,
|
|
32
|
-
"noFallthroughCasesInSwitch": true,
|
|
33
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
34
|
-
|
|
35
|
-
// Recommended Options
|
|
36
|
-
"strict": true,
|
|
37
|
-
"jsx": "react-jsx",
|
|
38
|
-
"verbatimModuleSyntax": true,
|
|
39
|
-
"isolatedModules": true,
|
|
40
|
-
"noUncheckedSideEffectImports": true,
|
|
41
|
-
"moduleDetection": "force",
|
|
42
|
-
"skipLibCheck": true,
|
|
43
|
-
|
|
44
|
-
// Customizations
|
|
45
|
-
"allowUnreachableCode": false,
|
|
46
|
-
"allowUnusedLabels": false,
|
|
47
|
-
"erasableSyntaxOnly": true
|
|
48
|
-
// "isolatedDeclarations": true,
|
|
49
|
-
},
|
|
50
|
-
"include": ["src/**/*"]
|
|
51
|
-
}
|