# Reaction Time Game (/docs/cookbook/reaction-time-game)

import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';

## Introduction

In this tutorial, you'll build an interactive reaction time game that proves blockchain doesn't have to be slow. The game challenges players to test their reflexes while simultaneously recording each click on the blockchain, showcasing RISE's groundbreaking **3ms transaction pre-confirmations**.

### What You'll Build

An arcade-style game with:

* 5-round reaction time test with millisecond precision
* Realtime blockchain transaction recording for each click
* Pre-signed transaction pool for zero-latency gameplay
* Performance metrics comparing reaction time vs transaction time
* Retro arcade UI with dynamic color transitions

### What You'll Learn

* How to build latency-sensitive applications on blockchain
* Using `eth_sendRawTransactionSync` for synchronous confirmations
* Pre-signing transaction batches for optimal performance
* Transaction pool management with background refilling
* Measuring blockchain overhead with precision timing
* Building game state machines in React

### The Secret Sauce: 3ms Confirmations

Traditional blockchains take 100-300ms+ just to confirm transactions. too slow for realtime gaming. RISE's synchronous transactions confirm in **\~3ms**, making blockchain fast enough for arcade games, trading bots, and other latency-critical apps.

**This game proves it**: Your total response time (reaction + blockchain) will be only \~3ms slower than your raw reaction time!

### Prerequisites

Before starting, make sure you have:

* Node.js 18+ installed
* Basic knowledge of React and Next.js
* Understanding of TypeScript
* A burner wallet private key for testnet (we'll generate one)

<Callout type="info">
  This tutorial uses a **burner wallet** (exposed private key) for simplicity. Never use real funds with this pattern!
</Callout>

### Source Code

The complete source code for this project is available on GitHub: [awesamarth/reaction-time](https://github.com/awesamarth/reaction-time)

## Quick Links

<Cards>
  <Card title="Setup" href="/docs/cookbook/reaction-time-game/setup" description="Project setup, dependencies, and configuration" />

  <Card title="Implementation" href="/docs/cookbook/reaction-time-game/implementation" description="Build the game with Shreds integration" />
</Cards>
