cocos_scaffold_enemy_ai
Generate starter TypeScript files for enemy AI behaviors in Cocos Creator projects, including patrol, chase, and shooting patterns with configurable properties.
Instructions
Generate Enemy{Kind}.ts — common enemy-behaviour starters.
"patrol" — oscillates between @property Nodes patrolA ↔ patrolB. Flips optional @property mirrorSprite on direction change. Exposes @property speed. "chase" — tracks @property target Node when within chaseRadius; gives up past loseAggroRadius (hysteresis prevents aggro flicker). Kinematic setPosition update. @property moveSpeed. "shoot" — stationary turret. Every @property fireInterval s, instantiates @property bulletPrefab with velocity toward @property target if within @property range.
Default rel_path per kind: EnemyPatrol.ts / EnemyChase.ts /
EnemyShoot.ts. Returns the usual four keys.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_path": "<project_path>"
},
"name": "cocos_scaffold_enemy_ai"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| kind | No | patrol | |
| rel_path | No |