collision-and-state

Implement AABB collision detection, score updates, and game-state transitions in main.js.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/waltstephen/VibeTeachMsc --skill collision-and-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: collision-and-state
Source: https://github.com/waltstephen/VibeTeachMsc/tree/main/skills/collision-and-state
Command: npx skills add https://github.com/waltstephen/VibeTeachMsc --skill collision-and-state

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a compact approach for introducing obstacle collision detection, score updates, and simple game-state transitions within the Dino teaching repo, helping students reason about state changes and safe loop control.

Core Features & Use Cases

  • Minimal AABB collision detection between the dino and obstacles.
  • Incremental score updates tied to game state.
  • Safe restart logic that resets all relevant state to a clean run.

Quick Start

Implement a minimal AABB collision check and basic score/state updates in main.js and verify that restart resets all relevant state.

Frequently Asked Questions about collision-and-state

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

FAQPage Schema
How do I implement AABB collision detection for a dino game?

AABB collision detection uses simple axis-aligned bounding boxes to check for intersections between the dino and obstacles. It provides a minimal bounding box approach to trigger game-over behavior upon overlap.

What is the best way to handle game-state transitions and restart logic?

Game-state transitions are handled by resetting all relevant score and state variables to a clean run. Safe loop processing ensures the game resets properly when restarting after a collision event.

How do I update game score based on state changes in JavaScript?

Game score updates are tied directly to game state, incrementing safely during active runs. The score logic integrates with state transitions to ensure values reset cleanly during restart handling.

Can I use simple AABB collision without external dependencies?

Yes, simple AABB collision detection can be implemented without external dependencies. The approach uses basic bounding box math directly in main.js, requiring no additional libraries to detect obstacle intersections.

Why does my dino game restart loop not reset the score correctly?

A dino game restart loop fails to reset the score when state variables are not cleared properly. Safe loop handling requires explicitly resetting all relevant score and game-state variables for a clean run.