Skip to main content
Glama

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}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
kindNoplatformer
rel_pathNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well. It discloses that the tool generates files, specifies dependencies (InputManager singleton), describes what fields appear in Inspector for each kind, mentions physics requirements for some kinds, and indicates the return format. It doesn't cover error conditions or performance aspects, but provides substantial behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose. Every sentence adds value: the first states what it does, the second explains dependencies, the third introduces the kind parameter, and subsequent sections detail each kind. Minor formatting issues with code-like elements slightly affect readability, but no wasted content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter tool with no annotations and no output schema, the description provides substantial context: purpose, usage prerequisites, parameter semantics, behavioral details about generated files and Inspector properties, and return format. It doesn't explain error handling or edge cases, but covers the essential aspects well given the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for 3 parameters, the description compensates fully. It explains the 'kind' parameter with detailed descriptions of 4 options (platformer, topdown, flappy, click_only), clarifies that 'rel_path' has defaults per kind, and implies 'project_path' is required for file generation. This adds crucial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool generates a game-type-specific player controller script (Player{Kind}.ts) that reads InputManager and drives node motion. It distinguishes from siblings by specifying it's for player controller scaffolding rather than other components like audio, animation, or UI elements listed in the sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: it specifies that cocos_scaffold_input_abstraction should be run FIRST, and explains which kind to use for different game types (platformer, topdown, flappy, click_only). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chenShengBiao/cocos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server