cocos_scaffold_player_controller
Generate game-type-specific player controller scripts for Cocos Creator games. Creates TypeScript files that read input and drive character motion for platformer, top-down, flappy bird, or click-based movement styles.
Instructions
Generate Player{Kind}.ts — game-type-specific player controller.
Reads the InputManager singleton (run cocos_scaffold_input_abstraction
FIRST) and drives node motion. Which fields the script exposes on
the Inspector depends on the kind:
"platformer" — side-view with gravity. Reads moveDir.x + jumpPressed. Requires cc.RigidBody2D + cc.Collider2D on the node. @property moveSpeed / jumpForce / doubleJumpEnabled. "topdown" — bird's-eye. Full moveDir. RigidBody2D gravityScale should be 0. @property moveSpeed. "flappy" — jump-only. jumpPressed → fixed velocity.y impulse. @property flapForce. Gravity carries it down. "click_only" — no physics body. Each click eases node _lpos toward the hit point via tween. @property easeSpeed.
Default rel_path per kind: PlayerPlatformer.ts / PlayerTopdown.ts /
PlayerFlappy.ts / PlayerClick.ts. Returns
{path, rel_path, uuid_standard, uuid_compressed}.
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_player_controller"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| kind | No | platformer | |
| rel_path | No |