Test sprite from script

This commit is contained in:
2026-06-02 09:32:07 -05:00
parent 57766a9104
commit a25871a849
38 changed files with 1913 additions and 377 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
interface Entity {
/**
* Adds a component of the given type and returns it.
* Returns a typed subclass when the component has a dedicated module
* (`Position`, `Camera`, `Renderable`, `Trigger`, `Physics`); otherwise
* returns the base `Component`. Cast with `as Position` etc. when needed.
*/
add(type: number): Component;
toString(): string;
}
interface EntityConstructor {
/** Sentinel for an invalid entity ID. */
readonly INVALID: number;
/** Allocates a new entity from the fixed pool (max 64). */
create(): Entity;
/** Disposes the entity and all of its components. */
dispose(entity: Entity): void;
new(): never;
}
declare var Entity: EntityConstructor;