@nice2dev/game-engine 1.3.12 → 1.3.14
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/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/dist/types/accessibility/index.d.ts +0 -1
- package/dist/types/ai/index.d.ts +0 -1
- package/dist/types/animation/index.d.ts +0 -1
- package/dist/types/audio/HRTFAudio.d.ts +0 -180
- package/dist/types/audio/index.d.ts +0 -2
- package/dist/types/community/Community.d.ts +0 -112
- package/dist/types/community/index.d.ts +0 -1
- package/dist/types/core/TypeSafety.d.ts +0 -190
- package/dist/types/core/index.d.ts +0 -7
- package/dist/types/devtools/AssetStore.d.ts +0 -133
- package/dist/types/devtools/index.d.ts +0 -3
- package/dist/types/dialogue/index.d.ts +0 -2
- package/dist/types/docs/APIPlayground.d.ts +0 -26
- package/dist/types/docs/Cookbook.d.ts +0 -18
- package/dist/types/docs/Guides.d.ts +0 -18
- package/dist/types/docs/index.d.ts +0 -4
- package/dist/types/ecs/ECSOptimized.d.ts +0 -131
- package/dist/types/ecs/index.d.ts +0 -2
- package/dist/types/editor/NiceAnimationTimeline.d.ts +0 -114
- package/dist/types/editor/NiceLevelEditor.d.ts +0 -232
- package/dist/types/editor/NiceMaterialEditor.d.ts +0 -105
- package/dist/types/editor/NiceNodeGraph.d.ts +0 -87
- package/dist/types/editor/NiceParticleEditor.d.ts +0 -127
- package/dist/types/editor/behavior-tree/BTDebugPanel.d.ts +0 -102
- package/dist/types/editor/behavior-tree/BTEditorCanvas.d.ts +0 -79
- package/dist/types/editor/behavior-tree/BTEditorNode.d.ts +0 -58
- package/dist/types/editor/behavior-tree/BTEditorToolbar.d.ts +0 -75
- package/dist/types/editor/behavior-tree/BTNodePalette.d.ts +0 -72
- package/dist/types/editor/behavior-tree/BTPropertyPanel.d.ts +0 -66
- package/dist/types/editor/behavior-tree/BehaviorTreeEditor.d.ts +0 -186
- package/dist/types/editor/behavior-tree/index.d.ts +0 -14
- package/dist/types/editor/behavior-tree/serialization.d.ts +0 -30
- package/dist/types/editor/behavior-tree/types.d.ts +0 -299
- package/dist/types/editor/index.d.ts +0 -20
- package/dist/types/editor/state-machine/SMEditorCanvas.d.ts +0 -61
- package/dist/types/editor/state-machine/StateMachineEditor.d.ts +0 -139
- package/dist/types/editor/state-machine/index.d.ts +0 -11
- package/dist/types/editor/state-machine/serialization.d.ts +0 -23
- package/dist/types/editor/state-machine/types.d.ts +0 -241
- package/dist/types/engine/index.d.ts +0 -2
- package/dist/types/enterprise/index.d.ts +0 -1
- package/dist/types/epic/index.d.ts +0 -10
- package/dist/types/i18n/index.d.ts +0 -2
- package/dist/types/input/index.d.ts +0 -3
- package/dist/types/kids/index.d.ts +0 -2
- package/dist/types/legendary/index.d.ts +0 -57
- package/dist/types/monetization/index.d.ts +0 -1
- package/dist/types/multiplayer/NiceNetcode.d.ts +0 -434
- package/dist/types/multiplayer/index.d.ts +0 -5
- package/dist/types/network/index.d.ts +0 -2
- package/dist/types/pathfinding/index.d.ts +0 -1
- package/dist/types/performance/AssetCompression.d.ts +0 -137
- package/dist/types/performance/WASMModules.d.ts +0 -65
- package/dist/types/performance/WebGPUCompute.d.ts +0 -71
- package/dist/types/performance/index.d.ts +0 -1
- package/dist/types/physics/RapierIntegration.d.ts +0 -404
- package/dist/types/physics/index.d.ts +0 -2
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/procedural/index.d.ts +0 -2
- package/dist/types/release/index.d.ts +0 -1
- package/dist/types/rendering/WebGPUv2.d.ts +0 -173
- package/dist/types/rendering/index.d.ts +0 -3
- package/dist/types/runtime3d/index.d.ts +0 -2
- package/dist/types/scene/index.d.ts +0 -2
- package/dist/types/scripting/WasmCompiler.d.ts +0 -182
- package/dist/types/scripting/index.d.ts +0 -19
- package/dist/types/social/index.d.ts +0 -1
- package/dist/types/systems/NiceAI.d.ts +0 -637
- package/dist/types/systems/NiceAbility.d.ts +0 -225
- package/dist/types/systems/NiceAccessibility.d.ts +0 -230
- package/dist/types/systems/NiceAchievement.d.ts +0 -153
- package/dist/types/systems/NiceAchievementUI.d.ts +0 -196
- package/dist/types/systems/NiceAchievements.d.ts +0 -230
- package/dist/types/systems/NiceAction.d.ts +0 -81
- package/dist/types/systems/NiceAlchemy.d.ts +0 -195
- package/dist/types/systems/NiceAnalytics.d.ts +0 -493
- package/dist/types/systems/NiceAnimation.d.ts +0 -350
- package/dist/types/systems/NiceArena.d.ts +0 -215
- package/dist/types/systems/NiceAssetLoader.d.ts +0 -136
- package/dist/types/systems/NiceAuction.d.ts +0 -157
- package/dist/types/systems/NiceAudio.d.ts +0 -224
- package/dist/types/systems/NiceAugment.d.ts +0 -187
- package/dist/types/systems/NiceAura.d.ts +0 -193
- package/dist/types/systems/NiceBank.d.ts +0 -158
- package/dist/types/systems/NiceBattlePass.d.ts +0 -150
- package/dist/types/systems/NiceBehavior.d.ts +0 -160
- package/dist/types/systems/NiceBinding.d.ts +0 -96
- package/dist/types/systems/NiceBlacksmith.d.ts +0 -221
- package/dist/types/systems/NiceBuff.d.ts +0 -177
- package/dist/types/systems/NiceBuilding.d.ts +0 -207
- package/dist/types/systems/NiceBullet.d.ts +0 -167
- package/dist/types/systems/NiceCamera.d.ts +0 -252
- package/dist/types/systems/NiceCard.d.ts +0 -171
- package/dist/types/systems/NiceChat.d.ts +0 -148
- package/dist/types/systems/NiceCheat.d.ts +0 -375
- package/dist/types/systems/NiceClimbing.d.ts +0 -186
- package/dist/types/systems/NiceCloud.d.ts +0 -422
- package/dist/types/systems/NiceCollision.d.ts +0 -238
- package/dist/types/systems/NiceCombo.d.ts +0 -131
- package/dist/types/systems/NiceCommand.d.ts +0 -112
- package/dist/types/systems/NiceCompanion.d.ts +0 -182
- package/dist/types/systems/NiceController.d.ts +0 -144
- package/dist/types/systems/NiceCooking.d.ts +0 -193
- package/dist/types/systems/NiceCoroutine.d.ts +0 -101
- package/dist/types/systems/NiceCrafting.d.ts +0 -228
- package/dist/types/systems/NiceCutscene.d.ts +0 -437
- package/dist/types/systems/NiceDaily.d.ts +0 -133
- package/dist/types/systems/NiceDamage.d.ts +0 -271
- package/dist/types/systems/NiceDayNight.d.ts +0 -126
- package/dist/types/systems/NiceDebug.d.ts +0 -255
- package/dist/types/systems/NiceDestructible.d.ts +0 -150
- package/dist/types/systems/NiceDialogue.d.ts +0 -629
- package/dist/types/systems/NiceDungeon.d.ts +0 -202
- package/dist/types/systems/NiceECS.d.ts +0 -151
- package/dist/types/systems/NiceEnchant.d.ts +0 -148
- package/dist/types/systems/NiceEntityPool.d.ts +0 -127
- package/dist/types/systems/NiceEquipment.d.ts +0 -137
- package/dist/types/systems/NiceEvent.d.ts +0 -202
- package/dist/types/systems/NiceEventBus.d.ts +0 -164
- package/dist/types/systems/NiceFaction.d.ts +0 -173
- package/dist/types/systems/NiceFarming.d.ts +0 -163
- package/dist/types/systems/NiceFishing.d.ts +0 -196
- package/dist/types/systems/NiceFlocking.d.ts +0 -156
- package/dist/types/systems/NiceFog.d.ts +0 -137
- package/dist/types/systems/NiceFormation.d.ts +0 -140
- package/dist/types/systems/NiceGacha.d.ts +0 -134
- package/dist/types/systems/NiceGambling.d.ts +0 -175
- package/dist/types/systems/NiceGem.d.ts +0 -165
- package/dist/types/systems/NiceGesture.d.ts +0 -502
- package/dist/types/systems/NiceGrappling.d.ts +0 -154
- package/dist/types/systems/NiceGrid.d.ts +0 -142
- package/dist/types/systems/NiceGuild.d.ts +0 -162
- package/dist/types/systems/NiceHaptics.d.ts +0 -112
- package/dist/types/systems/NiceHousing.d.ts +0 -197
- package/dist/types/systems/NiceInput.d.ts +0 -280
- package/dist/types/systems/NiceInventory.d.ts +0 -534
- package/dist/types/systems/NiceLOD.d.ts +0 -144
- package/dist/types/systems/NiceLeaderboard.d.ts +0 -191
- package/dist/types/systems/NiceLevel.d.ts +0 -304
- package/dist/types/systems/NiceLighting.d.ts +0 -214
- package/dist/types/systems/NiceLocalization.d.ts +0 -148
- package/dist/types/systems/NiceLocomotion.d.ts +0 -398
- package/dist/types/systems/NiceLogger.d.ts +0 -117
- package/dist/types/systems/NiceLoot.d.ts +0 -176
- package/dist/types/systems/NiceMail.d.ts +0 -164
- package/dist/types/systems/NiceMap.d.ts +0 -234
- package/dist/types/systems/NiceMarriage.d.ts +0 -150
- package/dist/types/systems/NiceMastery.d.ts +0 -171
- package/dist/types/systems/NiceMatch.d.ts +0 -196
- package/dist/types/systems/NiceMatch3.d.ts +0 -118
- package/dist/types/systems/NiceMessageBus.d.ts +0 -115
- package/dist/types/systems/NiceMinimap.d.ts +0 -258
- package/dist/types/systems/NiceMining.d.ts +0 -175
- package/dist/types/systems/NiceModding.d.ts +0 -452
- package/dist/types/systems/NiceMount.d.ts +0 -152
- package/dist/types/systems/NiceNavigation.d.ts +0 -307
- package/dist/types/systems/NiceNetwork.d.ts +0 -568
- package/dist/types/systems/NiceNotification.d.ts +0 -438
- package/dist/types/systems/NiceObjective.d.ts +0 -395
- package/dist/types/systems/NiceParticle.d.ts +0 -639
- package/dist/types/systems/NiceParty.d.ts +0 -168
- package/dist/types/systems/NicePerformance.d.ts +0 -144
- package/dist/types/systems/NicePet.d.ts +0 -167
- package/dist/types/systems/NicePhotoMode.d.ts +0 -270
- package/dist/types/systems/NicePhysics.d.ts +0 -326
- package/dist/types/systems/NicePlatformer.d.ts +0 -158
- package/dist/types/systems/NicePool.d.ts +0 -128
- package/dist/types/systems/NicePortal.d.ts +0 -178
- package/dist/types/systems/NicePostProcess.d.ts +0 -254
- package/dist/types/systems/NiceProcedural.d.ts +0 -202
- package/dist/types/systems/NiceProfile.d.ts +0 -223
- package/dist/types/systems/NiceProjectile.d.ts +0 -157
- package/dist/types/systems/NicePvP.d.ts +0 -199
- package/dist/types/systems/NiceQTE.d.ts +0 -160
- package/dist/types/systems/NiceQuest.d.ts +0 -620
- package/dist/types/systems/NiceRaid.d.ts +0 -215
- package/dist/types/systems/NiceRanking.d.ts +0 -399
- package/dist/types/systems/NiceReplay.d.ts +0 -180
- package/dist/types/systems/NiceReputation.d.ts +0 -151
- package/dist/types/systems/NiceResource.d.ts +0 -200
- package/dist/types/systems/NiceRhythm.d.ts +0 -148
- package/dist/types/systems/NiceRoguelike.d.ts +0 -276
- package/dist/types/systems/NiceRune.d.ts +0 -202
- package/dist/types/systems/NiceSaveSystem.d.ts +0 -194
- package/dist/types/systems/NiceSceneManager.d.ts +0 -112
- package/dist/types/systems/NiceScore.d.ts +0 -186
- package/dist/types/systems/NiceScreenFX.d.ts +0 -235
- package/dist/types/systems/NiceScreenshot.d.ts +0 -443
- package/dist/types/systems/NiceScribe.d.ts +0 -239
- package/dist/types/systems/NiceSeason.d.ts +0 -176
- package/dist/types/systems/NiceSerialization.d.ts +0 -89
- package/dist/types/systems/NiceServiceLocator.d.ts +0 -94
- package/dist/types/systems/NiceShop.d.ts +0 -528
- package/dist/types/systems/NiceSignal.d.ts +0 -112
- package/dist/types/systems/NiceSkillTree.d.ts +0 -237
- package/dist/types/systems/NiceSocial.d.ts +0 -580
- package/dist/types/systems/NiceSpawner.d.ts +0 -237
- package/dist/types/systems/NiceSpell.d.ts +0 -216
- package/dist/types/systems/NiceState.d.ts +0 -224
- package/dist/types/systems/NiceStateMachine.d.ts +0 -108
- package/dist/types/systems/NiceStatus.d.ts +0 -116
- package/dist/types/systems/NiceStealth.d.ts +0 -204
- package/dist/types/systems/NiceSteam.d.ts +0 -255
- package/dist/types/systems/NiceStreaming.d.ts +0 -173
- package/dist/types/systems/NiceSwimming.d.ts +0 -166
- package/dist/types/systems/NiceTalent.d.ts +0 -154
- package/dist/types/systems/NiceTarget.d.ts +0 -121
- package/dist/types/systems/NiceTerrain.d.ts +0 -143
- package/dist/types/systems/NiceTilemap.d.ts +0 -218
- package/dist/types/systems/NiceTimer.d.ts +0 -153
- package/dist/types/systems/NiceTournament.d.ts +0 -190
- package/dist/types/systems/NiceTrading.d.ts +0 -238
- package/dist/types/systems/NiceTransmog.d.ts +0 -142
- package/dist/types/systems/NiceTutorial.d.ts +0 -248
- package/dist/types/systems/NiceTween.d.ts +0 -164
- package/dist/types/systems/NiceUI.d.ts +0 -364
- package/dist/types/systems/NiceVFX.d.ts +0 -333
- package/dist/types/systems/NiceVehicle.d.ts +0 -176
- package/dist/types/systems/NiceVoice.d.ts +0 -502
- package/dist/types/systems/NiceWater.d.ts +0 -162
- package/dist/types/systems/NiceWave.d.ts +0 -174
- package/dist/types/systems/NiceWaypoint.d.ts +0 -165
- package/dist/types/systems/NiceWeather.d.ts +0 -225
- package/dist/types/systems/NiceXR.d.ts +0 -187
- package/dist/types/systems/index.d.ts +0 -182
- package/dist/types/templates/index.d.ts +0 -2
- package/dist/types/tilemap/index.d.ts +0 -1
- package/dist/types/tutorials/TutorialEditor.d.ts +0 -43
- package/dist/types/tutorials/VoiceNarration.d.ts +0 -75
- package/dist/types/tutorials/content/Tutorials_T04.d.ts +0 -3
- package/dist/types/tutorials/content/UITutorials.d.ts +0 -14
- package/dist/types/tutorials/content/index.d.ts +0 -5
- package/dist/types/tutorials/index.d.ts +0 -6
- package/dist/types/ui/index.d.ts +0 -2
- package/dist/types/visual-scripting/VisualScriptDebugger.d.ts +0 -145
- package/dist/types/visual-scripting/VisualScriptExecutor.d.ts +0 -100
- package/dist/types/visual-scripting/VisualScriptGraph.d.ts +0 -173
- package/dist/types/visual-scripting/VisualScriptNode.d.ts +0 -157
- package/dist/types/visual-scripting/index.d.ts +0 -6
- package/dist/types/visual-scripting/nodes/ActionNodes.d.ts +0 -152
- package/dist/types/visual-scripting/nodes/EventNodes.d.ts +0 -95
- package/dist/types/visual-scripting/nodes/FlowControlNodes.d.ts +0 -134
- package/dist/types/visual-scripting/nodes/LogicNodes.d.ts +0 -122
- package/dist/types/visual-scripting/nodes/MathNodes.d.ts +0 -170
- package/dist/types/visual-scripting/nodes/UtilityNodes.d.ts +0 -131
- package/dist/types/visual-scripting/nodes/VariableNodes.d.ts +0 -107
- package/dist/types/visual-scripting/nodes/index.d.ts +0 -21
- package/dist/types/visual-scripting/nodes/registerNodes.d.ts +0 -29
- package/dist/types/visual-scripting/types.d.ts +0 -402
- package/dist/types/xr/WebXRLayers.d.ts +0 -319
- package/dist/types/xr/index.d.ts +0 -2
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
export interface Vec2 {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
}
|
|
5
|
-
export type JumpType = 'normal' | 'double' | 'triple' | 'wall' | 'spring' | 'ladder';
|
|
6
|
-
export type PlatformType = 'static' | 'moving' | 'falling' | 'bouncy' | 'one-way' | 'slippery' | 'conveyor' | 'crumbling' | 'sinking';
|
|
7
|
-
export interface PlatformerCharacter {
|
|
8
|
-
id: string;
|
|
9
|
-
position: Vec2;
|
|
10
|
-
velocity: Vec2;
|
|
11
|
-
isGrounded: boolean;
|
|
12
|
-
groundNormal: Vec2;
|
|
13
|
-
groundPlatformId: string | null;
|
|
14
|
-
isTouchingWall: boolean;
|
|
15
|
-
wallNormal: Vec2;
|
|
16
|
-
wallSide: 'left' | 'right' | null;
|
|
17
|
-
jumpCount: number;
|
|
18
|
-
maxJumps: number;
|
|
19
|
-
isJumping: boolean;
|
|
20
|
-
jumpHeld: boolean;
|
|
21
|
-
canJump: boolean;
|
|
22
|
-
isGrabbingLedge: boolean;
|
|
23
|
-
ledgePosition: Vec2 | null;
|
|
24
|
-
coyoteTimeRemaining: number;
|
|
25
|
-
jumpBufferRemaining: number;
|
|
26
|
-
wallJumpCooldown: number;
|
|
27
|
-
lastGroundedTime: number;
|
|
28
|
-
lastJumpTime: number;
|
|
29
|
-
facingDirection: 1 | -1;
|
|
30
|
-
isCrouching: boolean;
|
|
31
|
-
isSliding: boolean;
|
|
32
|
-
isDashing: boolean;
|
|
33
|
-
gravityScale: number;
|
|
34
|
-
frictionScale: number;
|
|
35
|
-
}
|
|
36
|
-
export interface Platform {
|
|
37
|
-
id: string;
|
|
38
|
-
type: PlatformType;
|
|
39
|
-
position: Vec2;
|
|
40
|
-
size: Vec2;
|
|
41
|
-
velocity: Vec2;
|
|
42
|
-
active: boolean;
|
|
43
|
-
path: Vec2[];
|
|
44
|
-
pathIndex: number;
|
|
45
|
-
pathSpeed: number;
|
|
46
|
-
pathLoop: boolean;
|
|
47
|
-
pathPingPong: boolean;
|
|
48
|
-
pathDirection: 1 | -1;
|
|
49
|
-
bounceForce?: number;
|
|
50
|
-
conveyorSpeed?: number;
|
|
51
|
-
fallDelay?: number;
|
|
52
|
-
fallTimer?: number;
|
|
53
|
-
crumbleTime?: number;
|
|
54
|
-
crumbleTimer?: number;
|
|
55
|
-
respawnTime?: number;
|
|
56
|
-
respawnTimer?: number;
|
|
57
|
-
sinkSpeed?: number;
|
|
58
|
-
sinkDepth?: number;
|
|
59
|
-
isFalling?: boolean;
|
|
60
|
-
isCrumbling?: boolean;
|
|
61
|
-
isDestroyed?: boolean;
|
|
62
|
-
}
|
|
63
|
-
export interface CollisionResult {
|
|
64
|
-
collided: boolean;
|
|
65
|
-
normal: Vec2;
|
|
66
|
-
penetration: number;
|
|
67
|
-
platform: Platform | null;
|
|
68
|
-
}
|
|
69
|
-
export interface RaycastHit {
|
|
70
|
-
hit: boolean;
|
|
71
|
-
point: Vec2;
|
|
72
|
-
normal: Vec2;
|
|
73
|
-
distance: number;
|
|
74
|
-
platformId: string | null;
|
|
75
|
-
}
|
|
76
|
-
export type PlatformerEventType = 'jump' | 'double-jump' | 'wall-jump' | 'land' | 'fall' | 'ledge-grab' | 'ledge-climb' | 'platform-trigger' | 'platform-fall' | 'platform-respawn' | 'dash' | 'slide';
|
|
77
|
-
export interface PlatformerEvent {
|
|
78
|
-
type: PlatformerEventType;
|
|
79
|
-
timestamp: number;
|
|
80
|
-
characterId: string;
|
|
81
|
-
data: unknown;
|
|
82
|
-
}
|
|
83
|
-
export type PlatformerEventCallback = (event: PlatformerEvent) => void;
|
|
84
|
-
export interface PlatformerConfig {
|
|
85
|
-
gravity: number;
|
|
86
|
-
maxFallSpeed: number;
|
|
87
|
-
groundFriction: number;
|
|
88
|
-
airFriction: number;
|
|
89
|
-
moveSpeed: number;
|
|
90
|
-
acceleration: number;
|
|
91
|
-
deceleration: number;
|
|
92
|
-
airControl: number;
|
|
93
|
-
jumpForce: number;
|
|
94
|
-
jumpCutMultiplier: number;
|
|
95
|
-
maxJumps: number;
|
|
96
|
-
coyoteTime: number;
|
|
97
|
-
jumpBufferTime: number;
|
|
98
|
-
wallSlideSpeed: number;
|
|
99
|
-
wallJumpForce: Vec2;
|
|
100
|
-
wallJumpCooldown: number;
|
|
101
|
-
wallStickTime: number;
|
|
102
|
-
ledgeGrabEnabled: boolean;
|
|
103
|
-
ledgeGrabOffset: Vec2;
|
|
104
|
-
ledgeClimbDuration: number;
|
|
105
|
-
slopeLimit: number;
|
|
106
|
-
stepHeight: number;
|
|
107
|
-
skinWidth: number;
|
|
108
|
-
dashSpeed: number;
|
|
109
|
-
dashDuration: number;
|
|
110
|
-
dashCooldown: number;
|
|
111
|
-
}
|
|
112
|
-
export declare const DEFAULT_PLATFORMER_CONFIG: PlatformerConfig;
|
|
113
|
-
export declare class NicePlatformer {
|
|
114
|
-
private config;
|
|
115
|
-
private characters;
|
|
116
|
-
private platforms;
|
|
117
|
-
private eventListeners;
|
|
118
|
-
private nextId;
|
|
119
|
-
constructor(config?: Partial<PlatformerConfig>);
|
|
120
|
-
on(event: PlatformerEventType, callback: PlatformerEventCallback): () => void;
|
|
121
|
-
private emit;
|
|
122
|
-
createCharacter(position: Vec2): string;
|
|
123
|
-
removeCharacter(characterId: string): void;
|
|
124
|
-
getCharacter(id: string): PlatformerCharacter | undefined;
|
|
125
|
-
createPlatform(type: PlatformType, position: Vec2, size: Vec2, options?: Partial<Platform>): string;
|
|
126
|
-
removePlatform(platformId: string): void;
|
|
127
|
-
getPlatform(id: string): Platform | undefined;
|
|
128
|
-
setMoveInput(characterId: string, direction: number): void;
|
|
129
|
-
jump(characterId: string): boolean;
|
|
130
|
-
private performJump;
|
|
131
|
-
private wallJump;
|
|
132
|
-
releaseJump(characterId: string): void;
|
|
133
|
-
crouch(characterId: string, crouching: boolean): void;
|
|
134
|
-
dash(characterId: string): boolean;
|
|
135
|
-
grabLedge(characterId: string, ledgePosition: Vec2): void;
|
|
136
|
-
climbLedge(characterId: string): void;
|
|
137
|
-
update(deltaTime: number): void;
|
|
138
|
-
private updateCharacter;
|
|
139
|
-
private onLand;
|
|
140
|
-
private onFall;
|
|
141
|
-
private resolveCollisions;
|
|
142
|
-
private checkPlatformCollision;
|
|
143
|
-
private resolvePlatformCollision;
|
|
144
|
-
private triggerPlatformEffect;
|
|
145
|
-
private updatePlatforms;
|
|
146
|
-
private updateMovingPlatform;
|
|
147
|
-
private updateFallingPlatform;
|
|
148
|
-
private updateCrumblingPlatform;
|
|
149
|
-
private respawnPlatform;
|
|
150
|
-
raycast(origin: Vec2, direction: Vec2, maxDistance: number): RaycastHit;
|
|
151
|
-
private rayPlatformIntersect;
|
|
152
|
-
getAllCharacters(): PlatformerCharacter[];
|
|
153
|
-
getAllPlatforms(): Platform[];
|
|
154
|
-
getActivePlatforms(): Platform[];
|
|
155
|
-
private generateId;
|
|
156
|
-
destroy(): void;
|
|
157
|
-
}
|
|
158
|
-
export declare function createPlatformerSystem(config?: Partial<PlatformerConfig>): NicePlatformer;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
export type PoolId = string;
|
|
2
|
-
export interface PoolableObject {
|
|
3
|
-
/** Called when object is taken from pool */
|
|
4
|
-
onSpawn?: () => void;
|
|
5
|
-
/** Called when object is returned to pool */
|
|
6
|
-
onDespawn?: () => void;
|
|
7
|
-
/** Called when pool is destroyed */
|
|
8
|
-
onDestroy?: () => void;
|
|
9
|
-
/** Mark object as active/inactive */
|
|
10
|
-
active?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface PoolFactory<T> {
|
|
13
|
-
/** Create a new instance */
|
|
14
|
-
create: () => T;
|
|
15
|
-
/** Reset instance to initial state */
|
|
16
|
-
reset?: (obj: T) => void;
|
|
17
|
-
/** Destroy instance */
|
|
18
|
-
destroy?: (obj: T) => void;
|
|
19
|
-
/** Validate instance is still usable */
|
|
20
|
-
validate?: (obj: T) => boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface PoolConfig {
|
|
23
|
-
/** Initial pool size */
|
|
24
|
-
initialSize: number;
|
|
25
|
-
/** Maximum pool size (0 = unlimited) */
|
|
26
|
-
maxSize: number;
|
|
27
|
-
/** Expand by this amount when empty */
|
|
28
|
-
expandSize: number;
|
|
29
|
-
/** Auto-shrink when many objects unused */
|
|
30
|
-
autoShrink: boolean;
|
|
31
|
-
/** Shrink threshold (ratio of unused objects) */
|
|
32
|
-
shrinkThreshold: number;
|
|
33
|
-
/** Minimum pool size after shrinking */
|
|
34
|
-
minSize: number;
|
|
35
|
-
/** Warmup pool on creation */
|
|
36
|
-
warmup: boolean;
|
|
37
|
-
/** Validate objects on acquire */
|
|
38
|
-
validateOnAcquire: boolean;
|
|
39
|
-
}
|
|
40
|
-
export declare const DEFAULT_POOL_CONFIG: PoolConfig;
|
|
41
|
-
export interface PoolStats {
|
|
42
|
-
poolId: PoolId;
|
|
43
|
-
totalCreated: number;
|
|
44
|
-
totalDestroyed: number;
|
|
45
|
-
currentSize: number;
|
|
46
|
-
activeCount: number;
|
|
47
|
-
availableCount: number;
|
|
48
|
-
peakUsage: number;
|
|
49
|
-
acquireCount: number;
|
|
50
|
-
releaseCount: number;
|
|
51
|
-
expandCount: number;
|
|
52
|
-
shrinkCount: number;
|
|
53
|
-
missCount: number;
|
|
54
|
-
}
|
|
55
|
-
export type PoolEventType = 'acquired' | 'released' | 'expanded' | 'shrunk' | 'created' | 'destroyed' | 'pool-created' | 'pool-destroyed' | 'stats-updated';
|
|
56
|
-
export interface PoolEvent {
|
|
57
|
-
type: PoolEventType;
|
|
58
|
-
timestamp: number;
|
|
59
|
-
poolId: PoolId;
|
|
60
|
-
data?: unknown;
|
|
61
|
-
}
|
|
62
|
-
export type PoolEventCallback = (event: PoolEvent) => void;
|
|
63
|
-
export declare class Pool<T extends object> {
|
|
64
|
-
readonly id: PoolId;
|
|
65
|
-
private factory;
|
|
66
|
-
private config;
|
|
67
|
-
private available;
|
|
68
|
-
private active;
|
|
69
|
-
private stats;
|
|
70
|
-
constructor(id: PoolId, factory: PoolFactory<T>, config?: Partial<PoolConfig>);
|
|
71
|
-
acquire(): T;
|
|
72
|
-
release(obj: T): void;
|
|
73
|
-
releaseAll(): void;
|
|
74
|
-
warmup(count: number): void;
|
|
75
|
-
expand(count?: number): void;
|
|
76
|
-
shrink(targetSize?: number): void;
|
|
77
|
-
private checkShrink;
|
|
78
|
-
private createObject;
|
|
79
|
-
private destroyObject;
|
|
80
|
-
private updateStats;
|
|
81
|
-
getStats(): PoolStats;
|
|
82
|
-
getActiveCount(): number;
|
|
83
|
-
getAvailableCount(): number;
|
|
84
|
-
getTotalSize(): number;
|
|
85
|
-
forEach(callback: (obj: T) => void): void;
|
|
86
|
-
destroy(): void;
|
|
87
|
-
}
|
|
88
|
-
export declare class NicePool {
|
|
89
|
-
private pools;
|
|
90
|
-
private eventListeners;
|
|
91
|
-
on(event: PoolEventType, callback: PoolEventCallback): () => void;
|
|
92
|
-
private emit;
|
|
93
|
-
createPool<T extends object>(id: PoolId, factory: PoolFactory<T>, config?: Partial<PoolConfig>): Pool<T>;
|
|
94
|
-
getPool<T extends object>(id: PoolId): Pool<T> | undefined;
|
|
95
|
-
hasPool(id: PoolId): boolean;
|
|
96
|
-
destroyPool(id: PoolId): boolean;
|
|
97
|
-
acquire<T extends object>(poolId: PoolId): T;
|
|
98
|
-
release<T extends object>(poolId: PoolId, obj: T): void;
|
|
99
|
-
getStats(poolId?: PoolId): PoolStats | PoolStats[];
|
|
100
|
-
getGlobalStats(): {
|
|
101
|
-
totalPools: number;
|
|
102
|
-
totalObjects: number;
|
|
103
|
-
totalActive: number;
|
|
104
|
-
totalAvailable: number;
|
|
105
|
-
memoryEstimate: number;
|
|
106
|
-
};
|
|
107
|
-
releaseAll(): void;
|
|
108
|
-
destroy(): void;
|
|
109
|
-
}
|
|
110
|
-
export declare function createPoolManager(): NicePool;
|
|
111
|
-
export declare function createSimplePool<T extends object>(createFn: () => T, config?: Partial<PoolConfig>): Pool<T>;
|
|
112
|
-
export interface Vec2Poolable {
|
|
113
|
-
x: number;
|
|
114
|
-
y: number;
|
|
115
|
-
active?: boolean;
|
|
116
|
-
onSpawn?: () => void;
|
|
117
|
-
onDespawn?: () => void;
|
|
118
|
-
}
|
|
119
|
-
export declare function createVec2Pool(initialSize?: number): Pool<Vec2Poolable>;
|
|
120
|
-
export interface Vec3Poolable {
|
|
121
|
-
x: number;
|
|
122
|
-
y: number;
|
|
123
|
-
z: number;
|
|
124
|
-
active?: boolean;
|
|
125
|
-
onSpawn?: () => void;
|
|
126
|
-
onDespawn?: () => void;
|
|
127
|
-
}
|
|
128
|
-
export declare function createVec3Pool(initialSize?: number): Pool<Vec3Poolable>;
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
export interface Vec3 {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
z: number;
|
|
5
|
-
}
|
|
6
|
-
export interface Quat {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
z: number;
|
|
10
|
-
w: number;
|
|
11
|
-
}
|
|
12
|
-
export type PortalType = 'linked' | 'one-way' | 'dimension' | 'zone' | 'spawn';
|
|
13
|
-
export type PortalState = 'inactive' | 'activating' | 'active' | 'deactivating' | 'cooldown';
|
|
14
|
-
export interface PortalDefinition {
|
|
15
|
-
id: string;
|
|
16
|
-
type: PortalType;
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
depth: number;
|
|
20
|
-
shape: 'rectangle' | 'oval' | 'custom';
|
|
21
|
-
color: string;
|
|
22
|
-
emissiveColor: string;
|
|
23
|
-
particleEffect?: string;
|
|
24
|
-
soundEffect?: string;
|
|
25
|
-
activationTime: number;
|
|
26
|
-
cooldownTime: number;
|
|
27
|
-
requiresKey: boolean;
|
|
28
|
-
keyItemId?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface Portal {
|
|
31
|
-
id: string;
|
|
32
|
-
definitionId: string;
|
|
33
|
-
name: string;
|
|
34
|
-
position: Vec3;
|
|
35
|
-
rotation: Quat;
|
|
36
|
-
state: PortalState;
|
|
37
|
-
active: boolean;
|
|
38
|
-
linkedPortalId: string | null;
|
|
39
|
-
destinationDimension: string | null;
|
|
40
|
-
destinationPosition: Vec3 | null;
|
|
41
|
-
entitiesInRange: Set<string>;
|
|
42
|
-
activationProgress: number;
|
|
43
|
-
lastUsedAt: number;
|
|
44
|
-
usageCount: number;
|
|
45
|
-
metadata: Record<string, unknown>;
|
|
46
|
-
}
|
|
47
|
-
export interface PortalLink {
|
|
48
|
-
portalA: string;
|
|
49
|
-
portalB: string;
|
|
50
|
-
bidirectional: boolean;
|
|
51
|
-
preserveVelocity: boolean;
|
|
52
|
-
preserveOrientation: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface Dimension {
|
|
55
|
-
id: string;
|
|
56
|
-
name: string;
|
|
57
|
-
description: string;
|
|
58
|
-
gravity: Vec3;
|
|
59
|
-
timeScale: number;
|
|
60
|
-
ambientColor: string;
|
|
61
|
-
fogDensity: number;
|
|
62
|
-
musicTrack?: string;
|
|
63
|
-
weatherType?: string;
|
|
64
|
-
spawnPoints: Vec3[];
|
|
65
|
-
isDefault: boolean;
|
|
66
|
-
}
|
|
67
|
-
export interface TeleportRequest {
|
|
68
|
-
entityId: string;
|
|
69
|
-
sourcePortalId: string;
|
|
70
|
-
targetPortalId: string | null;
|
|
71
|
-
targetPosition: Vec3 | null;
|
|
72
|
-
targetDimension: string | null;
|
|
73
|
-
velocity: Vec3;
|
|
74
|
-
orientation: Quat;
|
|
75
|
-
}
|
|
76
|
-
export interface TeleportResult {
|
|
77
|
-
success: boolean;
|
|
78
|
-
entityId: string;
|
|
79
|
-
startPosition: Vec3;
|
|
80
|
-
endPosition: Vec3;
|
|
81
|
-
startDimension: string;
|
|
82
|
-
endDimension: string;
|
|
83
|
-
duration: number;
|
|
84
|
-
reason?: string;
|
|
85
|
-
}
|
|
86
|
-
export type PortalEventType = 'portal-created' | 'portal-destroyed' | 'portal-activated' | 'portal-deactivated' | 'portal-enter' | 'portal-exit' | 'teleport-start' | 'teleport-complete' | 'teleport-failed' | 'dimension-enter' | 'dimension-exit' | 'link-created' | 'link-removed';
|
|
87
|
-
export interface PortalEvent {
|
|
88
|
-
type: PortalEventType;
|
|
89
|
-
timestamp: number;
|
|
90
|
-
data: unknown;
|
|
91
|
-
}
|
|
92
|
-
export type PortalEventCallback = (event: PortalEvent) => void;
|
|
93
|
-
export interface PortalConfig {
|
|
94
|
-
/** Maximum portals */
|
|
95
|
-
maxPortals: number;
|
|
96
|
-
/** Default activation range */
|
|
97
|
-
activationRange: number;
|
|
98
|
-
/** Default teleport range */
|
|
99
|
-
teleportRange: number;
|
|
100
|
-
/** Cooldown between uses */
|
|
101
|
-
cooldownTime: number;
|
|
102
|
-
/** Transition duration */
|
|
103
|
-
transitionDuration: number;
|
|
104
|
-
/** Current dimension */
|
|
105
|
-
currentDimension: string;
|
|
106
|
-
/** Allow cross-dimension portals */
|
|
107
|
-
allowCrossDimension: boolean;
|
|
108
|
-
}
|
|
109
|
-
export declare const DEFAULT_PORTAL_CONFIG: PortalConfig;
|
|
110
|
-
export declare const DEFAULT_PORTAL_DEFINITIONS: PortalDefinition[];
|
|
111
|
-
export declare const DEFAULT_DIMENSIONS: Dimension[];
|
|
112
|
-
export declare class NicePortal {
|
|
113
|
-
private config;
|
|
114
|
-
private definitions;
|
|
115
|
-
private portals;
|
|
116
|
-
private links;
|
|
117
|
-
private dimensions;
|
|
118
|
-
private eventListeners;
|
|
119
|
-
private nextPortalId;
|
|
120
|
-
constructor(config?: Partial<PortalConfig>);
|
|
121
|
-
on(event: PortalEventType, callback: PortalEventCallback): () => void;
|
|
122
|
-
private emit;
|
|
123
|
-
registerDefinition(definition: PortalDefinition): void;
|
|
124
|
-
getDefinition(id: string): PortalDefinition | undefined;
|
|
125
|
-
registerDimension(dimension: Dimension): void;
|
|
126
|
-
getDimension(id: string): Dimension | undefined;
|
|
127
|
-
getAllDimensions(): Dimension[];
|
|
128
|
-
getCurrentDimension(): Dimension | undefined;
|
|
129
|
-
setCurrentDimension(dimensionId: string): boolean;
|
|
130
|
-
createPortal(definitionId: string, position: Vec3, rotation?: Quat, options?: {
|
|
131
|
-
name?: string;
|
|
132
|
-
linkedPortalId?: string;
|
|
133
|
-
destinationDimension?: string;
|
|
134
|
-
destinationPosition?: Vec3;
|
|
135
|
-
metadata?: Record<string, unknown>;
|
|
136
|
-
}): string | null;
|
|
137
|
-
destroyPortal(portalId: string): void;
|
|
138
|
-
link(portalAId: string, portalBId: string, options?: {
|
|
139
|
-
bidirectional?: boolean;
|
|
140
|
-
preserveVelocity?: boolean;
|
|
141
|
-
preserveOrientation?: boolean;
|
|
142
|
-
}): string | null;
|
|
143
|
-
unlink(linkId: string): void;
|
|
144
|
-
getLink(linkId: string): PortalLink | undefined;
|
|
145
|
-
activate(portalId: string): boolean;
|
|
146
|
-
private completeActivation;
|
|
147
|
-
deactivate(portalId: string): void;
|
|
148
|
-
checkEntityProximity(entityId: string, entityPosition: Vec3): void;
|
|
149
|
-
private tryTeleport;
|
|
150
|
-
teleportEntity(entityId: string, targetPosition: Vec3, targetDimension?: string): TeleportResult;
|
|
151
|
-
update(deltaTime: number): void;
|
|
152
|
-
getPortal(id: string): Portal | undefined;
|
|
153
|
-
getAllPortals(): Portal[];
|
|
154
|
-
getActivePortals(): Portal[];
|
|
155
|
-
getPortalsByDimension(dimensionId: string): Portal[];
|
|
156
|
-
getNearbyPortals(position: Vec3, radius: number): Portal[];
|
|
157
|
-
getConnectedPortal(portalId: string): Portal | undefined;
|
|
158
|
-
isPortalActive(portalId: string): boolean;
|
|
159
|
-
getPortalRenderInfo(portalId: string): {
|
|
160
|
-
position: Vec3;
|
|
161
|
-
rotation: Quat;
|
|
162
|
-
size: {
|
|
163
|
-
width: number;
|
|
164
|
-
height: number;
|
|
165
|
-
};
|
|
166
|
-
color: string;
|
|
167
|
-
emissiveColor: string;
|
|
168
|
-
activationProgress: number;
|
|
169
|
-
linkedView?: {
|
|
170
|
-
position: Vec3;
|
|
171
|
-
rotation: Quat;
|
|
172
|
-
};
|
|
173
|
-
} | null;
|
|
174
|
-
private vec3Distance;
|
|
175
|
-
private generateId;
|
|
176
|
-
destroy(): void;
|
|
177
|
-
}
|
|
178
|
-
export declare function createPortalSystem(config?: Partial<PortalConfig>): NicePortal;
|