smithery/verekia

pushback

Make enemies flash white and rock back and forth when receiving damage.

Installation

$ npx skills add smithery/verekia --skill pushback

Also in this package

Other skills from smithery/verekia · top by installs.

npx skills add smithery/verekia

Browse all from smithery/verekia

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,296 B
  • docs SUMMARY.md 87 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Pushback

Make enemies flash white and rock back and forth when receiving damage.

Technique

Track pushback state with a direction vector and progress value. In useFrame, interpolate the position along the pushback direction using a back-and-forth curve, and change the material color to white during the effect.

Key Concepts

  • Store pushback direction (dx, dy) and progress (0 to 1)
  • Use a triangle wave for back-and-forth motion: t < 0.5 ? t 2 : (1 - t) 2
  • Flash material color to white during pushback
  • Reset to original position and color when complete
  • Direction should be opposite to the damage source (player position)

Usage

const pushbackRef = useRef<{ dx: number; dy: number } | null>(null)
const pushbackProgress = useRef(0)

useFrame((_, delta) => {
  if (pushbackRef.current) {
    pushbackProgress.current += delta * 8
    material.color.set('white')

    const t = pushbackProgress.current
    const offset = t < 0.5 ? t * 2 : (1 - t) * 2
    mesh.position.x = baseX + pushbackRef.current.dx * offset
  }
})

This skill is part of verekia's r3f-gamedev.