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,47 @@
import { Direction } from '../core/Define';
import { LevelConfig } from './LevelTypes';
import { LEVELS_600 } from './levels-600.generated';
/** 额外关卡(多人等) */
const EXTRA_LEVELS: Record<number, LevelConfig> = {
601: {
levelID: 601,
boundary: { x: 20, y: 20 },
spawns: [
{ x: 0, y: 0, kind: 'player', playerDirection: Direction.North },
{ x: 6, y: 6, kind: 'prop' },
{ x: -1, y: 2, kind: 'prop' },
],
},
999001: {
levelID: 999001,
boundary: { x: 999, y: 999 },
spawns: [
{ x: -9, y: -9, kind: 'player', playerDirection: Direction.South },
{ x: 9, y: 9, kind: 'player', playerDirection: Direction.North },
{ x: -9, y: -10, kind: 'vehicle', vehicleDirection: Direction.North },
{ x: 9, y: 10, kind: 'vehicle', vehicleDirection: Direction.South },
],
},
};
const allLevels: Record<number, LevelConfig> = {
...LEVELS_600,
...EXTRA_LEVELS,
};
export function getLevelConfig(levelID: number): LevelConfig | null {
return allLevels[levelID] ?? null;
}
export function hasLevel(levelID: number): boolean {
return levelID in allLevels;
}
export function registerLevel(config: LevelConfig) {
allLevels[config.levelID] = config;
}
export function getLevelCount(): number {
return Object.keys(allLevels).length;
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "05e4b37c-f71a-42c0-b8f6-88fda70b655d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,22 @@
import { Direction } from '../core/Define';
export type SpawnKind = 'player' | 'vehicle' | 'prop' | 'prop_decor' | 'enemy';
export interface SpawnConfig {
x: number;
y: number;
kind: SpawnKind;
playerDirection?: Direction;
vehicleDirection?: Direction;
}
/** 稀疏地块key 为 "x,y" */
export interface LevelConfig {
levelID: number;
boundary: { x: number; y: number };
spawns: SpawnConfig[];
/** Ground 层 tile 名 */
ground?: Record<string, string>;
/** Border 阻挡格 */
border?: Record<string, boolean>;
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "9fd69354-fd48-4ecf-9bd3-2cb056258612",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "c5bd9bd8-738e-4bbc-8f04-8b1c77279929",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "507007a3-8bd2-41d5-b962-44c38a653bbb",
"files": [],
"subMetas": {},
"userData": {}
}