# XR Game template

> A physics play space for VR games: grab, throw, hit and score, with a scoreboard, sounds and a can-knockdown game to start from.

Source: https://graspable.dev/templates/xr-game

Plan: Builder and higher. See https://graspable.dev/pricing.md.

## What you start with

React Three Fiber + @react-three/xr + Rapier physics, in a Vite project. It is ordinary code in a folder on your computer: read it, edit it, keep it.

## Where it runs

Any WebXR browser, such as Meta Quest and Apple Vision Pro, and a flat screen with mouse or touch. The app has an emulated headset to try it before you put one on.

## Requests to try

- Turn it into basketball: a hoop with a backboard on the back wall, 2 points per basket, 45 seconds on the clock.
- Make it a bowling lane: ten pins at the end of a 4 metre lane, one heavy ball, a bonus for a strike.
- Add three targets that slide left and right above the shelf; hitting one is worth 25 points and makes it flash.
- Whack-a-mole: moles pop up from the counter, give me a hammer to grab, and make them faster every round.
- Three levels: 6 cans, then 10 cans, then cans on a shelf that moves side to side. Show the level on the scoreboard.

## How a run ends

The agent edits the project on your computer. A run ends only when it builds and loads in a real browser.

## Examples

- [Arcade basketball](https://graspable.dev/a/s8t7x4oc): Grab a ball off the rack, swing, let go: it bounces off the backboard, rattles the rim and the scoreboard counts.

## Start a project

Get Graspable at https://graspable.dev/download. Choose XR Game when creating a project. For an existing agent, see https://graspable.dev/docs/use-with-ai-agents.md.
