@rpgjs/client 5.0.0-alpha.10 → 5.0.0-alpha.2

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 (114) hide show
  1. package/dist/Game/EffectManager.d.ts +5 -0
  2. package/dist/RpgClient.d.ts +68 -99
  3. package/dist/RpgClientEngine.d.ts +4 -86
  4. package/dist/components/effects/index.d.ts +4 -0
  5. package/dist/components/index.d.ts +1 -2
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +1 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/index10.js +1 -1
  10. package/dist/index11.js +4 -4
  11. package/dist/index11.js.map +1 -1
  12. package/dist/index12.js +2 -6
  13. package/dist/index12.js.map +1 -1
  14. package/dist/index13.js +2 -2
  15. package/dist/index13.js.map +1 -1
  16. package/dist/index14.js +35 -95
  17. package/dist/index14.js.map +1 -1
  18. package/dist/index15.js +186 -45
  19. package/dist/index15.js.map +1 -1
  20. package/dist/index16.js +5 -187
  21. package/dist/index16.js.map +1 -1
  22. package/dist/index17.js +383 -5
  23. package/dist/index17.js.map +1 -1
  24. package/dist/index18.js +28 -384
  25. package/dist/index18.js.map +1 -1
  26. package/dist/index19.js +17 -24
  27. package/dist/index19.js.map +1 -1
  28. package/dist/index2.js +25 -147
  29. package/dist/index2.js.map +1 -1
  30. package/dist/index20.js +2413 -16
  31. package/dist/index20.js.map +1 -1
  32. package/dist/index21.js +88 -2395
  33. package/dist/index21.js.map +1 -1
  34. package/dist/index22.js +103 -108
  35. package/dist/index22.js.map +1 -1
  36. package/dist/index23.js +57 -95
  37. package/dist/index23.js.map +1 -1
  38. package/dist/index24.js +12 -62
  39. package/dist/index24.js.map +1 -1
  40. package/dist/index25.js +37 -18
  41. package/dist/index25.js.map +1 -1
  42. package/dist/index26.js +3 -25
  43. package/dist/index26.js.map +1 -1
  44. package/dist/index27.js +314 -87
  45. package/dist/index27.js.map +1 -1
  46. package/dist/index28.js +21 -37
  47. package/dist/index28.js.map +1 -1
  48. package/dist/index29.js +9 -3
  49. package/dist/index29.js.map +1 -1
  50. package/dist/index3.js +2 -2
  51. package/dist/index30.js +6 -317
  52. package/dist/index30.js.map +1 -1
  53. package/dist/index31.js +171 -24
  54. package/dist/index31.js.map +1 -1
  55. package/dist/index32.js +497 -7
  56. package/dist/index32.js.map +1 -1
  57. package/dist/index33.js +9 -8
  58. package/dist/index33.js.map +1 -1
  59. package/dist/index34.js +4400 -9
  60. package/dist/index34.js.map +1 -1
  61. package/dist/index35.js +307 -4394
  62. package/dist/index35.js.map +1 -1
  63. package/dist/index36.js +85 -310
  64. package/dist/index36.js.map +1 -1
  65. package/dist/index37.js +56 -169
  66. package/dist/index37.js.map +1 -1
  67. package/dist/index38.js +16 -497
  68. package/dist/index38.js.map +1 -1
  69. package/dist/index39.js +10 -51
  70. package/dist/index39.js.map +1 -1
  71. package/dist/index4.js +5 -18
  72. package/dist/index4.js.map +1 -1
  73. package/dist/index5.js +1 -2
  74. package/dist/index5.js.map +1 -1
  75. package/dist/index6.js +1 -1
  76. package/dist/index7.js +2 -10
  77. package/dist/index7.js.map +1 -1
  78. package/dist/index8.js +6 -24
  79. package/dist/index8.js.map +1 -1
  80. package/dist/index9.js +2 -2
  81. package/dist/presets/index.d.ts +0 -102
  82. package/dist/services/loadMap.d.ts +2 -123
  83. package/dist/services/mmorpg.d.ts +3 -7
  84. package/package.json +12 -14
  85. package/src/Game/{AnimationManager.ts → EffectManager.ts} +2 -2
  86. package/src/Game/Object.ts +0 -69
  87. package/src/RpgClient.ts +67 -101
  88. package/src/RpgClientEngine.ts +24 -159
  89. package/src/components/character.ce +33 -74
  90. package/src/components/{animations → effects}/animation.ce +5 -3
  91. package/src/components/{animations → effects}/index.ts +1 -1
  92. package/src/components/index.ts +1 -2
  93. package/src/components/scenes/draw-map.ce +23 -6
  94. package/src/components/scenes/element-map.ce +23 -0
  95. package/src/components/scenes/event-layer.ce +3 -3
  96. package/src/core/setup.ts +0 -2
  97. package/src/index.ts +1 -1
  98. package/src/module.ts +5 -23
  99. package/src/presets/index.ts +1 -5
  100. package/src/services/loadMap.ts +2 -131
  101. package/src/services/mmorpg.ts +4 -20
  102. package/tsconfig.json +1 -1
  103. package/vite.config.ts +1 -1
  104. package/dist/Game/AnimationManager.d.ts +0 -8
  105. package/dist/components/animations/index.d.ts +0 -4
  106. package/dist/index40.js +0 -20
  107. package/dist/index40.js.map +0 -1
  108. package/dist/index41.js +0 -82
  109. package/dist/index41.js.map +0 -1
  110. package/dist/presets/animation.d.ts +0 -31
  111. package/dist/presets/lpc.d.ts +0 -89
  112. package/src/presets/animation.ts +0 -46
  113. package/src/presets/lpc.ts +0 -108
  114. /package/src/components/{animations → effects}/hit.ce +0 -0
@@ -1,89 +0,0 @@
1
- export declare const LPCSpritesheetPreset: (options: {
2
- id: string;
3
- imageSource: string;
4
- width: number;
5
- height: number;
6
- ratio?: number;
7
- }) => {
8
- id: string;
9
- image: string;
10
- width: number;
11
- height: number;
12
- opacity: number;
13
- rectWidth: number;
14
- rectHeight: number;
15
- framesWidth: number;
16
- framesHeight: number;
17
- spriteRealSize: {
18
- width: number;
19
- height: number;
20
- };
21
- textures: {
22
- attack3?: {
23
- offset: {
24
- x: number;
25
- y: number;
26
- };
27
- rectWidth: number;
28
- rectHeight: number;
29
- framesWidth: number;
30
- framesHeight: number;
31
- animations: ({ direction }: {
32
- direction: any;
33
- }) => any[];
34
- } | undefined;
35
- stand: {
36
- offset: {
37
- x: number;
38
- y: number;
39
- };
40
- animations: ({ direction }: {
41
- direction: any;
42
- }) => {
43
- time: number;
44
- frameX: number;
45
- frameY: number;
46
- }[][];
47
- };
48
- walk: {
49
- offset: {
50
- x: number;
51
- y: number;
52
- };
53
- framesWidth: number;
54
- framesHeight: number;
55
- animations: ({ direction }: {
56
- direction: any;
57
- }) => any[];
58
- };
59
- attack: {
60
- offset: {
61
- x: number;
62
- y: number;
63
- };
64
- framesWidth: number;
65
- framesHeight: number;
66
- animations: ({ direction }: {
67
- direction: any;
68
- }) => any[];
69
- };
70
- skill: {
71
- framesWidth: number;
72
- framesHeight: number;
73
- animations: ({ direction }: {
74
- direction: any;
75
- }) => any[];
76
- };
77
- attack2: {
78
- offset: {
79
- x: number;
80
- y: number;
81
- };
82
- framesWidth: number;
83
- framesHeight: number;
84
- animations: ({ direction }: {
85
- direction: any;
86
- }) => any[];
87
- };
88
- };
89
- };
@@ -1,46 +0,0 @@
1
- /**
2
- * Creates an animation spritesheet preset with automatic frame generation
3
- *
4
- * This function generates animation frames based on the provided width and height dimensions.
5
- * It creates a sequence of frames that progresses through the spritesheet from left to right,
6
- * top to bottom, with each frame having a 10ms time increment.
7
- *
8
- * @param {number} framesWidth - The number of frames horizontally in the spritesheet
9
- * @param {number} framesHeight - The number of frames vertically in the spritesheet
10
- * @returns {Object} Animation preset configuration object
11
- *
12
- * @example
13
- * ```javascript
14
- * // For a 4x4 spritesheet
15
- * const preset = AnimationSpritesheetPreset(4, 4);
16
- * // This will generate 16 frames with coordinates from (0,0) to (3,3)
17
- * ```
18
- */
19
- export const AnimationSpritesheetPreset = (framesWidth: number, framesHeight: number) => {
20
-
21
- const animations: Array<{ time: number; frameX: number; frameY: number }> = [];
22
-
23
- for (let y = 0; y < framesHeight; y++) {
24
- for (let x = 0; x < framesWidth; x++) {
25
- const frameIndex = y * framesWidth + x;
26
- animations.push({
27
- time: frameIndex * 10,
28
- frameX: x,
29
- frameY: y
30
- });
31
- }
32
- }
33
-
34
- return {
35
- framesWidth,
36
- framesHeight,
37
- textures: {
38
- default: {
39
- animations: () => [
40
- animations
41
- ],
42
- }
43
- }
44
- };
45
- };
46
-
@@ -1,108 +0,0 @@
1
- import { Animation, Direction } from "@rpgjs/common";
2
-
3
- export const LPCSpritesheetPreset = (options: {
4
- id: string;
5
- imageSource: string;
6
- width: number;
7
- height: number;
8
- ratio?: number;
9
- }) => {
10
- const ratio = options.ratio ?? 1;
11
-
12
- const frameY = (direction: Direction) => {
13
- return {
14
- [Direction.Down]: 2,
15
- [Direction.Left]: 1,
16
- [Direction.Right]: 3,
17
- [Direction.Up]: 0,
18
- }[direction];
19
- };
20
-
21
- const stand = (direction: Direction) => [
22
- { time: 0, frameX: 0, frameY: frameY(direction) },
23
- ];
24
- const anim = (
25
- direction: Direction,
26
- framesWidth: number,
27
- speed: number = 5
28
- ) => {
29
- const array: any = [];
30
- for (let i = 0; i < framesWidth; i++) {
31
- array.push({ time: i * speed, frameX: i, frameY: frameY(direction) });
32
- }
33
- return array;
34
- };
35
-
36
- return {
37
- id: options.id,
38
- image: options.imageSource,
39
- width: options.width,
40
- height: options.height,
41
- opacity: 1,
42
- rectWidth: 64 * ratio,
43
- rectHeight: 64 * ratio,
44
- framesWidth: 6,
45
- framesHeight: 4,
46
- spriteRealSize: {
47
- width: 48 * ratio,
48
- height: 52 * ratio,
49
- },
50
- textures: {
51
- [Animation.Stand]: {
52
- offset: {
53
- x: 0,
54
- y: 512 * ratio,
55
- },
56
- animations: ({ direction }) => [stand(direction)],
57
- },
58
- [Animation.Walk]: {
59
- offset: {
60
- x: 0,
61
- y: 512 * ratio,
62
- },
63
- framesWidth: 9,
64
- framesHeight: 4,
65
- animations: ({ direction }) => [anim(direction, 9)],
66
- },
67
- [Animation.Attack]: {
68
- offset: {
69
- x: 0,
70
- y: 768 * ratio,
71
- },
72
- framesWidth: 6,
73
- framesHeight: 4,
74
- animations: ({ direction }) => [anim(direction, 6, 3)],
75
- },
76
- [Animation.Skill]: {
77
- framesWidth: 7,
78
- framesHeight: 4,
79
- animations: ({ direction }) => [anim(direction, 7, 3)],
80
- },
81
- attack2: {
82
- offset: {
83
- x: 0,
84
- y: 256 * ratio,
85
- },
86
- framesWidth: 7,
87
- framesHeight: 8,
88
- animations: ({ direction }) => [anim(direction, 7, 3)],
89
- },
90
- ...(options.height > 3000
91
- ? {
92
- attack3: {
93
- offset: {
94
- x: 0,
95
- y: 5568 - 288 * 4,
96
- },
97
- rectWidth: 288,
98
- rectHeight: 288,
99
- framesWidth: 6,
100
- framesHeight: 4,
101
- animations: ({ direction }) => [anim(direction, 6, 3)],
102
- },
103
- }
104
- : {}),
105
- },
106
- };
107
- };
108
-
File without changes