game-loop

Implement a fixed timestep game loop with interpolation for physics and rendering.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill game-loop-dadbodgeoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game-loop
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/game-loop
Command: npx skills add https://github.com/dadbodgeoff/drift --skill game-loop-dadbodgeoff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill ensures consistent game physics and smooth rendering regardless of the player's monitor refresh rate or system performance, preventing visual stuttering and physics glitches.

Core Features & Use Cases

  • Fixed Timestep Physics: Guarantees deterministic physics calculations.
  • Interpolation: Renders smooth visuals between physics updates.
  • Time Manipulation: Supports effects like hitstop and slow-motion.
  • Use Case: Essential for any browser-based game where consistent physics and smooth animation are critical for a good player experience.

Quick Start

Use the game-loop skill to start a new game loop with a fixed timestep of 1/60th of a second.

Frequently Asked Questions about game-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make JavaScript game physics frame-rate independent?

To make JavaScript game physics frame-rate independent, you implement a fixed timestep game loop with interpolation. This ensures deterministic physics calculations and smooth rendering across varying system performance and monitor refresh rates.

What is a fixed timestep game loop with interpolation in TypeScript?

A fixed timestep game loop with interpolation is an architecture that separates physics updates from rendering. It uses time accumulation to execute physics at a fixed rate while interpolating visual states between updates to prevent visual stuttering.

How do I implement hitstop and time scaling for game feel in JavaScript?

You can implement hitstop and time scaling for game feel by using a game loop that supports time manipulation. This allows you to dynamically adjust the physics update rate to create slow-motion effects or freeze frames.

Why does my browser game stutter on different monitor refresh rates?

Browser games stutter on different monitor refresh rates when physics updates are tied directly to the render frame rate. Using a fixed timestep loop with interpolation decouples these processes, ensuring consistent game behavior and smooth visuals.

Do I need a fixed timestep for my browser-based game?

You need a fixed timestep for your browser-based game if consistent physics and smooth animation are critical. It guarantees deterministic calculations regardless of whether the player's system drops frames or uses a high refresh rate monitor.