Initial Cocos Creator port of main-site Unity WebGL game.

Includes core gameplay, 600 exported levels, visual assets, web bridge, and bootstrap scene.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-22 14:57:46 +08:00
commit cba5105908
88 changed files with 13798 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
export enum EventType {
LevelInit = 'LevelInit',
InputEnd = 'InputEnd',
}
type Handler = (...args: unknown[]) => void;
const listeners = new Map<EventType, Handler[]>();
export const EventManager = {
register(type: EventType, handler: Handler) {
if (!listeners.has(type)) listeners.set(type, []);
const list = listeners.get(type)!;
if (!list.includes(handler)) list.push(handler);
},
remove(type: EventType, handler: Handler) {
const list = listeners.get(type);
if (!list) return;
const i = list.indexOf(handler);
if (i >= 0) list.splice(i, 1);
},
dispatch(type: EventType, ...args: unknown[]) {
const list = listeners.get(type);
if (!list) return;
for (const h of [...list]) h(...args);
},
};