0.4.2 • Published 5 months ago
react-ts-asteroids v0.4.2
React TypeScript Asteroids
A classic Asteroids game implementation as a React component, written in TypeScript.
Installation
npm install react-ts-asteroids
Quick Start
- Import the Asteroids component:
import { Asteroids } from 'react-ts-asteroids';
- Add it to your React application:
function App() {
return (
<div style={{ width: '100%', height: '100vh' }}>
<Asteroids />
</div>
);
}
Note: The container element must have a defined width and height for the game to render properly.
Controls
Features
- Classic Asteroids gameplay
- Responsive design - adapts to container size
- Score tracking with local storage for high scores
- Particle effects for explosions and thrusters
- Written in TypeScript with React
License
ISC