Use when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases
中文简介正在准备中。当前显示原文说明。
Use when adding controls, menus, HUD, subtitles or effects - input through named actions with rebinding and controller support per engine, input buffering, and the accessibility floor (remapping, colour-blind safe cues, subtitles, text scale, reduced motion and flashes).
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Players use keyboards, mice, gamepads, touch screens and adaptive controllers, with different hands, eyes and ears. Code that reads KeyCode.Space directly cannot be rebound, cannot be driven by a gamepad without a second branch, and cannot be tested without a keyboard. Gameplay reads named actions; devices map to actions in one place.
Core principle: Gameplay never sees a key code. Every action is rebindable, every essential cue reaches the player through more than one sense, and motion and flashing can be turned down.
// ❌ Unity legacy, device-bound, unrebindable
if (Input.GetKeyDown(KeyCode.Space)) Jump();
// ✅ Unity Input System action (from the .inputactions asset or its generated class)
[SerializeField] InputActionReference jump;
void OnEnable() { jump.action.performed += OnJump; jump.action.Enable(); }
void OnDisable() { jump.action.performed -= OnJump; }
void OnJump(InputAction.CallbackContext _) => _intents.Jump();
# Godot: actions from the InputMap, never physical keys in gameplay
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("jump"):
intents.jump()
// Unreal Enhanced Input
void AHeroCharacter::SetupPlayerInputComponent(UInputComponent* Input) {
auto* EIC = CastChecked<UEnhancedInputComponent>(Input);
EIC->BindAction(JumpAction, ETriggerEvent::Started, this, &AHeroCharacter::OnJump);
EIC->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AHeroCharacter::OnMove);
}
// The mapping context is added through UEnhancedInputLocalPlayerSubsystem::AddMappingContext.
// Web: map KeyboardEvent.code (layout-independent position) to actions; poll gamepads each frame
const bindings: Record<string, Action> = { Space: "jump", KeyW: "up", ArrowUp: "up" };
window.addEventListener("keydown", (e) => { const a = bindings[e.code]; if (a) input.press(a); });
// in the loop: for (const pad of navigator.getGamepads()) if (pad?.buttons[0].pressed) input.press("jump");
Bevy: ButtonInput<KeyCode> / ButtonInput<GamepadButton> behind an action layer (or the leafwing-input-manager crate if the repo uses it).
action.PerformInteractiveRebinding(), then actions.SaveBindingOverridesAsJson() to settings and LoadBindingOverridesFromJson at boot.InputMap.action_erase_events + action_add_event, saved to a ConfigFile under user://.UEnhancedInputUserSettings (UE 5.2+) or the project's existing settings system.bindings map in settings storage.touch-action: none.Input buffering (a jump pressed 0.1 s before landing still jumps) and coyote time (a jump 0.1 s after walking off a ledge still counts) are measured in seconds on the simulation clock, and they belong to the rule class, so they get tests:
it("buffers a jump pressed 80 ms before landing", () => {
const c = new JumpRules({ bufferSeconds: 0.1 });
c.pressJump(); c.step(0.08); c.land(); c.step(1 / 60);
expect(c.isJumping).toBe(true);
});
Ship these unless the task explicitly scopes them out:
Settings live in data and persist (game-save-and-persistence); each option has a test that the setting changes the behaviour it promises (e.g. reduced motion → shake amplitude is zero).
if branch per device.KeyboardEvent.key for movement (breaks on AZERTY) instead of code.Input.GetKey, Input.is_key_pressed, IsInputKeyDown or raw keydown handling in a gameplay class.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Use when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases
中文简介正在准备中。当前显示原文说明。
Use when the diff adds or changes an endpoint, resolver, RPC, job or query that takes an object id, a role check, a request binding or a tenant filter - BOLA/IDOR, function-level authorization, mass assignment and tenant scoping
中文简介正在准备中。当前显示原文说明。
Use on every UI change - semantic HTML, labels for controls, keyboard-navigable dialogs/menus, visible focus, and never color as the only signal
中文简介正在准备中。当前显示原文说明。
Use when a task changes any screen, form, dialog, menu or control - Lighthouse/axe scan of the changed screens, a keyboard walk, and the thresholds that fail a task
中文简介正在准备中。当前显示原文说明。
How to work a task returned with review, QA or UAT findings. Use when a task is in need_revision or PR review comments are in your context.
中文简介正在准备中。当前显示原文说明。
Use when the repository keeps its alerting in code, or a person asks for alerts outside TaskTrooper - PrometheusRule YAML, a Cloud Monitoring alert policy in Terraform, a Datadog monitor, each routed to TaskTrooper's alert ingest URL so it opens an incident here
中文简介正在准备中。当前显示原文说明。