dopaminejs 2.5.0 → 3.1.0
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 +55 -50
- package/dist/DataService-D1uL6E8R.cjs +1 -0
- package/dist/DataService-DN6xwvXU.js +745 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/dopamine.cjs +1 -37
- package/dist/dopamine.js +3 -635
- package/dist/games.cjs +1 -0
- package/dist/games.js +82 -0
- package/dist/host-7FzZ-yO7.cjs +37 -0
- package/dist/host-CdjhXPy-.js +815 -0
- package/dist/style.css +395 -2
- package/dist/testing.cjs +1 -0
- package/dist/testing.js +475 -0
- package/package.json +24 -9
- package/spec/README.md +228 -0
- package/spec/VERSION +1 -0
- package/spec/fixtures/achievements.json +611 -0
- package/spec/fixtures/levels.json +421 -0
- package/spec/fixtures/merge.json +1739 -0
- package/spec/fixtures/migrate.json +957 -0
- package/spec/fixtures/scores.json +755 -0
- package/spec/fixtures/streaks.json +967 -0
- package/spec/schema.json +61 -0
- package/src/dopamine/audio/SoundManager.js +54 -24
- package/src/dopamine/core/DopamineError.js +7 -0
- package/src/dopamine/core/RewardSystem.js +359 -374
- package/src/dopamine/core/achievements.js +49 -0
- package/src/dopamine/core/clock.js +11 -0
- package/src/dopamine/core/levels.js +4 -0
- package/src/dopamine/core/merge.js +68 -0
- package/src/dopamine/core/middleware.js +58 -0
- package/src/dopamine/core/store.js +261 -0
- package/src/dopamine/core/streaks.js +55 -0
- package/src/dopamine/effects/ParticleSystem.js +30 -0
- package/src/dopamine/host.js +360 -0
- package/src/dopamine/ui/{GameUI.js → RewardUI.js} +166 -202
- package/src/games.js +138 -0
- package/src/index.js +11 -34
- package/src/progression.js +3 -0
- package/src/testing.js +490 -0
- package/types/core.d.ts +9 -1
- package/types/games.d.ts +46 -0
- package/types/index.d.ts +311 -385
- package/types/testing.d.ts +96 -0
- package/dist/DataService-BPXCldpo.cjs +0 -1
- package/dist/DataService-CH9_gv_8.js +0 -398
- package/dist/ScreenShake-9jgNXPS6.cjs +0 -1
- package/dist/ScreenShake-CLvO1wx4.js +0 -827
- package/dist/engine.cjs +0 -1
- package/dist/engine.js +0 -2
- package/src/core/Animator.js +0 -62
- package/src/core/Collider.js +0 -86
- package/src/core/Component.js +0 -38
- package/src/core/DopamineKernel.js +0 -170
- package/src/core/EventBus.js +0 -206
- package/src/core/Game.js +0 -90
- package/src/core/GameObject.js +0 -99
- package/src/core/PluginRegistry.js +0 -359
- package/src/core/Scene.js +0 -107
- package/src/core/Sprite.js +0 -51
- package/src/core/SystemRegistry.js +0 -263
- package/src/core/Vector2.js +0 -50
- package/src/dopamine/components/ParticleEmitter.js +0 -50
- package/src/dopamine/components/ScreenShake.js +0 -50
- package/src/dopamine/components/index.js +0 -2
- package/src/dopamine/index.js +0 -93
- package/src/dopamine/utils/TextureGenerator.js +0 -90
- package/src/engine.js +0 -38
- package/src/interfaces/IAudioSystem.js +0 -58
- package/src/interfaces/IParticleSystem.js +0 -51
- package/src/interfaces/IPhysicsSystem.js +0 -52
- package/src/interfaces/ISystem.js +0 -48
- package/src/interfaces/index.js +0 -7
- package/src/renderer/Renderer.js +0 -45
- package/src/systems/Director.js +0 -34
- package/src/systems/Input.js +0 -81
- package/src/systems/Loader.js +0 -48
- package/src/systems/Physics.js +0 -210
- package/src/systems/Ticker.js +0 -91
- package/src/systems/deprecate.js +0 -38
package/src/systems/deprecate.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deprecation helper for the v1 global singletons.
|
|
3
|
-
*
|
|
4
|
-
* These used to warn at module scope, which meant importing the package
|
|
5
|
-
* printed a warning for every legacy global whether or not the consumer
|
|
6
|
-
* touched one. A deprecation notice should cost you something only when you
|
|
7
|
-
* use the deprecated thing, otherwise it is just noise that trains people to
|
|
8
|
-
* ignore warnings.
|
|
9
|
-
*
|
|
10
|
-
* @param {Object} instance - The real system to delegate to
|
|
11
|
-
* @param {string} message - Warning text, emitted once on first use
|
|
12
|
-
* @returns {Object} A proxy that warns on first property access
|
|
13
|
-
*/
|
|
14
|
-
export function deprecatedGlobal(instance, message) {
|
|
15
|
-
let warned = false;
|
|
16
|
-
|
|
17
|
-
return new Proxy(instance, {
|
|
18
|
-
get(target, prop, receiver) {
|
|
19
|
-
if (!warned) {
|
|
20
|
-
warned = true;
|
|
21
|
-
console.warn(message);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const value = Reflect.get(target, prop, receiver);
|
|
25
|
-
// Methods must stay bound to the real instance, not the proxy,
|
|
26
|
-
// or internal `this` access re-enters the trap on every field.
|
|
27
|
-
return typeof value === 'function' ? value.bind(target) : value;
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
set(target, prop, value) {
|
|
31
|
-
if (!warned) {
|
|
32
|
-
warned = true;
|
|
33
|
-
console.warn(message);
|
|
34
|
-
}
|
|
35
|
-
return Reflect.set(target, prop, value);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|